Skip to content

feat: add the ability to execute status actions when the proposal status is updated manually#1441

Merged
jekabs-karklins merged 206 commits into
developfrom
SWAP-5434-as-a-user-officer-i-want-to-specify-which-actions
Jul 3, 2026
Merged

feat: add the ability to execute status actions when the proposal status is updated manually#1441
jekabs-karklins merged 206 commits into
developfrom
SWAP-5434-as-a-user-officer-i-want-to-specify-which-actions

Conversation

@jekabs-karklins

@jekabs-karklins jekabs-karklins commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Description

THIS PR IS BUILT ON TOP OF #SWAP-4949-workflow-overhaul

This PR adds the ability for the User Officer to execute status actions when he/she sets the proposal status manually.

Motivation and Context

After the workflow overhaul the status actions are attached to the transition, and not the status. In same cases when setting the proposal status the user officer would want to run the status actions accompanied with the transition leading to that status.

This PR handles three scenarios:

  • If there are no status actions before the chosen state, user can not select anything
  • If there is one incoming transition with status action user can decide to run it.
  • If there are multiple, user can decide if he/she wants to run it and if yes from which transition (see screenshots)
image image

Changes

  • Added workflowConnectionId parameter to the changeProposalsStatus mutation in ProposalMutations.ts, which is used to fetch the proposal workflow and run the status engine.
  • Updated changeProposalsStatus mutation to only run status actions if workflowConnectionId is provided, improving the control over status change side-effects.
  • Updated the related test case in proposals.cy.ts to cover the new functionality.

How Has This Been Tested?

Added e2e

Fixes Jira Issue

https://jira.ess.eu//browse/SWAP-5434

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

jekabskarklins added 30 commits December 22, 2025 14:13
…ntroducing CreateWorkflowConnection mutation
…vents table and updating related references
…tatusConnectionId and refactor related properties
…authorization checks for proposal assignments
@jekabs-karklins jekabs-karklins requested a review from gnyiri June 17, 2026 11:47
@gnyiri

gnyiri commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Two comments:

  • is it possible to also display the status actions along with the states (just like for the proposal workflow panel)?
  • as far as I understand, the actual status does not restrict the list of selectable transitions, that is, all transitions can be selected that are pointing to the new status independently from the actual status. Is this the desired behaviour?

@jekabs-karklins

Copy link
Copy Markdown
Contributor Author

Two comments:

  • is it possible to also display the status actions along with the states (just like for the proposal workflow panel)?
  • as far as I understand, the actual status does not restrict the list of selectable transitions, that is, all transitions can be selected that are pointing to the new status independently from the actual status. Is this the desired behaviour?

I have added the events and actions to be displayed when changing the proposal status manually..
image

You can only select status actions that lead to the status that is selected. This is to enable the behavior how itworkflows were functioning in the past.

@yoganandaness yoganandaness left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@jekabs-karklins I hope I should be doing the same for Experiment safety status change as well.

@mutambaraf mutambaraf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we have dropped a test file experimentSafetyWorkflow.spec.ts was it by mistake or we will add them back

@jekabs-karklins

Copy link
Copy Markdown
Contributor Author

Looks like we have dropped a test file experimentSafetyWorkflow.spec.ts was it by mistake or we will add them back

Certainly a mistake. Thanks I'll put it back.

@mutambaraf mutambaraf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just a few comments

disabled={isSubmitting}
data-cy="status-selection"
<Grid item xs={12} md={8}>
<div style={{ height: '500px', border: '1px solid #ddd' }}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know is it a good idea to hard code some of these colours.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the border, I think it looks better without actually
image.png

}
});
}, [api, selectedProposalsWorkflowIds[0]]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a duplication we may need to remove one of the useEffect hook.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jekabs-karklins jekabs-karklins enabled auto-merge July 2, 2026 09:23
@jekabs-karklins jekabs-karklins disabled auto-merge July 2, 2026 09:55
@jekabs-karklins jekabs-karklins enabled auto-merge July 3, 2026 07:25
@jekabs-karklins jekabs-karklins merged commit 58d6d98 into develop Jul 3, 2026
35 of 36 checks passed
@jekabs-karklins jekabs-karklins deleted the SWAP-5434-as-a-user-officer-i-want-to-specify-which-actions branch July 3, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants