Skip to content

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

Open
jekabs-karklins wants to merge 193 commits into
developfrom
SWAP-5434-as-a-user-officer-i-want-to-specify-which-actions
Open

feat: add the ability to execute status actions when the proposal status is updated manually#1441
jekabs-karklins wants to merge 193 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
Base automatically changed from SWAP-4949-workflow-overhaul to develop May 26, 2026 13:37
@jekabs-karklins

Copy link
Copy Markdown
Contributor Author

Hi, @mutambaraf when you have a bit of time could you check this PR. it is not urgent, just has been in the queue for a while :). Thanks

@jekabs-karklins

Copy link
Copy Markdown
Contributor Author

@gnyiri I ran into the issue you mentioned here.

The problem: when a connection has status actions configured

image

and the proposal's status is changed manually, an exception is thrown, so the status actions never run. (Automatic status updates work fine.)

The cause: the code on develop assumes a workflow connection id is always set. That's true for automatic updates, but not for manual status changes — there's no single connection to point to. In fact, two different connections can lead to the same status:

image

so the engine has no way of knowing which connection's actions to run.

Good news: this PR already fixes it. This line skips the status actions when no connection is specified, and the PR also lets the user choose which connection to use for the manual case. Would be great to get this merged.

@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.

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.

4 participants