Skip to content

Commit

Permalink
editor: adapt JSON schema form options
Browse files Browse the repository at this point in the history
* Adapts the JSON schema form options for a new ng-core editor version.
* Changes the schemaform URL to schemas to be more compliant with other
  RERO application.
* Closes rero#1426.
* Closes rero#1423.
* Closes rero#1366.

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Feb 10, 2021
1 parent fccfa68 commit 42a8acf
Show file tree
Hide file tree
Showing 50 changed files with 312 additions and 365 deletions.
2 changes: 1 addition & 1 deletion rero_ils/jsonschemas/common/cantons-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
}
],
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-4"
},
"hideExpression": "field.parent.model.country !== 'sz'"
}
Expand Down
2 changes: 1 addition & 1 deletion rero_ils/jsonschemas/common/countries-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@
}
],
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-4"
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions rero_ils/jsonschemas/common/languages-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@
}
],
"templateOptions": {
"cssClass": "col-lg-6"
"itemCssClass": "col-lg-6"
}
}
},
Expand Down Expand Up @@ -2537,7 +2537,7 @@
],
"form": {
"templateOptions": {
"cssClass": "col-lg-6"
"itemCssClass": "col-lg-6"
},
"hide": true
}
Expand All @@ -2554,7 +2554,7 @@
],
"form": {
"templateOptions": {
"cssClass": "row"
"containerCssClass": "row"
}
},
"properties": {
Expand All @@ -2564,7 +2564,7 @@
"minLength": 1,
"form": {
"templateOptions": {
"cssClass": "col-lg-6"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -2578,7 +2578,7 @@
"type": "object",
"form": {
"templateOptions": {
"cssClass": "row"
"containerCssClass": "row"
}
},
"propertiesOrder": [
Expand All @@ -2595,7 +2595,7 @@
"minLength": 1,
"form": {
"templateOptions": {
"cssClass": "col-lg-12"
"itemCssClass": "col-lg-12"
},
"focus": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@
"default": "in progress",
"form": {
"type": "selectWithSort",
"wrappers": [
"form-field-horizontal"
],
"options": [
{
"value": "in_progress",
Expand Down Expand Up @@ -165,9 +162,6 @@
"form": {
"type": "datepicker",
"placeholder": "Select a date",
"wrappers": [
"form-field"
],
"validation": {
"messages": {
"patternMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD)."
Expand Down Expand Up @@ -202,9 +196,6 @@
],
"form": {
"type": "selectWithSort",
"wrappers": [
"form-field-horizontal"
],
"options": [
{
"value": "shipping_and_handling",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
],
"form": {
"type": "selectWithSort",
"wrappers": [
"form-field"
],
"options": [
{
"label": "course",
Expand All @@ -75,6 +72,9 @@
}
],
"templateOptions": {
"wrappers": [
"form-field"
],
"selectWithSortOptions": {
"order": "label"
}
Expand All @@ -92,6 +92,9 @@
"required": [
"name"
],
"propertiesOrder": [
"name"
],
"properties": {
"name": {
"title": "Name",
Expand All @@ -101,11 +104,13 @@
},
"form": {
"templateOptions": {
"cssClass": "editor-title"
"wrappers": [
"card"
]
},
"hideExpression": "field.parent.model.collection_type !== 'course'",
"expressionProperties": {
"templateOptions.required": "field.parent.model.collection_type === 'course'"
"templateOptions.required": "true"
}
}
},
Expand All @@ -129,7 +134,9 @@
},
"form": {
"templateOptions": {
"cssClass": "editor-title"
"wrappers": [
"card"
]
}
}
},
Expand Down Expand Up @@ -212,7 +219,9 @@
},
"form": {
"templateOptions": {
"cssClass": "editor-title"
"wrappers": [
"card"
]
}
}
},
Expand Down Expand Up @@ -241,7 +250,9 @@
},
"form": {
"templateOptions": {
"cssClass": "editor-title"
"wrappers": [
"card"
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@
"type": "boolean",
"default": false,
"form": {
"wrappers": [
"hide"
]
"templateOptions": {
"wrappers": [
"hide"
]
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
}
},
"form": {
"hide": true,
"templateOptions": {
"cssClass": "editor-title"
}
"hide": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
"72\u00ba",
"96\u00ba",
"128\u00ba"
]
],
"form": {
"templateOptions": {
"cssClass": "w-md-50"
}
}
},
"form": {
"hide": true,
"templateOptions": {
"cssClass": "editor-title"
}
"hide": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@
"templateOptions": {
"selectWithSortOptions": {
"order": "label"
}
},
"cssClass": "w-md-50"
}
}
},
"form": {
"hide": true,
"templateOptions": {
"cssClass": "editor-title"
}
"hide": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
"hide": true,
"navigation": {
"essential": true
},
"templateOptions": {
"cssClass": "editor-title"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
],
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-4"
}
}
},
Expand All @@ -35,7 +35,7 @@
"minLength": 1,
"form": {
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-4"
}
}
},
Expand All @@ -48,7 +48,7 @@
"form": {
"hide": true,
"templateOptions": {
"cssClass": "col-lg-12"
"itemCssClass": "col-lg-12"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
"default": "bf:Organisation",
"const": "bf:Organisation",
"form": {
"wrappers": [
"hide"
]
"templateOptions": {
"wrappers": [
"hide"
]
}
}
},
"preferred_name": {
Expand All @@ -35,7 +37,7 @@
"form": {
"placeholder": "Example: M\u00fcller, Hans",
"templateOptions": {
"cssClass": "col-lg-6"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -52,7 +54,7 @@
},
"form": {
"templateOptions": {
"cssClass": "col-lg-12"
"itemCssClass": "col-lg-12"
}
}
},
Expand All @@ -63,7 +65,7 @@
"default": false,
"form": {
"templateOptions": {
"cssClass": "col-lg-12"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -74,7 +76,7 @@
"form": {
"placeholder": "Example: Lausanne",
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -85,7 +87,7 @@
"form": {
"placeholder": "Example: 4",
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -97,7 +99,7 @@
"form": {
"placeholder": "Example: 1989",
"templateOptions": {
"cssClass": "col-lg-4"
"itemCssClass": "col-lg-6"
}
}
},
Expand All @@ -107,7 +109,7 @@
},
"form": {
"templateOptions": {
"cssClass": "row"
"containerCssClass": "row"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"default": "bf:Organisation",
"const": "bf:Organisation",
"form": {
"wrappers": [
"hide"
]
"templateOptions": {
"wrappers": [
"hide"
]
}
}
},
"$ref": {
Expand All @@ -33,14 +35,14 @@
"enableGroupField": true
},
"templateOptions": {
"cssClass": "col-lg-12"
"itemCssClass": "col-lg-12"
}
}
}
},
"form": {
"templateOptions": {
"cssClass": "row"
"containerCssClass": "row"
}
}
}
Loading

0 comments on commit 42a8acf

Please sign in to comment.