From 4db29b014b570164435ff41ae39c88bf667a85fb Mon Sep 17 00:00:00 2001 From: "Shaun A. Noordin" Date: Fri, 26 Apr 2024 03:02:16 +0100 Subject: [PATCH] TasksPage: replace preview link with 'choose starting page' dropdown --- .../components/TasksPage/TasksPage.jsx | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx b/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx index 8d1e1b60a0..a6fbe903a5 100644 --- a/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx +++ b/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx @@ -7,14 +7,12 @@ import getNewStepKey from '../../helpers/getNewStepKey.js'; import getNewTaskKey from '../../helpers/getNewTaskKey.js'; import moveItemInArray from '../../helpers/moveItemInArray.js'; import cleanupTasksAndSteps from '../../helpers/cleanupTasksAndSteps.js'; -import getPreviewEnv from '../../helpers/getPreviewEnv.js'; // import strings from '../../strings.json'; // TODO: move all text into strings import ExperimentalPanel from './ExperimentalPanel.jsx'; import EditStepDialog from './components/EditStepDialog'; import NewTaskDialog from './components/NewTaskDialog.jsx'; import StepItem from './components/StepItem'; -import ExternalLinkIcon from '../../icons/ExternalLinkIcon.jsx'; export default function TasksPage() { const { project, workflow, update } = useWorkflowContext(); @@ -156,6 +154,10 @@ export default function TasksPage() { setActiveStepIndex(-1); } + function handleChangeStartingPage(e) { + console.log('+++ handleChangeStartingPage: ', e); + } + // Changes the optional "next page" of a step/page function updateNextStepForStep(stepKey, next = undefined) { if (!workflow || !workflow.steps) return; @@ -201,8 +203,6 @@ export default function TasksPage() { stepHasOneTask: activeStep?.[1]?.taskKeys?.length > 0, stepHasManyTasks: activeStep?.[1]?.taskKeys?.length > 1 } - const previewEnv = getPreviewEnv(); - const previewUrl = `https://frontend.preview.zooniverse.org/projects/${project?.slug}/classify/workflow/${workflow?.id}${previewEnv}`; if (!workflow) return null; return ( @@ -222,14 +222,21 @@ export default function TasksPage() { > Add a new Task - - Preview Workflow - + + {workflow?.steps?.map(([stepKey, stepBody]) => ( + + ))} +