stable

Clone or download

Read-only

POST tracker_workflow_transitions/:id must replicate pre-conditions

Part of story #12187 configure workflow pre & post actions at target state level How to test: - Set up the feature flag - In a workflow configured in Simple mode (forge your DB), given a "column" (for example To Do) where you have no transitions, create one. - Add conditions to it (not empty fields, not empty comment, permissions) - When you add another transition in the same column, it will replicate the conditions you set up on the first one. - When you add a new transition from "New artifact", it won't replicate the "not empty comment" condition. - Given you have transitions in the column, when you add another transition, it will always replicate transitions that are not from "New artifact", unless the transition from "New artifact" is the only other. - No functional change expected on Advanced workflows. Will be done later: - POST must also replicate post-actions Change-Id: I5abf9f5c8d3954b0c455892ad65ad223321aae6c

Modified Files

Name
M plugins/tracker/include/REST/v1/Workflow/TransitionPOSTHandler.php +34 −8 Go to diff View file
M plugins/tracker/include/REST/v1/Workflow/TransitionsResource.class.php +25 −17 Go to diff View file
M plugins/tracker/include/Workflow/Transition.class.php +4 −1 Go to diff View file
A plugins/tracker/include/Workflow/Transition/Condition/ConditionsReplicator.php +79 −0 Go to diff View file
M plugins/tracker/include/Workflow/Transition/ConditionFactory.class.php +25 −0 Go to diff View file
M plugins/tracker/include/Workflow/Transition/Update/TransitionRetriever.php +37 −0 Go to diff View file
M plugins/tracker/phpunit/REST/v1/Workflow/TransitionPOSTHandlerTest.php +76 −7 Go to diff View file
A plugins/tracker/phpunit/Tracker/Workflow/Condition/ConditionsReplicatorTest.php +107 −0 Go to diff View file
A plugins/tracker/phpunit/Tracker/Workflow/Transition/Update/TransitionRetrieverTest.php +181 −0 Go to diff View file