Skip to content

Commit

Permalink
Update associated authorities for chronology, person, and place (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejritter authored Feb 28, 2024
1 parent 2ea5506 commit 2f5fea4
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 1 deletion.
34 changes: 34 additions & 0 deletions src/plugins/extensions/associatedAuthority/fields.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export default (configContext) => {
const {
configKey: config,
} = configContext.configHelpers;

return {
assocConceptAuthGroupList: {
assocConceptAuthGroup: {
assocConcept: {
[config]: {
view: {
props: {
source: 'concept/activity,concept/associated,concept/material,concept/nomenclature,concept/occasion,concept/archculture',
},
},
},
},
},
},
assocChronologyAuthGroupList: {
assocChronologyAuthGroup: {
assocChronology: {
[config]: {
view: {
props: {
source: 'chronology/era,chronology/event,chronology/fieldcollection',
},
},
},
},
},
},
};
};
9 changes: 9 additions & 0 deletions src/plugins/extensions/associatedAuthority/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import fields from './fields';

export default () => (configContext) => ({
extensions: {
associatedAuthority: {
fields: fields(configContext),
},
},
});
5 changes: 5 additions & 0 deletions src/plugins/extensions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import associatedAuthority from './associatedAuthority';

export default [
associatedAuthority,
];
2 changes: 2 additions & 0 deletions src/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import extensions from './extensions';
import recordTypes from './recordTypes';

export default [
...extensions,
...recordTypes,
];
13 changes: 13 additions & 0 deletions src/plugins/recordTypes/chronology/fields.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default (configContext) => {
const {
extensions,
} = configContext.config;

return {
document: {
'ns2:chronologies_common': {
...extensions.associatedAuthority.fields,
},
},
};
};
4 changes: 3 additions & 1 deletion src/plugins/recordTypes/chronology/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import fields from './fields';
import vocabularies from './vocabularies';

export default () => ({
export default () => (configContext) => ({
recordTypes: {
chronology: {
fields: fields(configContext),
vocabularies,
},
},
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/recordTypes/person/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ export default (configContext) => {
configKey: config,
} = configContext.configHelpers;

const {
extensions,
} = configContext.config;

return {
document: {
'ns2:persons_common': {
...extensions.associatedAuthority.fields,
personTermGroupList: {
personTermGroup: {
termType: {
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/recordTypes/person/forms/default.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const template = (configContext) => {
Subrecord,
} = configContext.recordComponents;

const {
extensions,
} = configContext.config;

return (
<Field name="document">
<Panel name="info" collapsible>
Expand Down Expand Up @@ -201,6 +205,10 @@ const template = (configContext) => {
</Field>
</Panel>

<Panel name="authorities" collapsible collapsed>
{extensions.associatedAuthority.form}
</Panel>

<Panel name="hierarchy" collapsible collapsed>
<Field name="relation-list-item" subpath="rel:relations-common-list" />
</Panel>
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/recordTypes/place/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export default (configContext) => {
return {
document: {
...extensions.nagpra.place.fields,
'ns2:places_common': {
...extensions.associatedAuthority.fields,
},
},
};
};
4 changes: 4 additions & 0 deletions src/plugins/recordTypes/place/forms/default.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ const template = (configContext) => {
</Field>
</Panel>

<Panel name="authorities" collapsible collapsed>
{extensions.associatedAuthority.form}
</Panel>

<Panel name="hierarchy" collapsible collapsed>
<Field name="relation-list-item" subpath="rel:relations-common-list" />
</Panel>
Expand Down

0 comments on commit 2f5fea4

Please sign in to comment.