Skip to content

Commit

Permalink
DRYD-1498: Add object category fields (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejritter authored Oct 18, 2024
1 parent 13d8dac commit 3562f77
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 0 deletions.
106 changes: 106 additions & 0 deletions src/plugins/recordTypes/collectionobject/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/recordTypes/collectionobject/forms/default.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ const template = (configContext) => {
</Col>
</Row>

<Field name="objectCategoryGroupList" subpath="ns2:collectionobjects_objectcategory_extension">
<Field name="objectCategoryGroup">
<Field name="category" />
<Field name="categoryCount" />
<Field name="categoryCountUnit" />
<Field name="categoryNote" />
</Field>
</Field>

<Field name="objectNameList">
<Field name="objectNameGroup">
<Field name="objectNameControlled" />
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/recordTypes/collectionobject/forms/public.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ const template = (configContext) => {
</Field>
</Field>

<Field name="objectCategoryGroupList" subpath="ns2:collectionobjects_objectcategory_extension">
<Field name="objectCategoryGroup">
<Field name="category" />
<Field name="categoryCount" />
<Field name="categoryCountUnit" />
<Field name="categoryNote" />
</Field>
</Field>

<Field name="objectNameList">
<Field name="objectNameGroup">
<Field name="objectNameControlled" />
Expand Down

0 comments on commit 3562f77

Please sign in to comment.