Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRYD-1355: Deaccession Procedure #238

Merged
merged 10 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/plugins/recordTypes/deaccession/advancedSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default (configContext) => {
const {
OP_CONTAIN,
} = configContext.searchOperators;

const {
defaultAdvancedSearchBooleanOp,
extensions,
} = configContext.config;

return {
op: defaultAdvancedSearchBooleanOp,
value: [
{
op: OP_CONTAIN,
path: 'ns2:deaccessions_common/deaccessionNumber',
},
...extensions.core.advancedSearch,
],
};
};
48 changes: 48 additions & 0 deletions src/plugins/recordTypes/deaccession/columns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { defineMessages } from 'react-intl';

export default (configContext) => {
const {
formatRefName,
formatTimestamp,
} = configContext.formatHelpers;

return {
default: {
deaccessionNumber: {
messages: defineMessages({
label: {
id: 'column.deaccession.default.deaccessionNumber',
defaultMessage: 'Deaccession number',
},
}),
order: 10,
sortBy: 'deaccessions_common:deaccessionNumber',
width: 200,
},
deaccessionApprovalIndividual: {
formatValue: formatRefName,
messages: defineMessages({
label: {
id: 'column.deaccession.default.deaccessionApprovalIndividual',
defaultMessage: 'Individual',
},
}),
order: 20,
sortBy: 'deaccessions_common:deaccessionApprovalGroupList/0/deaccessionApprovalIndividual',
width: 450,
},
updatedAt: {
formatValue: formatTimestamp,
messages: defineMessages({
label: {
id: 'column.deaccession.default.updatedAt',
defaultMessage: 'Updated',
},
}),
order: 30,
sortBy: 'collectionspace_core:updatedAt',
width: 150,
},
},
};
};
327 changes: 327 additions & 0 deletions src/plugins/recordTypes/deaccession/fields.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
import { defineMessages } from 'react-intl';

export default (configContext) => {
const {
AutocompleteInput,
CompoundInput,
DateInput,
IDGeneratorInput,
TermPickerInput,
TextInput,
} = configContext.inputComponents;

const {
configKey: config,
} = configContext.configHelpers;

const {
DATA_TYPE_DATE,
} = configContext.dataTypes;

const {
extensions,
} = configContext.config;

const {
validateNotInUse,
} = configContext.validationHelpers;

return {
document: {
[config]: {
view: {
type: CompoundInput,
props: {
defaultChildSubpath: 'ns2:deaccessions_common',
},
},
},
...extensions.core.fields,
'ns2:deaccessions_common': {
[config]: {
service: {
ns: 'http://collectionspace.org/services/deaccession',
},
},
deaccessionNumber: {
[config]: {
cloneable: false,
messages: defineMessages({
inUse: {
id: 'field.deaccessions_common.deaccessionNumber.inUse',
defaultMessage: 'The identification number {value} is in use by another record.',
},
name: {
id: 'field.deaccessions_common.deaccessionNumber.name',
defaultMessage: 'Deaccession number',
},
}),
required: true,
searchView: {
type: TextInput,
},
validate: (validationContext) => validateNotInUse({
configContext,
validationContext,
fieldName: 'deaccessions_common:deaccessionNumber',
}),
view: {
type: IDGeneratorInput,
props: {
source: 'deaccession',
},
},
},
},
deaccessionReasons: {
[config]: {
view: {
type: CompoundInput,
},
},
deaccessionReason: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.deaccessionReason.name',
defaultMessage: 'Deaccession reason',
},
}),
repeating: true,
view: {
type: TermPickerInput,
props: {
source: 'deaccessionreason',
},
},
},
},
},
deaccessionDate: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.deaccessionDate.name',
defaultMessage: 'Deaccession date',
},
}),
dataType: DATA_TYPE_DATE,
view: {
type: DateInput,
},
},
},
deaccessionRationale: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.deaccessionRationale.name',
defaultMessage: 'Deaccession rationale',
},
}),
view: {
type: TextInput,
props: {
multiline: true,
},
},
},
},
deaccessionNote: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.deaccessionNote.name',
defaultMessage: 'Deaccession note',
},
}),
view: {
type: TextInput,
props: {
multiline: true,
},
},
},
},
deaccessionApprovalGroupList: {
[config]: {
view: {
type: CompoundInput,
},
},
deaccessionApprovalGroup: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.deaccessionApprovalGroup.name',
defaultMessage: 'Deaccession approval',
},
}),
repeating: true,
view: {
type: CompoundInput,
},
},
deaccessionApprovalGroup: {
[config]: {
messages: defineMessages({
fullName: {
id: 'field.deaccessions_common.deaccessionApprovalGroup.deaccessionApprovalGroup.fullName',
defaultMessage: 'Deaccession approval group',
},
name: {
id: 'field.deaccessions_common.deaccessionApprovalGroup.deaccessionApprovalGroup.name',
defaultMessage: 'Group',
},
}),
view: {
type: TermPickerInput,
props: {
source: 'deaccessionapprovalgroup',
},
},
},
},
deaccessionApprovalIndividual: {
[config]: {
messages: defineMessages({
fullName: {
id: 'field.deaccessions_common.deaccessionApprovalIndividual.fullName',
defaultMessage: 'Deaccession approval individual',
},
name: {
id: 'field.deaccessions_common.deaccessionApprovalIndividual.name',
defaultMessage: 'Individual',
},
}),
view: {
type: AutocompleteInput,
props: {
source: 'person/local',
},
},
},
},
deaccessionApprovalStatus: {
[config]: {
messages: defineMessages({
fullName: {
id: 'field.deaccessions_common.deaccessionApprovalStatus.fullName',
defaultMessage: 'Deaccession approval status',
},
name: {
id: 'field.deaccessions_common.deaccessionApprovalStatus.name',
defaultMessage: 'Status',
},
}),
view: {
type: TermPickerInput,
props: {
source: 'deaccessionapprovalstatus',
},
},
},
},
deaccessionApprovalDate: {
[config]: {
messages: defineMessages({
fullName: {
id: 'field.deaccessions_common.deaccessionApprovalDate.fullName',
defaultMessage: 'Deaccession approval date',
},
name: {
id: 'field.deaccessions_common.deaccessionApprovalDate.name',
defaultMessage: 'Date',
},
}),
dataType: DATA_TYPE_DATE,
view: {
type: DateInput,
},
},
},
deaccessionApprovalNote: {
[config]: {
messages: defineMessages({
fullName: {
id: 'field.deaccessions_common.deaccessionApprovalNote.fullName',
defaultMessage: 'Deaccession approval note',
},
name: {
id: 'field.deaccessions_common.deaccessionApprovalNote.name',
defaultMessage: 'Note',
},
}),
view: {
type: TextInput,
},
},
},
},
},
exitDate: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.exitDate.name',
defaultMessage: 'Exit date',
},
}),
dataType: DATA_TYPE_DATE,
view: {
type: DateInput,
},
},
},
exitRecipients: {
[config]: {
view: {
type: CompoundInput,
},
},
exitRecipient: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.exitRecipient.name',
defaultMessage: 'Exit recipient',
},
}),
repeating: true,
view: {
type: AutocompleteInput,
props: {
source: 'person/local,organization/local',
},
},
},
},
},
exitMethods: {
[config]: {
view: {
type: CompoundInput,
},
},
exitMethod: {
[config]: {
messages: defineMessages({
name: {
id: 'field.deaccessions_common.exitMethod.name',
defaultMessage: 'Exit method',
},
}),
repeating: true,
view: {
type: TermPickerInput,
props: {
source: 'disposalmethod',
},
},
},
},
},
},
},
};
};
Loading