Closed shaunanoordin closed 4 months ago
stepX.next
. cleanupTasksAndSteps()
has now been updated to also call linkStepsInWorkflow()
to ensure linked pages remain valid.I can't believe I forgot to add in a Testing section.
In this PR, we're testing the "Delete Pages" action. (Dev Reminder: pages == steps. "Page" is what the volunteer sees. "step" is what's in the code.)
Testing steps:
workflow.tasks
and workflow.steps
in the Workflow resource have P0 and T0 removed. This can only be checked via observing network requests or inspecting the resource.❗ Basically, the big hidden rule that Expectations 1 to 3 attempts to codify is that, when you delete a Page and all its Tasks, then ALL SECONDARY REFERENCES to that Page and Task should ALSO be nuked, and the workflow should continue working as if they never existed.
Example: a 3 Page workflow created via Quick Setup. The first page (with T0) is a branching Page that points to the second page (with T1) and the third page (with T2).
Thanks Travis! 👍
Might be useful to create a document of interesting edge cases / concerns / outline of all useful tests to be written when this gets migrated to FEM.
Ooo good point, I'm going to need to bring up the idea of starting this doc, to Sam & Sean next Monday.
PR Overview
Part of: Pages Editor MVP project and FEM Lab super-project Follows #6991 Staging branch URL: https://pr-7046.pfe-preview.zooniverse.org/lab/1982/workflows/editor/3711?env=staging
This PR adds the ability to delete a Step/Page.
cleanupTasksAndSteps()
helper function has been added to remove orphaned references in branching tasks, (this has been implemented). This maaay be updated in the future to also remove Tasks that aren't associated with any Steps, and remove Steps that have 0 Tasks. We'll see.Other changes:
Notes:
Status
Ready for review!