diff --git a/src/plugins/recordTypes/dutyofcare/advancedSearch.js b/src/plugins/recordTypes/dutyofcare/advancedSearch.js index 77dace22..930f5c3c 100644 --- a/src/plugins/recordTypes/dutyofcare/advancedSearch.js +++ b/src/plugins/recordTypes/dutyofcare/advancedSearch.js @@ -13,7 +13,7 @@ export default (configContext) => { value: [ { op: OP_CONTAIN, - path: 'ns2:dutyofcares_common/dutyOfCareNumber', + path: 'ns2:dutiesofcare_common/dutyOfCareNumber', }, ...extensions.core.advancedSearch, ], diff --git a/src/plugins/recordTypes/dutyofcare/columns.js b/src/plugins/recordTypes/dutyofcare/columns.js index 3b41edd3..394ea237 100644 --- a/src/plugins/recordTypes/dutyofcare/columns.js +++ b/src/plugins/recordTypes/dutyofcare/columns.js @@ -15,18 +15,18 @@ export default (configContext) => { }, }), order: 10, - sortBy: 'dutyofcares_common:dutyOfCareNumber', + sortBy: 'dutiesofcare_common:dutyOfCareNumber', width: 200, }, - title: { + dutyOfCareTitle: { messages: defineMessages({ label: { - id: 'column.dutyofcare.default.title', + id: 'column.dutyofcare.default.dutyOfCareTitle', defaultMessage: 'Title', }, }), order: 20, - sortBy: 'dutyofcares_common:title', + sortBy: 'dutiesofcare_common:dutyOfCareTitle', width: 200, }, updatedAt: { diff --git a/src/plugins/recordTypes/dutyofcare/fields.js b/src/plugins/recordTypes/dutyofcare/fields.js index ed1e44ee..01029a36 100644 --- a/src/plugins/recordTypes/dutyofcare/fields.js +++ b/src/plugins/recordTypes/dutyofcare/fields.js @@ -32,12 +32,12 @@ export default (configContext) => { view: { type: CompoundInput, props: { - defaultChildSubpath: 'ns2:dutyofcares_common', + defaultChildSubpath: 'ns2:dutiesofcare_common', }, }, }, ...extensions.core.fields, - 'ns2:dutyofcares_common': { + 'ns2:dutiesofcare_common': { [config]: { service: { ns: 'http://collectionspace.org/services/dutyofcare', @@ -48,11 +48,11 @@ export default (configContext) => { cloneable: false, messages: defineMessages({ inUse: { - id: 'field.dutyofcares_common.dutyOfCareNumber.inUse', + id: 'field.dutiesofcare_common.dutyOfCareNumber.inUse', defaultMessage: 'The identification number {value} is in use by another record.', }, name: { - id: 'field.dutyofcares_common.dutyOfCareNumber.name', + id: 'field.dutiesofcare_common.dutyOfCareNumber.name', defaultMessage: 'Duty of care number', }, }), @@ -63,7 +63,7 @@ export default (configContext) => { validate: (validationContext) => validateNotInUse({ configContext, validationContext, - fieldName: 'dutyofcares_common:dutyOfCareNumber', + fieldName: 'dutiesofcare_common:dutyOfCareNumber', }), view: { type: IDGeneratorInput, @@ -78,7 +78,7 @@ export default (configContext) => { dataType: DATA_TYPE_DATE, messages: defineMessages({ name: { - id: 'field.dutyofcares_common.originationDate.name', + id: 'field.dutiesofcare_common.originationDate.name', defaultMessage: 'Origination date', }, }), @@ -87,11 +87,11 @@ export default (configContext) => { }, }, }, - title: { + dutyOfCareTitle: { [config]: { messages: defineMessages({ name: { - id: 'field.dutyofcares_common.title.name', + id: 'field.dutiesofcare_common.dutyOfCareTitle.name', defaultMessage: 'Title', }, }), @@ -110,7 +110,7 @@ export default (configContext) => { [config]: { messages: defineMessages({ name: { - id: 'field.dutyofcares_common.note.name', + id: 'field.dutiesofcare_common.note.name', defaultMessage: 'Note', }, }), @@ -134,7 +134,7 @@ export default (configContext) => { [config]: { messages: defineMessages({ name: { - id: 'field.dutyofcares_common.detailGroup.name', + id: 'field.dutiesofcare_common.detailGroup.name', defaultMessage: 'Duty of care detail', }, }), @@ -147,11 +147,11 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.detailType.fullName', + id: 'field.dutiesofcare_common.detailType.fullName', defaultMessage: 'Duty of care detail type', }, name: { - id: 'field.dutyofcares_common.detailType.name', + id: 'field.dutiesofcare_common.detailType.name', defaultMessage: 'Type', }, }), @@ -167,11 +167,11 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.detailLevel.fullName', + id: 'field.dutiesofcare_common.detailLevel.fullName', defaultMessage: 'Duty of care detail level', }, name: { - id: 'field.dutyofcares_common.detailLevel.name', + id: 'field.dutiesofcare_common.detailLevel.name', defaultMessage: 'Level', }, }), @@ -187,18 +187,18 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.detailDeterminedBy.fullName', + id: 'field.dutiesofcare_common.detailDeterminedBy.fullName', defaultMessage: 'Duty of care detail determined by', }, name: { - id: 'field.dutyofcares_common.detailDeterminedBy.name', + id: 'field.dutiesofcare_common.detailDeterminedBy.name', defaultMessage: 'Determined by', }, }), view: { type: AutocompleteInput, props: { - source: 'person/local,person/ulan,organization/local,organization/ulan', + source: 'person/local,organization/local', }, }, }, @@ -208,11 +208,11 @@ export default (configContext) => { dataType: DATA_TYPE_DATE, messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.detailDeterminationDate.fullName', + id: 'field.dutiesofcare_common.detailDeterminationDate.fullName', defaultMessage: 'Duty of care detail determination date', }, name: { - id: 'field.dutyofcares_common.detailDeterminationDate.name', + id: 'field.dutiesofcare_common.detailDeterminationDate.name', defaultMessage: 'Determination date', }, }), @@ -225,11 +225,11 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.detailNote.fullName', + id: 'field.dutiesofcare_common.detailNote.fullName', defaultMessage: 'Duty of care detail note', }, name: { - id: 'field.dutyofcares_common.detailNote.name', + id: 'field.dutiesofcare_common.detailNote.name', defaultMessage: 'Note', }, }), @@ -253,7 +253,7 @@ export default (configContext) => { [config]: { messages: defineMessages({ name: { - id: 'field.dutyofcares_common.partiesInvolvedGroup.name', + id: 'field.dutiesofcare_common.partiesInvolvedGroup.name', defaultMessage: 'Party involved', }, }), @@ -269,18 +269,18 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.involvedParty.fullName', - defaultMessage: 'Party involved name', + id: 'field.dutiesofcare_common.involvedParty.fullName', + defaultMessage: 'Party involved person', }, name: { - id: 'field.dutyofcares_common.involvedParty.name', - defaultMessage: 'Name', + id: 'field.dutiesofcare_common.involvedParty.name', + defaultMessage: 'Person', }, }), view: { type: AutocompleteInput, props: { - source: 'person/local,person/ulan', + source: 'person/local', }, }, }, @@ -289,18 +289,18 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.involvedOnBehalfOf.fullName', + id: 'field.dutiesofcare_common.involvedOnBehalfOf.fullName', defaultMessage: 'Party involved on behalf of', }, name: { - id: 'field.dutyofcares_common.involvedOnBehalfOf.name', + id: 'field.dutiesofcare_common.involvedOnBehalfOf.name', defaultMessage: 'On behalf of', }, }), view: { type: AutocompleteInput, props: { - source: 'organization/local,organization/ulan', + source: 'organization/local', }, }, }, @@ -309,11 +309,11 @@ export default (configContext) => { [config]: { messages: defineMessages({ fullName: { - id: 'field.dutyofcares_common.involvedRole.fullName', + id: 'field.dutiesofcare_common.involvedRole.fullName', defaultMessage: 'Party involved roles', }, name: { - id: 'field.dutyofcares_common.involvedRole.name', + id: 'field.dutiesofcare_common.involvedRole.name', defaultMessage: 'Role', }, }), diff --git a/src/plugins/recordTypes/dutyofcare/forms/default.jsx b/src/plugins/recordTypes/dutyofcare/forms/default.jsx index f41cf2c3..5b756e8c 100644 --- a/src/plugins/recordTypes/dutyofcare/forms/default.jsx +++ b/src/plugins/recordTypes/dutyofcare/forms/default.jsx @@ -22,7 +22,7 @@ const template = (configContext) => { - + diff --git a/src/plugins/recordTypes/dutyofcare/messages.js b/src/plugins/recordTypes/dutyofcare/messages.js index 415e1efc..86edb556 100644 --- a/src/plugins/recordTypes/dutyofcare/messages.js +++ b/src/plugins/recordTypes/dutyofcare/messages.js @@ -10,7 +10,7 @@ export default { collectionName: { id: 'record.dutyofcare.collectionName', description: 'The name of a collection of records of the type.', - defaultMessage: 'Duty of Cares', + defaultMessage: 'Duties of Care', }, }), panel: defineMessages({ diff --git a/src/plugins/recordTypes/dutyofcare/serviceConfig.js b/src/plugins/recordTypes/dutyofcare/serviceConfig.js index c7a2bcc8..109b0a86 100644 --- a/src/plugins/recordTypes/dutyofcare/serviceConfig.js +++ b/src/plugins/recordTypes/dutyofcare/serviceConfig.js @@ -1,6 +1,6 @@ export default { serviceName: 'Dutyofcare', - servicePath: 'dutyofcares', + servicePath: 'dutiesofcare', serviceType: 'procedure', objectName: 'Dutyofcare', diff --git a/src/plugins/recordTypes/dutyofcare/title.js b/src/plugins/recordTypes/dutyofcare/title.js index db131636..010599cb 100644 --- a/src/plugins/recordTypes/dutyofcare/title.js +++ b/src/plugins/recordTypes/dutyofcare/title.js @@ -7,14 +7,14 @@ export default (configContext) => (data) => { return ''; } - const common = getPart(data, 'dutyofcares_common'); + const common = getPart(data, 'dutiesofcare_common'); if (!common) { return ''; } const referenceNumber = common.get('dutyOfCareNumber'); - const title = common.get('title'); + const dutyOfCareTitle = common.get('dutyOfCareTitle'); - return [referenceNumber, title].filter((part) => !!part).join(' – '); + return [referenceNumber, dutyOfCareTitle].filter((part) => !!part).join(' – '); }; diff --git a/test/specs/plugins/recordTypes/dutyofcare/title.spec.js b/test/specs/plugins/recordTypes/dutyofcare/title.spec.js index 6141ecb2..8b81b52e 100644 --- a/test/specs/plugins/recordTypes/dutyofcare/title.spec.js +++ b/test/specs/plugins/recordTypes/dutyofcare/title.spec.js @@ -8,12 +8,12 @@ describe('dutyofcare record title', () => { const configContext = createConfigContext(); const title = createTitleGetter(configContext); - it('should return the dutyofcare number and title when both are present', () => { + it('should return the dutyofcare number and dutyOfCareTitle when both are present', () => { const data = Immutable.fromJS({ document: { - 'ns2:dutyofcares_common': { + 'ns2:dutiesofcare_common': { dutyOfCareNumber: 'DC', - title: 'Title', + dutyOfCareTitle: 'Title', }, }, }); @@ -21,10 +21,10 @@ describe('dutyofcare record title', () => { title(data).should.equal('DC – Title'); }); - it('should return the dutyofcare number only when the title is missing', () => { + it('should return the dutyofcare number only when the dutyOfCareTitle is missing', () => { const data = Immutable.fromJS({ document: { - 'ns2:dutyofcares_common': { + 'ns2:dutiesofcare_common': { dutyOfCareNumber: 'DC', }, }, @@ -33,11 +33,11 @@ describe('dutyofcare record title', () => { title(data).should.equal('DC'); }); - it('should return the title only when the dutyofcare number is missing', () => { + it('should return the dutyOfCareTitle only when the dutyofcare number is missing', () => { const data = Immutable.fromJS({ document: { - 'ns2:dutyofcares_common': { - title: 'Title', + 'ns2:dutiesofcare_common': { + dutyOfCareTitle: 'Title', }, }, }); @@ -53,8 +53,8 @@ describe('dutyofcare record title', () => { it('should return an empty string if the common part is not present', () => { const data = Immutable.fromJS({ document: { - 'ns2:dutyofcares_extension': { - dutyofcareAltTitle: 'Alt dutyofcare title', + 'ns2:dutiesofcare_extension': { + dutyofcareAltTitle: 'Alt dutyofcare dutyOfCareTitle', }, }, });