Skip to content

Commit 8af86be

Browse files
author
cesarvh
committed
NOJIRA: Added bulk object edit/grouper and some enhancements
1 parent 2b83668 commit 8af86be

File tree

16 files changed

+523
-7
lines changed

16 files changed

+523
-7
lines changed

src/components/invocable/InvocationEditor.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getCommonFieldValue } from '../../helpers/recordDataHelpers';
99
import RecordFormContainer from '../../containers/record/RecordFormContainer';
1010
import styles from '../../../styles/cspace-ui/InvocationEditor.css';
1111
import messageStyles from '../../../styles/cspace-ui/FormStatusMessage.css';
12+
import '../../../styles/cspace-ui/Customizations.css';
1213

1314
const messages = defineMessages({
1415
loading: {
@@ -149,6 +150,10 @@ export default class InvocationEditor extends Component {
149150

150151
const invocableNameGetter = get(config, ['recordTypes', recordType, 'invocableName']);
151152
const invocableName = invocableNameGetter && invocableNameGetter(metadata);
153+
const invocableShortName = invocableName ? invocableName.slice(
154+
invocableName.lastIndexOf('.') + 1,
155+
invocableName.length,
156+
) : '';
152157

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

@@ -190,8 +195,10 @@ export default class InvocationEditor extends Component {
190195
);
191196
}
192197

198+
const invocableClassName = `cspace-ui-${recordType}--${invocableShortName}`;
199+
193200
return (
194-
<div className={styles.common}>
201+
<div className={`${styles.common} ${invocableClassName}`}>
195202
<p>{description}</p>
196203

197204
<InvocationDescriptorEditor

src/plugins/invocables/batch/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import mergeAuthorityItemsStatusBatchJob from './org.collectionspace.services.batch.nuxeo.MergeAuthorityItemsBatchJob';
1+
import mergeAuthorityItemsBatchJob from './org.collectionspace.services.batch.nuxeo.MergeAuthorityItemsBatchJob';
22
import updateInventoryStatusBatchJob from './org.collectionspace.services.batch.nuxeo.UpdateInventoryStatusBatchJob';
3+
import grouperBatchJob from './org.collectionspace.services.batch.nuxeo.GrouperBatchJob';
4+
import bulkObjectEditBatchJob from './org.collectionspace.services.batch.nuxeo.BulkObjectEditBatchJob';
35

46
export default [
5-
mergeAuthorityItemsStatusBatchJob,
7+
mergeAuthorityItemsBatchJob,
68
updateInventoryStatusBatchJob,
9+
grouperBatchJob,
10+
bulkObjectEditBatchJob,
711
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
import { defineMessages } from 'react-intl';
2+
3+
export default (configContext) => {
4+
const {
5+
CompoundInput,
6+
AutocompleteInput,
7+
TextInput,
8+
OptionPickerInput,
9+
} = configContext.inputComponents;
10+
11+
const {
12+
configKey: config,
13+
} = configContext.configHelpers;
14+
15+
16+
return {
17+
params: {
18+
[config]: {
19+
view: {
20+
type: CompoundInput,
21+
},
22+
},
23+
// core
24+
numberOfObjects: {
25+
[config]: {
26+
messages: defineMessages({
27+
name: {
28+
id: 'field.BulkObjectEditBatchJob.numberOfObjects.name',
29+
defaultMessage: 'Number of objects',
30+
},
31+
}),
32+
view: {
33+
type: TextInput,
34+
},
35+
},
36+
},
37+
// core
38+
numberValue: {
39+
[config]: {
40+
messages: defineMessages({
41+
name: {
42+
id: 'field.BulkObjectEditBatchJob.numberValue.name',
43+
defaultMessage: 'Other number',
44+
},
45+
}),
46+
view: {
47+
type: TextInput,
48+
},
49+
},
50+
},
51+
numberType: {
52+
[config]: {
53+
messages: defineMessages({
54+
name: {
55+
id: 'field.BulkObjectEditBatchJob.numberType.name',
56+
defaultMessage: 'Other number type',
57+
},
58+
}),
59+
view: {
60+
type: OptionPickerInput,
61+
props: {
62+
source: 'numberTypes',
63+
},
64+
},
65+
},
66+
},
67+
// core
68+
objectStatus: {
69+
[config]: {
70+
messages: defineMessages({
71+
name: {
72+
id: 'field.BulkObjectEditBatchJob.objectStatus.name',
73+
defaultMessage: 'Object status',
74+
},
75+
}),
76+
view: {
77+
type: OptionPickerInput,
78+
props: {
79+
source: 'objectStatuses',
80+
},
81+
},
82+
},
83+
},
84+
// core
85+
material: {
86+
[config]: {
87+
messages: defineMessages({
88+
name: {
89+
id: 'field.BulkObjectEditBatchJob.material.name',
90+
defaultMessage: 'Material',
91+
},
92+
}),
93+
view: {
94+
type: TextInput,
95+
},
96+
},
97+
},
98+
// core
99+
briefDescription: {
100+
[config]: {
101+
messages: defineMessages({
102+
name: {
103+
id: 'field.BulkObjectEditBatchJob.briefDescription.name',
104+
defaultMessage: 'Brief description',
105+
},
106+
}),
107+
view: {
108+
type: TextInput,
109+
props: {
110+
multiline: true,
111+
},
112+
},
113+
},
114+
},
115+
// core
116+
objectName: {
117+
[config]: {
118+
messages: defineMessages({
119+
name: {
120+
id: 'field.BulkObjectEditBatchJob.objectName.name',
121+
defaultMessage: 'Object name',
122+
},
123+
}),
124+
view: {
125+
type: TextInput,
126+
},
127+
},
128+
},
129+
// core
130+
responsibleDepartment: {
131+
[config]: {
132+
messages: defineMessages({
133+
name: {
134+
id: 'field.BulkObjectEditBatchJob.responsibleDepartment.name',
135+
defaultMessage: 'Responsible department',
136+
},
137+
}),
138+
view: {
139+
type: OptionPickerInput,
140+
props: {
141+
source: 'departments',
142+
},
143+
},
144+
},
145+
},
146+
// core
147+
fieldCollectionPlace: {
148+
[config]: {
149+
messages: defineMessages({
150+
name: {
151+
id: 'field.BulkObjectEditBatchJob.fieldCollectionPlace.name',
152+
defaultMessage: 'Field collection place',
153+
},
154+
}),
155+
view: {
156+
type: AutocompleteInput,
157+
props: {
158+
source: 'place/local,place/shared,place/tgn',
159+
},
160+
},
161+
},
162+
},
163+
// core
164+
fieldCollector: {
165+
[config]: {
166+
messages: defineMessages({
167+
name: {
168+
id: 'field.BulkObjectEditBatchJob.fieldCollector.name',
169+
defaultMessage: 'Field collector',
170+
},
171+
}),
172+
view: {
173+
type: AutocompleteInput,
174+
props: {
175+
source: 'person/local,person/shared,organization/local,organization/shared',
176+
},
177+
},
178+
},
179+
},
180+
// core
181+
objectProductionPlace: {
182+
[config]: {
183+
messages: defineMessages({
184+
name: {
185+
id: 'field.BulkObjectEditBatchJob.objectProductionPlace.name',
186+
defaultMessage: 'Production Place',
187+
},
188+
}),
189+
view: {
190+
type: TextInput,
191+
},
192+
},
193+
},
194+
// core
195+
objectProductionPerson: {
196+
[config]: {
197+
messages: defineMessages({
198+
name: {
199+
id: 'field.BulkObjectEditBatchJob.objectProductionPerson.name',
200+
defaultMessage: 'Production Person',
201+
},
202+
}),
203+
view: {
204+
type: AutocompleteInput,
205+
props: {
206+
source: 'person/local,person/shared',
207+
},
208+
},
209+
},
210+
},
211+
contentPlace: {
212+
[config]: {
213+
messages: defineMessages({
214+
name: {
215+
id: 'field.BulkObjectEditBatchJob.contentPlace.name',
216+
defaultMessage: 'Content place',
217+
},
218+
}),
219+
view: {
220+
type: TextInput,
221+
},
222+
},
223+
},
224+
// core
225+
assocPeople: {
226+
[config]: {
227+
messages: defineMessages({
228+
name: {
229+
id: 'field.BulkObjectEditBatchJob.assocPeople.name',
230+
defaultMessage: 'Associated people',
231+
},
232+
}),
233+
view: {
234+
type: TextInput,
235+
},
236+
},
237+
},
238+
// naturalhistory
239+
taxon: {
240+
[config]: {
241+
messages: defineMessages({
242+
name: {
243+
id: 'field.BulkObjectEditBatchJob.taxon.name',
244+
defaultMessage: 'Taxon',
245+
},
246+
}),
247+
view: {
248+
type: AutocompleteInput,
249+
props: {
250+
source: 'taxon/local',
251+
},
252+
},
253+
},
254+
},
255+
},
256+
};
257+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { defineMessages } from 'react-intl';
2+
3+
const template = (configContext) => {
4+
const {
5+
React,
6+
} = configContext.lib;
7+
8+
const {
9+
Field,
10+
} = configContext.recordComponents;
11+
12+
const {
13+
Col,
14+
Cols,
15+
} = configContext.layoutComponents;
16+
17+
return (
18+
<Field name="params">
19+
<Cols>
20+
<Col>
21+
<Field name="numberOfObjects" />
22+
<Field name="fieldCollector" />
23+
<Field name="fieldCollectionPlace" />
24+
<Field name="objectProductionPerson" />
25+
<Field name="responsibleDepartment" />
26+
</Col>
27+
28+
<Col>
29+
<Field name="numberValue" />
30+
<Field name="assocPeople" />
31+
<Field name="contentPlace" />
32+
<Field name="objectProductionPlace" />
33+
</Col>
34+
35+
<Col>
36+
<Field name="numberType" />
37+
<Field name="material" />
38+
<Field name="objectStatus" />
39+
<Field name="objectName" />
40+
</Col>
41+
</Cols>
42+
<Field name="briefDescription" />
43+
</Field>
44+
);
45+
};
46+
47+
export default (configContext) => ({
48+
messages: defineMessages({
49+
name: {
50+
id: 'form.report.Bulk Object Edit Batch Job.default.name',
51+
defaultMessage: 'Standard Template',
52+
},
53+
}),
54+
sortOrder: 0,
55+
template: template(configContext),
56+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import defaultForm from './default';
2+
3+
export default (configContext) => ({
4+
default: defaultForm(configContext),
5+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import fields from './fields';
2+
import forms from './forms';
3+
4+
export default () => (configContext) => ({
5+
invocables: {
6+
batch: {
7+
'org.collectionspace.services.batch.nuxeo.BulkObjectEditBatchJob': {
8+
fields: fields(configContext),
9+
forms: forms(configContext),
10+
},
11+
},
12+
},
13+
});

0 commit comments

Comments
 (0)