Skip to content

Commit

Permalink
Merge pull request #77 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Feb 19, 2024
2 parents 35ffe76 + d491481 commit b77b45c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 26 deletions.
24 changes: 9 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.12.1](https://github.com/eea/volto-eea-website-policy/compare/1.13.0-beta.1...1.12.1) - 18 January 2024
### [1.13.0](https://github.com/eea/volto-eea-website-policy/compare/1.13.0-beta.1...1.13.0) - 19 February 2024

### [1.13.0-beta.1](https://github.com/eea/volto-eea-website-policy/compare/1.12.0...1.13.0-beta.1) - 17 January 2024
#### :rocket: New Features

- feat: inforce required fields on workflow change - refs #262289 [dobri1408 - [`b6f939d`](https://github.com/eea/volto-eea-website-policy/commit/b6f939d4274b87607ef69adabb3c49b2b5c03354)]

#### :hammer_and_wrench: Others

- Registered login-authomatic [Alexandru Ghica - [`f9e5821`](https://github.com/eea/volto-eea-website-policy/commit/f9e58217971de1ae75b4394ca02a016d508a4edf)]
- Release 1.13.0 [alin - [`baea684`](https://github.com/eea/volto-eea-website-policy/commit/baea684dc2bb8968ddb6125c4d66bd4cb95c74c8)]
### [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

### [1.12.1](https://github.com/eea/volto-eea-website-policy/compare/1.12.0...1.12.1) - 18 January 2024

### [1.12.0](https://github.com/eea/volto-eea-website-policy/compare/1.12.0-beta.4...1.12.0) - 17 January 2024

### [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
Expand All @@ -19,7 +25,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- test: [JENKINS] fail with logs on coverage [valentinab25 - [`5cf68f8`](https://github.com/eea/volto-eea-website-policy/commit/5cf68f8db34448d10fe993d16541ad9732434cc8)]
### [1.12.0-beta.1](https://github.com/eea/volto-eea-website-policy/compare/1.11.1...1.12.0-beta.1) - 12 January 2024

#### :hammer_and_wrench: Others
Expand All @@ -40,11 +45,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Release 1.11.0 [Alin Voinea - [`3249160`](https://github.com/eea/volto-eea-website-policy/commit/3249160422c6c6e0cf14823b614f8885101a847a)]
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`8beb7e7`](https://github.com/eea/volto-eea-website-policy/commit/8beb7e7a12cbc314e56e4b1aceab5ef8d00ca6f3)]
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`12d3da1`](https://github.com/eea/volto-eea-website-policy/commit/12d3da12e9a3b0882cf55efe2d40f3032724d41b)]
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`0af0764`](https://github.com/eea/volto-eea-website-policy/commit/0af076467120ed9a80c697931e869837b92a0a4c)]
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`8662e3e`](https://github.com/eea/volto-eea-website-policy/commit/8662e3e5fc3640d678ce320eb8856a37d419306c)]
- test: [JENKINS] Improve cypress time [valentinab25 - [`ef1074f`](https://github.com/eea/volto-eea-website-policy/commit/ef1074fdf968cafdf476d4ee4951eb18ebac048a)]
### [1.10.0](https://github.com/eea/volto-eea-website-policy/compare/1.9.2...1.10.0) - 2 November 2023

#### :rocket: New Features
Expand All @@ -53,7 +53,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

- chore: [JENKINS] Refactor automated testing [valentinab25 - [`8b1b422`](https://github.com/eea/volto-eea-website-policy/commit/8b1b42297b46d9fb7325589b3bd043233c0d66e9)]
- chore: husky, lint-staged use fixed versions [valentinab25 - [`44ac62e`](https://github.com/eea/volto-eea-website-policy/commit/44ac62e6f8b7e5b7d57edfbf82812c91dc5d6bba)]
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`b9a46d8`](https://github.com/eea/volto-eea-website-policy/commit/b9a46d85a64739188a3df9e8cbe645418b5d8b0a)]

Expand Down Expand Up @@ -174,7 +173,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- Release 1.5.0 [Alin Voinea - [`a3dea8e`](https://github.com/eea/volto-eea-website-policy/commit/a3dea8ea15cb8d2a876dc10da926ece3a5707ea9)]
- test(Jenkinsfile): Use latest stable volto for testing [Alin Voinea - [`a8f7123`](https://github.com/eea/volto-eea-website-policy/commit/a8f712364187f9638886667c249fa102cb49b5c0)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`124a8f8`](https://github.com/eea/volto-eea-website-policy/commit/124a8f8ad4ced507aeec27012d725f2e2b977e08)]
### [1.4.0](https://github.com/eea/volto-eea-website-policy/compare/1.3.4...1.4.0) - 21 February 2023

#### :rocket: New Features
Expand Down Expand Up @@ -254,7 +252,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Release 1.1.0 [Alin Voinea - [`0291b3b`](https://github.com/eea/volto-eea-website-policy/commit/0291b3bb7b4c6ab09ca98728885cea4051eac8e3)]
- yarn 3 [Alin Voinea - [`593aa58`](https://github.com/eea/volto-eea-website-policy/commit/593aa58eaa4d28aced0603b7f7dd125c857a6f54)]
### [1.0.4](https://github.com/eea/volto-eea-website-policy/compare/1.0.3...1.0.4) - 22 November 2022

#### :nail_care: Enhancements
Expand Down Expand Up @@ -300,7 +297,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`d153f54`](https://github.com/eea/volto-eea-website-policy/commit/d153f54e55e918fa4746e05488c734624eaf14a9)]
### [0.4.0](https://github.com/eea/volto-eea-website-policy/compare/0.3.3...0.4.0) - 19 September 2022

#### :hammer_and_wrench: Others
Expand Down Expand Up @@ -376,7 +372,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- format index.js [Andrei Grigore - [`db4481a`](https://github.com/eea/volto-eea-website-policy/commit/db4481aeeba59a769272659f33278c902fc69bec)]
- Update index.js [Alexandru Ghica - [`dc09886`](https://github.com/eea/volto-eea-website-policy/commit/dc0988640a76a9914381b120f58bb61a9ab1eb39)]
- Added externalRoutes [Alexandru Ghica - [`b68135b`](https://github.com/eea/volto-eea-website-policy/commit/b68135b013fafa93a41ea602ea2fad30879abe0f)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`575cca6`](https://github.com/eea/volto-eea-website-policy/commit/575cca674602ca2e1c2a41300c47ba594ff49aa0)]
### [0.1.1](https://github.com/eea/volto-eea-website-policy/compare/0.1.0...0.1.1) - 4 March 2022

#### :hammer_and_wrench: Others
Expand All @@ -389,5 +384,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn bootstrap [Alin Voinea - [`9b4d197`](https://github.com/eea/volto-eea-website-policy/commit/9b4d197cbc7992566cb36524d190078d5ad21a44)]
- Initial commit [Alin Voinea - [`3800692`](https://github.com/eea/volto-eea-website-policy/commit/3800692f7a4de6460815bd6061facacb986cbef0)]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-eea-website-policy",
"version": "1.12.1",
"version": "1.13.0",
"description": "@eeacms/volto-eea-website-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
56 changes: 46 additions & 10 deletions src/customizations/volto/components/manage/Workflow/Workflow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const messages = defineMessages({
id: 'Workflow updated.',
defaultMessage: 'Workflow updated.',
},
notAllowedToUpdateWorkflow: {
id: 'notAllowedToUpdateWorkflow',
defaultMessage: 'Please fill out all the required fields',
},
messageNoWorkflow: {
id: 'No workflow',
defaultMessage: 'No workflow',
Expand All @@ -45,6 +49,21 @@ const messages = defineMessages({
},
});

const filter_remaining_steps = (values, key) => {
return values.filter((value) => {
const is_not_ready = !value.is_ready;
if (!is_not_ready) {
return false;
}
const states = value.states;
const required_for_all = states?.indexOf('all') !== -1;
return (
(is_not_ready && required_for_all) ||
(is_not_ready && states?.indexOf(key) !== -1)
);
});
};

const SingleValue = injectLazyLibs('reactSelect')(({ children, ...props }) => {
const stateDecorator = {
marginRight: '10px',
Expand Down Expand Up @@ -184,6 +203,7 @@ class Workflow extends Component {
workflowLoaded: PropTypes.func,
loaded: PropTypes.bool.isRequired,
pathname: PropTypes.string.isRequired,

contentHistory: PropTypes.arrayOf(
PropTypes.shape({
review_state: PropTypes.string,
Expand Down Expand Up @@ -245,15 +265,27 @@ class Workflow extends Component {
* @returns {undefined}
*/
transition = (selectedOption) => {
this.props.transitionWorkflow(flattenToAppURL(selectedOption.url));
this.setState({ selectedOption });
toast.success(
<Toast
success
title={this.props.intl.formatMessage(messages.messageUpdated)}
content=""
/>,
);
if (filter_remaining_steps(this.props.editingProgressSteps).length === 0) {
this.props.transitionWorkflow(flattenToAppURL(selectedOption.url));
this.setState({ selectedOption });
toast.success(
<Toast
success
title={this.props.intl.formatMessage(messages.messageUpdated)}
content=""
/>,
);
} else {
toast.error(
<Toast
error
title={this.props.intl.formatMessage(
messages.notAllowedToUpdateWorkflow,
)}
content=""
/>,
);
}
};

selectValue = (option) => {
Expand Down Expand Up @@ -367,13 +399,17 @@ export default compose(
injectLazyLibs(['reactSelect']),
withRouter,
connect(
(state) => ({
(state, props) => ({
loaded: state.workflow.transition.loaded,
content: state.content.data,
workflowLoaded: state.workflow.get?.loaded,
contentHistory: state.workflow.history,
transitions: state.workflow.transitions,
currentStateValue: getCurrentStateMapping(state.workflow.currentState),
editingProgressSteps:
state?.editingProgress?.editing?.loaded === true
? state?.editingProgress?.result?.steps
: [],
}),
{ getContent, getWorkflow, transitionWorkflow },
),
Expand Down

0 comments on commit b77b45c

Please sign in to comment.