feat: clone proposal workflows#1574
Conversation
| ); | ||
|
|
||
| if (newPrevStatusId === undefined || newNextStatusId === undefined) { | ||
| continue; |
There was a problem hiding this comment.
suggestion: can we throw here? This should never happen, but if happens is an indication of an issue somewher upstream and would be nice to know about it so we can fix it. Othwerise the clonde will appear as successful but in fact will have missing connections.
There was a problem hiding this comment.
Yeap good point. I've changed it to throw a GraphQLError so no incomplete clone gets saved.
|
|
||
| cy.contains('Yes').click(); | ||
|
|
||
| cy.contains(`Copy of ${workflowName}`); |
There was a problem hiding this comment.
suggestion: would it be possble to inspect also the contents of the cloned workflow? The real work in this PR is done in the database layer so changes cant effectivelly be targegeted by Unit Tests. So adding some checks here in e2e could effectivelly check if the DB operations went though fine.
There was a problem hiding this comment.
I've updated the test to set up a status and connection before cloning, then open the cloned workflow and verify the metadata, statuses and connection edge are all present.
Closes UserOfficeProject/issue-tracker/issues/1530
Description
This PR introduces a clone button to each workflow entry. Cloning a workflow creates a direct copy of it that can be opened and customised independently.
Motivation and Context
It is complicated and time consuming to create a workflow from scratch. This change allows users to duplicate an existing workflow as a starting point and make the necessary changes in a shorter time frame.
How Has This Been Tested
Added unit and e2e tests.
Fixes
Changes
cloneWorkflowmutation with role-based access control and input validation.cloneWorkflowmutation.cloneWorkflowGraphQL mutation query on the frontend.Depends on
Tests included/Docs Updated?