@eeacms/volto-eea-website-policy 1.12.1 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [1.
|
|
7
|
+
### [1.13.1](https://github.com/eea/volto-eea-website-policy/compare/1.13.0...1.13.1) - 28 March 2024
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: make sure that the content type is sent in workflow change - refs #267108 [dobri1408 - [`934352d`](https://github.com/eea/volto-eea-website-policy/commit/934352dc16248a7f6a13499ed99910ca5f67d577)]
|
|
12
|
+
|
|
13
|
+
### [1.13.0](https://github.com/eea/volto-eea-website-policy/compare/1.13.0-beta.1...1.13.0) - 19 February 2024
|
|
14
|
+
|
|
15
|
+
#### :rocket: New Features
|
|
16
|
+
|
|
17
|
+
- feat: inforce required fields on workflow change - refs #262289 [dobri1408 - [`b6f939d`](https://github.com/eea/volto-eea-website-policy/commit/b6f939d4274b87607ef69adabb3c49b2b5c03354)]
|
|
10
18
|
|
|
11
19
|
#### :hammer_and_wrench: Others
|
|
12
20
|
|
|
13
|
-
-
|
|
21
|
+
- Release 1.13.0 [alin - [`baea684`](https://github.com/eea/volto-eea-website-policy/commit/baea684dc2bb8968ddb6125c4d66bd4cb95c74c8)]
|
|
22
|
+
### [1.13.0-beta.1](https://github.com/eea/volto-eea-website-policy/compare/1.12.1...1.13.0-beta.1) - 17 January 2024
|
|
23
|
+
|
|
24
|
+
### [1.12.1](https://github.com/eea/volto-eea-website-policy/compare/1.12.0...1.12.1) - 18 January 2024
|
|
25
|
+
|
|
14
26
|
### [1.12.0](https://github.com/eea/volto-eea-website-policy/compare/1.12.0-beta.4...1.12.0) - 17 January 2024
|
|
15
27
|
|
|
16
28
|
### [1.12.0-beta.4](https://github.com/eea/volto-eea-website-policy/compare/1.12.0-beta.2...1.12.0-beta.4) - 12 January 2024
|
package/package.json
CHANGED
|
@@ -35,6 +35,10 @@ const messages = defineMessages({
|
|
|
35
35
|
id: 'Workflow updated.',
|
|
36
36
|
defaultMessage: 'Workflow updated.',
|
|
37
37
|
},
|
|
38
|
+
notAllowedToUpdateWorkflow: {
|
|
39
|
+
id: 'notAllowedToUpdateWorkflow',
|
|
40
|
+
defaultMessage: 'Please fill out all the required fields',
|
|
41
|
+
},
|
|
38
42
|
messageNoWorkflow: {
|
|
39
43
|
id: 'No workflow',
|
|
40
44
|
defaultMessage: 'No workflow',
|
|
@@ -45,6 +49,21 @@ const messages = defineMessages({
|
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
51
|
|
|
52
|
+
const filter_remaining_steps = (values, key) => {
|
|
53
|
+
return values.filter((value) => {
|
|
54
|
+
const is_not_ready = !value.is_ready;
|
|
55
|
+
if (!is_not_ready) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const states = value.states;
|
|
59
|
+
const required_for_all = states?.indexOf('all') !== -1;
|
|
60
|
+
return (
|
|
61
|
+
(is_not_ready && required_for_all) ||
|
|
62
|
+
(is_not_ready && states?.indexOf(key) !== -1)
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
48
67
|
const SingleValue = injectLazyLibs('reactSelect')(({ children, ...props }) => {
|
|
49
68
|
const stateDecorator = {
|
|
50
69
|
marginRight: '10px',
|
|
@@ -184,6 +203,7 @@ class Workflow extends Component {
|
|
|
184
203
|
workflowLoaded: PropTypes.func,
|
|
185
204
|
loaded: PropTypes.bool.isRequired,
|
|
186
205
|
pathname: PropTypes.string.isRequired,
|
|
206
|
+
|
|
187
207
|
contentHistory: PropTypes.arrayOf(
|
|
188
208
|
PropTypes.shape({
|
|
189
209
|
review_state: PropTypes.string,
|
|
@@ -245,15 +265,32 @@ class Workflow extends Component {
|
|
|
245
265
|
* @returns {undefined}
|
|
246
266
|
*/
|
|
247
267
|
transition = (selectedOption) => {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
if (
|
|
269
|
+
filter_remaining_steps(
|
|
270
|
+
this.props.editingProgressSteps,
|
|
271
|
+
this.props?.content?.review_state || '',
|
|
272
|
+
).length === 0
|
|
273
|
+
) {
|
|
274
|
+
this.props.transitionWorkflow(flattenToAppURL(selectedOption.url));
|
|
275
|
+
this.setState({ selectedOption });
|
|
276
|
+
toast.success(
|
|
277
|
+
<Toast
|
|
278
|
+
success
|
|
279
|
+
title={this.props.intl.formatMessage(messages.messageUpdated)}
|
|
280
|
+
content=""
|
|
281
|
+
/>,
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
toast.error(
|
|
285
|
+
<Toast
|
|
286
|
+
error
|
|
287
|
+
title={this.props.intl.formatMessage(
|
|
288
|
+
messages.notAllowedToUpdateWorkflow,
|
|
289
|
+
)}
|
|
290
|
+
content=""
|
|
291
|
+
/>,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
257
294
|
};
|
|
258
295
|
|
|
259
296
|
selectValue = (option) => {
|
|
@@ -367,13 +404,17 @@ export default compose(
|
|
|
367
404
|
injectLazyLibs(['reactSelect']),
|
|
368
405
|
withRouter,
|
|
369
406
|
connect(
|
|
370
|
-
(state) => ({
|
|
407
|
+
(state, props) => ({
|
|
371
408
|
loaded: state.workflow.transition.loaded,
|
|
372
409
|
content: state.content.data,
|
|
373
410
|
workflowLoaded: state.workflow.get?.loaded,
|
|
374
411
|
contentHistory: state.workflow.history,
|
|
375
412
|
transitions: state.workflow.transitions,
|
|
376
413
|
currentStateValue: getCurrentStateMapping(state.workflow.currentState),
|
|
414
|
+
editingProgressSteps:
|
|
415
|
+
state?.editingProgress?.editing?.loaded === true
|
|
416
|
+
? state?.editingProgress?.result?.steps
|
|
417
|
+
: [],
|
|
377
418
|
}),
|
|
378
419
|
{ getContent, getWorkflow, transitionWorkflow },
|
|
379
420
|
),
|