From a79d09ba84edc3b01a8f2dda6ded353b04870a74 Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Tue, 12 Apr 2022 18:44:18 +0200 Subject: [PATCH] documents: add identifiedBy on some fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../jsonschemas/common/languages-v0.0.1.json | 4 +- ...document_content_media_carrier-v0.0.1.json | 22 +++++------ ...ment_contribution_organisation-v0.0.1.json | 13 ++++++- .../document_document_relation-v0.0.1.json | 6 ++- .../document_electronic_locator-v0.0.1.json | 2 +- .../documents/document_genre_form-v0.0.1.json | 2 +- .../document_identified_by-v0.0.1.json | 5 ++- .../documents/document_identifier-v0.0.1.json | 27 +++++++------ .../document_intended_audience-v0.0.1.json | 8 ++-- .../document_provision_activity-v0.0.1.json | 38 ++++++++++++------- .../document_scale_cartographic-v0.0.1.json | 2 +- .../documents/document_types-v0.0.1.json | 1 - .../document_work_access_point-v0.0.1.json | 6 ++- .../v7/documents/document-v0.0.1.json | 28 +++++++------- .../ill_requests/ill_request-v0.0.1.json | 10 +---- .../items/jsonschemas/items/item-v0.0.1.json | 3 -- .../jsonschemas/vendors/vendor-v0.0.1.json | 7 ++++ 17 files changed, 106 insertions(+), 78 deletions(-) diff --git a/rero_ils/jsonschemas/common/languages-v0.0.1.json b/rero_ils/jsonschemas/common/languages-v0.0.1.json index 037b093582..e711f487df 100644 --- a/rero_ils/jsonschemas/common/languages-v0.0.1.json +++ b/rero_ils/jsonschemas/common/languages-v0.0.1.json @@ -2541,7 +2541,7 @@ ], "form": { "templateOptions": { - "itemCssClass": "col-lg-6" + "itemCssClass": "col-lg-12" }, "hide": true } @@ -2568,7 +2568,7 @@ "minLength": 1, "form": { "templateOptions": { - "itemCssClass": "col-lg-6" + "itemCssClass": "col-lg-12" } } }, diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json index 39757aab47..f0a2337b60 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_content_media_carrier-v0.0.1.json @@ -8,7 +8,7 @@ "type": "object", "oneOf": [ { - "title": "contentType", + "title": "unknown media", "additionalProperties": false, "propertiesOrder": [ "contentType" @@ -69,7 +69,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1002", @@ -160,7 +160,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1021", @@ -254,7 +254,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1011", @@ -337,7 +337,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1030", @@ -400,7 +400,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1032", @@ -488,7 +488,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1042", @@ -552,7 +552,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1045", @@ -630,7 +630,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdact:1051", @@ -696,7 +696,7 @@ "unspecified" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "unspecified", @@ -752,7 +752,7 @@ "other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "rdaco:1002", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json index 870d40bf75..62829a1614 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_contribution_organisation-v0.0.1.json @@ -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": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json index 8fd121d05d..d404eed460 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_document_relation-v0.0.1.json @@ -243,7 +243,8 @@ "type": "object", "additionalProperties": false, "propertiesOrder": [ - "label" + "label", + "identifiedBy" ], "required": [ "label" @@ -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" } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json index 74a305ff1a..15dc00b4de 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_electronic_locator-v0.0.1.json @@ -49,7 +49,7 @@ "noInfo" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "resource", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json index c1e218a538..eb685075c7 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_genre_form-v0.0.1.json @@ -63,7 +63,7 @@ "bf:Topic" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "bf:Topic", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json index 4a275f9522..fa7dfbc8b6 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_identified_by-v0.0.1.json @@ -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" } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json index 2938634868..51c6ebcdde 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_identifier-v0.0.1.json @@ -8,6 +8,10 @@ "value", "source" ], + "required": [ + "type", + "value" + ], "properties": { "type": { "$ref": "#/definitions/type_main" @@ -35,6 +39,10 @@ "value", "source" ], + "required": [ + "type", + "value" + ], "properties": { "type": { "$ref": "#/definitions/type_contribution" @@ -88,10 +96,7 @@ } ], "templateOptions": { - "itemCssClass": "col-lg-4" - }, - "expressionProperties": { - "templateOptions.required": "true" + "itemCssClass": "col-lg-12" } } }, @@ -124,10 +129,7 @@ } ], "templateOptions": { - "itemCssClass": "col-lg-4" - }, - "expressionProperties": { - "templateOptions.required": "true" + "itemCssClass": "col-lg-12" } } }, @@ -137,10 +139,7 @@ "minLength": 1, "form": { "templateOptions": { - "itemCssClass": "col-lg-4" - }, - "expressionProperties": { - "templateOptions.required": "true" + "itemCssClass": "col-lg-12" } } }, @@ -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')" } } } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json index c2689c73bc..30953fa196 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_intended_audience-v0.0.1.json @@ -68,7 +68,7 @@ "target_understanding_caregivers" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "target_understanding_children", @@ -230,7 +230,7 @@ "target_school_master" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "target_school_harmos1", @@ -335,7 +335,7 @@ "pegi_18" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "pegi_3", @@ -403,7 +403,7 @@ "from the age of 2" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "from the age of 18", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json index 2d475f52e8..45b606bb3d 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_provision_activity-v0.0.1.json @@ -56,7 +56,7 @@ } ], "templateOptions": { - "itemcCssClass": "col-lg-4" + "itemcCssClass": "col" } } }, @@ -94,7 +94,18 @@ } }, "country": { - "$ref": "https://bib.rero.ch/schemas/common/countries-v0.0.1.json#/country" + "allOf": [ + { + "form": { + "templateOptions": { + "itemCssClass": "col-lg-12" + } + } + }, + { + "$ref": "https://bib.rero.ch/schemas/common/countries-v0.0.1.json#/country" + } + ] }, "canton": { "$ref": "https://bib.rero.ch/schemas/common/cantons-v0.0.1.json#/canton" @@ -114,12 +125,18 @@ } }, "identifiedBy": { - "$ref": "https://bib.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" - } - }, - "form": { - "templateOptions": { - "containerCssClass": "row" + "allOf": [ + { + "form": { + "templateOptions": { + "itemCssClass": "col-lg-12" + } + } + }, + { + "$ref": "https://bib.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" + } + ] } } }, @@ -191,11 +208,6 @@ "itemCssClass": "col-lg-8" } } - }, - "form": { - "templateOptions": { - "itemCssClass": "col-lg-6" - } } }, "form": { diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json index 9b6878aa89..c43af66d20 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_scale_cartographic-v0.0.1.json @@ -23,7 +23,7 @@ "Other" ], "form": { - "Type": "selectWithSort", + "type": "selectWithSort", "options": [ { "label": "Linear scale", diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_types-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_types-v0.0.1.json index d085bd609f..d3665ca0ab 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_types-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_types-v0.0.1.json @@ -980,7 +980,6 @@ ] }, "form": { - "hide": true, "templateOptions": { "cssClass": "w-md-50" } diff --git a/rero_ils/modules/documents/jsonschemas/documents/document_work_access_point-v0.0.1.json b/rero_ils/modules/documents/jsonschemas/documents/document_work_access_point-v0.0.1.json index 85f22acbb0..ef0b31f05f 100644 --- a/rero_ils/modules/documents/jsonschemas/documents/document_work_access_point-v0.0.1.json +++ b/rero_ils/modules/documents/jsonschemas/documents/document_work_access_point-v0.0.1.json @@ -49,7 +49,8 @@ "form_subdivision", "medium_of_performance_for_music", "arranged_statement_for_music", - "key_for_music" + "key_for_music", + "identifiedBy" ], "required": [ "title" @@ -142,6 +143,9 @@ "title": "Key (music)", "type": "string", "minLength": 1 + }, + "identifiedBy": { + "$ref": "https://bib.rero.ch/schemas/documents/document_identifier-v0.0.1.json#/identifier_contribution" } } } diff --git a/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json b/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json index e1a8ab2cad..91bdd2e612 100644 --- a/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json +++ b/rero_ils/modules/documents/mappings/v7/documents/document-v0.0.1.json @@ -647,7 +647,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -713,7 +713,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } }, @@ -1102,7 +1102,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1133,7 +1133,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1164,7 +1164,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1195,7 +1195,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1226,7 +1226,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1257,7 +1257,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1288,7 +1288,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1319,7 +1319,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1350,7 +1350,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1381,7 +1381,7 @@ "type": "keyword" }, "status": { - "type": "text" + "type": "keyword" } } } @@ -1694,10 +1694,10 @@ "type": { "type": "keyword" }, - "source": { + "value": { "type": "keyword" }, - "value": { + "source": { "type": "keyword" } } diff --git a/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json b/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json index 07422b3d42..7bfb134cdf 100644 --- a/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json +++ b/rero_ils/modules/ill_requests/jsonschemas/ill_requests/ill_request-v0.0.1.json @@ -203,9 +203,6 @@ "source": { "type": "object", "title": "Source", - "required": [ - "journal_title" - ], "propertiesOrder": [ "journal_title", "volume", @@ -215,12 +212,7 @@ "journal_title": { "type": "string", "title": "Journal title", - "minLength": 3, - "form": { - "expressionProperties": { - "templateOptions.required": "false" - } - } + "minLength": 3 }, "volume": { "type": "string", diff --git a/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json b/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json index 42b45f7e69..0b04787152 100644 --- a/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json +++ b/rero_ils/modules/items/jsonschemas/items/item-v0.0.1.json @@ -67,9 +67,6 @@ "messages": { "alreadyTakenMessage": "The barcode is already taken." } - }, - "expressionProperties": { - "templateOptions.required": "false" } } }, diff --git a/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json b/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json index dd0b1cf530..a23a89e599 100644 --- a/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json +++ b/rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json @@ -269,6 +269,13 @@ "type": "string", "format": "email" } + }, + "form": { + "templateOptions": { + "wrappers": [ + "card" + ] + } } }, "order_contact": {