Panoptes-Front-End
Panoptes-Front-End copied to clipboard
Project Builder: add checks for Slider subtask for Drawing Tasks
PR Overview
Towards #7185
This PR fixes an issue where the Slider subtask is always available for Drawing Tasks('s Drawing Tools).
- Old behaviour: when choosing to add a subtask to a Drawing Tool, the "Slider" option is always present, alongside the evergreen "Question" and "Text" options.
- New behaviour: the "Slider" option is ONLY present when project.experimental_tools includes "slider".
NOTE: this new behaviour reflects how the "dropdown" subtask already works.
Testing
Testing steps:
- Select a test project with workflow with a Drawing Task, e.g. https://pr-7186.pfe-preview.zooniverse.org/lab/1966/workflows/3596?env=staging
- Go to the admin page and ensure the "slider" experimental tool is 🔴 disabled: https://pr-7186.pfe-preview.zooniverse.org/admin/project_status/darkeshard/test-project-2022?env=staging
- View a workflow. Select a Drawing Task. Choose to add a Subtask.
- Confirm that there's 🔴 no option to add a Slider subtask.
- Go to the admin page and 🟢 enable the "slider" experimental tool.
- View the same workflow. Select a Drawing Task. Choose to add a Subtask.
- Confirm that there 🟢 IS an option to add a Slider subtask.
Status
Ready for review.
❗ HOWEVER, do NOT merge until we have completed discussions (see Slack) on how to proceed.
There are two parts to solving the "Drawing Tasks have Slider subtasks" problem:
- one, this PR, which prevents new Slider subtasks from being created without the experimental flag enabled.
- (Existing projects that already have Slider subtasks can continue to edit the existing subtasks.)
- two, some data-cleaning for existing projects that have Slider subtasks without the requisite Slider experimental tool enabled.