From 3562f77ff9d3c40e26a1e64356564910b6c4344b Mon Sep 17 00:00:00 2001 From: Michael Ritter Date: Fri, 18 Oct 2024 13:49:32 -0600 Subject: [PATCH] DRYD-1498: Add object category fields (#22) --- .../recordTypes/collectionobject/fields.js | 106 ++++++++++++++++++ .../collectionobject/forms/default.jsx | 9 ++ .../collectionobject/forms/public.jsx | 9 ++ 3 files changed, 124 insertions(+) diff --git a/src/plugins/recordTypes/collectionobject/fields.js b/src/plugins/recordTypes/collectionobject/fields.js index 945ead8..7bc3738 100644 --- a/src/plugins/recordTypes/collectionobject/fields.js +++ b/src/plugins/recordTypes/collectionobject/fields.js @@ -737,6 +737,112 @@ export default (configContext) => { // collectionobjects_naturalhistory_extension and collectionobjects_anthro. ...extensions.locality.fields, }, + 'ns2:collectionobjects_objectcategory_extension': { + [config]: { + service: { + ns: 'http://collectionspace.org/services/collectionobject/domain/objectcategory_extension', + }, + }, + objectCategoryGroupList: { + [config]: { + view: { + type: CompoundInput, + }, + }, + objectCategoryGroup: { + [config]: { + messages: defineMessages({ + name: { + id: 'field.collectionobjects_objectcategory_extension.objectCategoryGroup.name', + defaultMessage: 'Object category', + }, + }), + repeating: true, + view: { + type: CompoundInput, + props: { + tabular: true, + }, + }, + }, + category: { + [config]: { + messages: defineMessages({ + fullName: { + id: 'field.collectionobjects_objectcategory_extension.category.fullName', + defaultMessage: 'Object category', + }, + name: { + id: 'field.collectionobjects_objectcategory_extension.category.name', + defaultMessage: 'Category', + }, + }), + view: { + type: TermPickerInput, + props: { + source: 'objectcategory', + }, + }, + }, + }, + categoryCount: { + [config]: { + dataType: DATA_TYPE_INT, + messages: defineMessages({ + fullName: { + id: 'field.collectionobjects_objectcategory_extension.categoryCount.fullName', + defaultMessage: 'Object category count', + }, + name: { + id: 'field.collectionobjects_objectcategory_extension.categoryCount.name', + defaultMessage: 'Count', + }, + }), + view: { + type: TextInput, + }, + }, + }, + categoryCountUnit: { + [config]: { + messages: defineMessages({ + fullName: { + id: 'field.collectionobjects_objectcategory_extension.categoryCountUnit.fullName', + defaultMessage: 'Object category unit', + }, + name: { + id: 'field.collectionobjects_objectcategory_extension.categoryCountUnit.name', + defaultMessage: 'Unit', + }, + }), + view: { + type: TermPickerInput, + props: { + source: 'objectcountunit', + }, + }, + }, + }, + categoryNote: { + [config]: { + messages: defineMessages({ + fullName: { + id: 'field.collectionobjects_objectcategory_extension.categoryNote.fullName', + defaultMessage: 'Object category note', + }, + name: { + id: 'field.collectionobjects_objectcategory_extension.categoryNote.name', + defaultMessage: 'Note', + }, + }), + view: { + type: TextInput, + }, + }, + }, + }, + }, + }, ...extensions.culturalcare.collectionobject.fields, ...extensions.nagpra.collectionobject.fields, ...extensions.naturalhistory.collectionobject.fields, diff --git a/src/plugins/recordTypes/collectionobject/forms/default.jsx b/src/plugins/recordTypes/collectionobject/forms/default.jsx index 1b8785b..de45e68 100644 --- a/src/plugins/recordTypes/collectionobject/forms/default.jsx +++ b/src/plugins/recordTypes/collectionobject/forms/default.jsx @@ -76,6 +76,15 @@ const template = (configContext) => { + + + + + + + + + diff --git a/src/plugins/recordTypes/collectionobject/forms/public.jsx b/src/plugins/recordTypes/collectionobject/forms/public.jsx index 37b554f..89726ae 100644 --- a/src/plugins/recordTypes/collectionobject/forms/public.jsx +++ b/src/plugins/recordTypes/collectionobject/forms/public.jsx @@ -60,6 +60,15 @@ const template = (configContext) => { + + + + + + + + +