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-1046: Added bulk object edit/grouper and some enhancements #141

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion src/components/invocable/InvocationEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getCommonFieldValue } from '../../helpers/recordDataHelpers';
import RecordFormContainer from '../../containers/record/RecordFormContainer';
import styles from '../../../styles/cspace-ui/InvocationEditor.css';
import messageStyles from '../../../styles/cspace-ui/FormStatusMessage.css';
import '../../../styles/cspace-ui/Customizations.css';

const messages = defineMessages({
loading: {
Expand Down Expand Up @@ -149,6 +150,10 @@ export default class InvocationEditor extends Component {

const invocableNameGetter = get(config, ['recordTypes', recordType, 'invocableName']);
const invocableName = invocableNameGetter && invocableNameGetter(metadata);
const invocableShortName = invocableName ? invocableName.slice(
invocableName.lastIndexOf('.') + 1,
invocableName.length,
) : '';

const paramRecordTypeConfig = get(config, ['invocables', recordType, invocableName]);

Expand Down Expand Up @@ -190,8 +195,10 @@ export default class InvocationEditor extends Component {
);
}

const invocableClassName = `cspace-ui-${recordType}--${invocableShortName}`;

return (
<div className={styles.common}>
<div className={`${styles.common} ${invocableClassName}`}>
<p>{description}</p>

<InvocationDescriptorEditor
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/invocables/batch/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import mergeAuthorityItemsStatusBatchJob from './org.collectionspace.services.batch.nuxeo.MergeAuthorityItemsBatchJob';
import mergeAuthorityItemsBatchJob from './org.collectionspace.services.batch.nuxeo.MergeAuthorityItemsBatchJob';
import updateInventoryStatusBatchJob from './org.collectionspace.services.batch.nuxeo.UpdateInventoryStatusBatchJob';
import grouperBatchJob from './org.collectionspace.services.batch.nuxeo.GrouperBatchJob';
import bulkObjectEditBatchJob from './org.collectionspace.services.batch.nuxeo.BulkObjectEditBatchJob';

export default [
mergeAuthorityItemsStatusBatchJob,
mergeAuthorityItemsBatchJob,
updateInventoryStatusBatchJob,
grouperBatchJob,
bulkObjectEditBatchJob,
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
import { defineMessages } from 'react-intl';

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

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


return {
params: {
[config]: {
view: {
type: CompoundInput,
},
},
// core
numberOfObjects: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.numberOfObjects.name',
defaultMessage: 'Number of objects',
},
}),
view: {
type: TextInput,
},
},
},
// core
numberValue: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.numberValue.name',
defaultMessage: 'Other number',
},
}),
view: {
type: TextInput,
},
},
},
numberType: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.numberType.name',
defaultMessage: 'Other number type',
},
}),
view: {
type: OptionPickerInput,
props: {
source: 'numberTypes',
},
},
},
},
// core
objectStatus: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.objectStatus.name',
defaultMessage: 'Object status',
},
}),
view: {
type: OptionPickerInput,
props: {
source: 'objectStatuses',
},
},
},
},
// core
material: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.material.name',
defaultMessage: 'Material',
},
}),
view: {
type: TextInput,
},
},
},
// core
briefDescription: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.briefDescription.name',
defaultMessage: 'Brief description',
},
}),
view: {
type: TextInput,
props: {
multiline: true,
},
},
},
},
// core
objectName: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.objectName.name',
defaultMessage: 'Object name',
},
}),
view: {
type: TextInput,
},
},
},
// core
responsibleDepartment: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.responsibleDepartment.name',
defaultMessage: 'Responsible department',
},
}),
view: {
type: OptionPickerInput,
props: {
source: 'departments',
},
},
},
},
// core
fieldCollectionPlace: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.fieldCollectionPlace.name',
defaultMessage: 'Field collection place',
},
}),
view: {
type: AutocompleteInput,
props: {
source: 'place/local,place/shared,place/tgn',
},
},
},
},
// core
fieldCollector: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.fieldCollector.name',
defaultMessage: 'Field collector',
},
}),
view: {
type: AutocompleteInput,
props: {
source: 'person/local,person/shared,organization/local,organization/shared',
},
},
},
},
// core
objectProductionPlace: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.objectProductionPlace.name',
defaultMessage: 'Production Place',
},
}),
view: {
type: TextInput,
},
},
},
// core
objectProductionPerson: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.objectProductionPerson.name',
defaultMessage: 'Production Person',
},
}),
view: {
type: AutocompleteInput,
props: {
source: 'person/local,person/shared',
},
},
},
},
contentPlace: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.contentPlace.name',
defaultMessage: 'Content place',
},
}),
view: {
type: TextInput,
},
},
},
// core
assocPeople: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.assocPeople.name',
defaultMessage: 'Associated people',
},
}),
view: {
type: TextInput,
},
},
},
// naturalhistory
taxon: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.taxon.name',
defaultMessage: 'Taxon',
},
}),
view: {
type: AutocompleteInput,
props: {
source: 'taxon/local',
},
},
},
},
publishTo: {
[config]: {
messages: defineMessages({
name: {
id: 'field.BulkObjectEditBatchJob.publishTo.name',
defaultMessage: 'Publish to',
},
}),
view: {
type: TermPickerInput,
props: {
source: 'publishto',
},
},
},
},
},
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { defineMessages } from 'react-intl';

const template = (configContext) => {
const {
React,
} = configContext.lib;

const {
Field,
} = configContext.recordComponents;

const {
Col,
Cols,
} = configContext.layoutComponents;

return (
<Field name="params">
<Cols>
<Col>
<Field name="numberOfObjects" />
<Field name="fieldCollector" />
<Field name="fieldCollectionPlace" />
<Field name="objectProductionPerson" />
<Field name="responsibleDepartment" />
</Col>

<Col>
<Field name="numberValue" />
<Field name="assocPeople" />
<Field name="contentPlace" />
<Field name="objectProductionPlace" />
<Field name="publishTo" />
</Col>

<Col>
<Field name="numberType" />
<Field name="material" />
<Field name="objectStatus" />
<Field name="objectName" />
</Col>
</Cols>

<Field name="briefDescription" />
</Field>
);
};

export default (configContext) => ({
messages: defineMessages({
name: {
id: 'form.report.Bulk Object Edit Batch Job.default.name',
defaultMessage: 'Standard Template',
},
}),
sortOrder: 0,
template: template(configContext),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import defaultForm from './default';

export default (configContext) => ({
default: defaultForm(configContext),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import fields from './fields';
import forms from './forms';

export default () => (configContext) => ({
invocables: {
batch: {
'org.collectionspace.services.batch.nuxeo.BulkObjectEditBatchJob': {
fields: fields(configContext),
forms: forms(configContext),
},
},
},
});
Loading