Skip to content

Commit

Permalink
documents: add identifiedBy on some fields
Browse files Browse the repository at this point in the history
Fields involved:
supplement, supplementTo, otherEdition, otherPhysicalFormat,
issuedWith, precededBy, succeededBy, relatedTo, hasReproduction,
reproductionOf, work_access_point

* Removes templateOptions on the country jsonschema.
* Fixes typo on the type entry (lower case t).
* Adds the card wrapper on vendors jsonschema.
* Closes #2275.
* Closes #2388.
* Closes #2766.
* Closes #2659.
* Closes #2649.
* Closes #2625.
* Closes #2340.
* Closes #1924.

⚠️  Elasticsearch reindexing.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Jun 13, 2022
1 parent e683906 commit 4b3644a
Show file tree
Hide file tree
Showing 27 changed files with 158 additions and 123 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 @@ -140,7 +140,7 @@
"templateOptions": {
"itemCssClass": "col-lg-4"
},
"hideExpression": "field.parent.model.country !== 'sz'"
"hideExpression": "field?.parent?.model && field.parent.model.country !== 'sz'"
}
}
}
4 changes: 2 additions & 2 deletions rero_ils/jsonschemas/common/languages-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2541,7 +2541,7 @@
],
"form": {
"templateOptions": {
"itemCssClass": "col-lg-6"
"itemCssClass": "col-lg-12"
},
"hide": true
}
Expand All @@ -2568,7 +2568,7 @@
"minLength": 1,
"form": {
"templateOptions": {
"itemCssClass": "col-lg-6"
"itemCssClass": "col-lg-12"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
"format": "date",
"pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$",
"form": {
"hideExpression": "field.parent.model.status !== 'ordered' && field.parent.model.status !== 'received'",
"hideExpression": "field?.parent?.model && field.parent.model.status !== 'ordered' && field.parent.model.status !== 'received'",
"expressionProperties": {
"templateOptions.required": "field.parent.model.status === 'ordered' || field.parent.model.status === 'received'"
"templateOptions.required": "field?.parent?.model && (field.parent.model.status === 'ordered' || field.parent.model.status === 'received')"
},
"type": "datepicker",
"placeholder": "Select a date",
Expand All @@ -187,9 +187,9 @@
"format": "date",
"pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$",
"form": {
"hideExpression": "field.parent.model.status !== 'received'",
"hideExpression": "field?.parent?.model && field.parent.model.status !== 'received'",
"expressionProperties": {
"templateOptions.required": "field.parent.model.status === 'received'"
"templateOptions.required": "field?.parent?.model && field.parent.model.status === 'received'"
},
"type": "datepicker",
"placeholder": "Select a date",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
"name": {
"title": "Name",
"type": "string",
"minLength": 2
"minLength": 2,
"form": {
"focus": true
}
},
"description": {
"title": "Description",
Expand Down Expand Up @@ -104,7 +107,7 @@
"type": "integer",
"minimum": 1,
"form": {
"hideExpression": "!model.allow_requests",
"hideExpression": "model && !model.allow_requests",
"templateOptions": {
"addonRight": {
"text": "day(s)"
Expand Down Expand Up @@ -223,6 +226,10 @@
"required": [
"intervals"
],
"propertiesOrder": [
"intervals",
"maximum_total_amount"
],
"properties": {
"intervals": {
"type": "array",
Expand Down Expand Up @@ -308,15 +315,15 @@
"minimum": 0,
"default": 0,
"form": {
"hideExpression": "model.checkout_duration <= 0"
"hideExpression": "model && model.checkout_duration <= 0"
}
},
"renewal_duration": {
"title": "Renewal duration in days",
"type": "integer",
"minimum": 1,
"form": {
"hideExpression": "!model.hasOwnProperty('number_renewals') || model.number_renewals <= 0",
"hideExpression": "model && (!model.hasOwnProperty('number_renewals') || model.number_renewals <= 0)",
"templateOptions": {
"addonRight": {
"text": "day(s)"
Expand Down Expand Up @@ -364,7 +371,7 @@
}
},
"form": {
"hideExpression": "field.parent.model.policy_library_level !== true"
"hideExpression": "field?.parent?.model && field.parent.model.policy_library_level !== true"
}
},
"settings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"card"
]
},
"hideExpression": "field.parent.model.collection_type !== 'course'",
"hideExpression": "field?.parent?.model && field.parent.model.collection_type !== 'course'",
"expressionProperties": {
"templateOptions.required": "true"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "object",
"oneOf": [
{
"title": "contentType",
"title": "unknown media",
"additionalProperties": false,
"propertiesOrder": [
"contentType"
Expand Down Expand Up @@ -69,7 +69,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1002",
Expand Down Expand Up @@ -160,7 +160,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1021",
Expand Down Expand Up @@ -254,7 +254,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1011",
Expand Down Expand Up @@ -337,7 +337,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1030",
Expand Down Expand Up @@ -400,7 +400,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1032",
Expand Down Expand Up @@ -488,7 +488,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1042",
Expand Down Expand Up @@ -552,7 +552,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1045",
Expand Down Expand Up @@ -630,7 +630,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdact:1051",
Expand Down Expand Up @@ -696,7 +696,7 @@
"unspecified"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "unspecified",
Expand Down Expand Up @@ -752,7 +752,7 @@
"other"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "rdaco:1002",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,18 @@
}
},
"identifiedBy": {
"$ref": "https://bib.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution"
"allOf": [
{
"form": {
"templateOptions": {
"itemCssClass": "col-12"
}
}
},
{
"$ref": "https://bib.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution"
}
]
}
},
"form": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@
"type": "object",
"additionalProperties": false,
"propertiesOrder": [
"label"
"label",
"identifiedBy"
],
"required": [
"label"
Expand All @@ -252,6 +253,9 @@
"label": {
"type": "string",
"minLength": 1
},
"identifiedBy": {
"$ref": "https://bib.rero.ch/schemas/documents/document_identified_by-v0.0.1.json#/identifiedBy"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"noInfo"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "resource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"bf:Topic"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "bf:Topic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@
"minLength": 1,
"form": {
"placeholder": "Examples: LCCN, PMID, DNB",
"hide": true,
"hideExpression": "field?.parent?.model && field.parent.model.type !== 'bf:Local'",
"expressionProperties": {
"templateOptions.required": "field?.parent?.model && field.parent.model.type === 'bf:Local'"
},
"templateOptions": {
"itemCssClass": "col-lg-6"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"value",
"source"
],
"required": [
"type",
"value"
],
"properties": {
"type": {
"$ref": "#/definitions/type_main"
Expand Down Expand Up @@ -35,6 +39,10 @@
"value",
"source"
],
"required": [
"type",
"value"
],
"properties": {
"type": {
"$ref": "#/definitions/type_contribution"
Expand Down Expand Up @@ -88,10 +96,7 @@
}
],
"templateOptions": {
"itemCssClass": "col-lg-4"
},
"expressionProperties": {
"templateOptions.required": "true"
"itemCssClass": "col-lg-12"
}
}
},
Expand Down Expand Up @@ -124,10 +129,7 @@
}
],
"templateOptions": {
"itemCssClass": "col-lg-4"
},
"expressionProperties": {
"templateOptions.required": "true"
"itemCssClass": "col-lg-12"
}
}
},
Expand All @@ -137,10 +139,7 @@
"minLength": 1,
"form": {
"templateOptions": {
"itemCssClass": "col-lg-4"
},
"expressionProperties": {
"templateOptions.required": "true"
"itemCssClass": "col-lg-12"
}
}
},
Expand All @@ -151,12 +150,12 @@
"minLength": 1,
"form": {
"templateOptions": {
"itemCssClass": "col-lg-4"
"itemCssClass": "col-lg-12"
},
"expressionProperties": {
"templateOptions.required": "true"
},
"hideExpression": "field.parent.model && field.parent.model.type !== 'bf:Local'"
"hideExpression": "!field?.parent?.model || (field.parent.model && field.parent.model.type !== 'bf:Local')"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"target_understanding_caregivers"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "target_understanding_children",
Expand Down Expand Up @@ -230,7 +230,7 @@
"target_school_master"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "target_school_harmos1",
Expand Down Expand Up @@ -335,7 +335,7 @@
"pegi_18"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "pegi_3",
Expand Down Expand Up @@ -403,7 +403,7 @@
"from the age of 2"
],
"form": {
"Type": "selectWithSort",
"type": "selectWithSort",
"options": [
{
"label": "from the age of 18",
Expand Down
Loading

0 comments on commit 4b3644a

Please sign in to comment.