Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove schema duplication (fixes #297) #298

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions schema/article.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@
"type": "object",
"$merge": {
"source": {
"$ref": "content"
"$ref": "contentcontainer"
},
"with": {
"properties": {
"_requireCompletionOf": {
"type": "number",
"title": "Number of blocks required for completion",
"description": "The number of blocks within this article the learner must complete in order for this article to be set as completed. A value of -1 requires all of them to be completed",
"default": -1,
"_adapt": {
"isSetting": true
}
}
}
"properties": {}
}
}
}
11 changes: 1 addition & 10 deletions schema/block.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "object",
"$merge": {
"source": {
"$ref": "content"
"$ref": "contentcontainer"
},
"with": {
"properties": {
Expand All @@ -20,15 +20,6 @@
"_adapt": {
"editorOnly": true
}
},
"_requireCompletionOf": {
"type": "number",
"title": "Number of components required for completion",
"description": "The number of components within this block the learner must complete in order for this block to be set as completed. A value of -1 requires all of them to be completed",
"default": -1,
"_adapt": {
"isSetting": true
}
}
}
}
Expand Down
22 changes: 18 additions & 4 deletions schema/component.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
"type": "string",
"title": "Component"
},
"_supportedLayout": {
"type": "string",
"title": "Supported layout",
"default": "both",
"enum": [
"full-width",
"half-width",
"both"
],
"_adapt": {
"editorOnly": true
}
},
"_layout": {
"type": "string",
"title": "Layout",
Expand Down Expand Up @@ -44,10 +57,11 @@
"isSetting": true
}
},
"properties": {
"type": "object",
"title": "Properties",
"default": {}
"tags": {
"type": "array",
"_backboneForms": {
"showInUi": false
}
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions schema/contentcontainer.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$anchor": "contentcontainer",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$merge": {
"source": {
"$ref": "content"
},
"with": {
"properties": {
"_requireCompletionOf": {
"type": "number",
"title": "Number of child content objects required for completion",
"description": "The number of child content objects the learner must complete in order for this item to be set as completed. A value of -1 requires all of them to be completed",
"default": -1,
"_adapt": {
"isSetting": true
}
}
}
}
}
}
11 changes: 1 addition & 10 deletions schema/contentobject.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "object",
"$merge": {
"source": {
"$ref": "content"
"$ref": "contentcontainer"
},
"with": {
"properties": {
Expand Down Expand Up @@ -96,15 +96,6 @@
],
"_backboneForms": "Select"
},
"_requireCompletionOf": {
"type": "number",
"title": "Number of articles required for completion",
"description": "The number of articles within this page the learner must complete in order for this page to be set as completed. A value of -1 requires all of them to be completed",
"default": -1,
"_adapt": {
"isSetting": true
}
},
"menuSettings": {
"type": "object",
"title": "Menu settings",
Expand Down
28 changes: 1 addition & 27 deletions schema/course.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "object",
"$merge": {
"source": {
"$ref": "content"
"$ref": "contentcontainer"
},
"with": {
"properties": {
Expand Down Expand Up @@ -316,7 +316,6 @@
"_navOrder": {
"type": "number",
"title": "Navigation bar order",
"description": "Determines the order in which the object is displayed in the navigation bar. Negative numbers (e.g. -100) are left-aligned. Positive numbers (e.g. 100) are right-aligned.",
"default": 100
}
}
Expand All @@ -334,7 +333,6 @@
"_navOrder": {
"type": "number",
"title": "Navigation bar order",
"description": "Determines the order in which the object is displayed in the navigation bar. Negative numbers (e.g. -100) are left-aligned. Positive numbers (e.g. 100) are right-aligned.",
"default": -100
}
}
Expand All @@ -347,7 +345,6 @@
"_navOrder": {
"type": "number",
"title": "Navigation bar order",
"description": "Determines the order in which the object is displayed in the navigation bar. Negative numbers (e.g. -100) are left-aligned. Positive numbers (e.g. 100) are right-aligned.",
"default": 0
}
}
Expand All @@ -366,7 +363,6 @@
"_navOrder": {
"type": "number",
"title": "Navigation bar order",
"description": "Determines the order in which the object is displayed in the navigation bar. Negative numbers (e.g. -100) are left-aligned. Positive numbers (e.g. 100) are right-aligned.",
"default": 0
}
}
Expand Down Expand Up @@ -585,28 +581,6 @@
}
}
},
"tags": {
"type": "array",
"title": "Tags",
"description": "Add tags to your course by entering one or more words, separated with a comma (,)",
"items": {
"type": "string",
"isObjectId": true
},
"_adapt": {
"editorOnly": true
},
"_backboneForms": "Tags"
},
"_requireCompletionOf": {
"type": "number",
"title": "Number of pages/submenus required for completion",
"description": "The number of content objects within this course the learner must complete in order for this course to be set as completed. A value of -1 requires all of them to be completed",
"default": -1,
"_adapt": {
"isSetting": true
}
},
"_isSelected": {
"type": "boolean",
"title": "Is selected",
Expand Down