diff --git a/app/pages/lab-pages-editor/components/TasksPage/ExperimentalPanel.jsx b/app/pages/lab-pages-editor/components/TasksPage/ExperimentalPanel.jsx index 636f3bc773..c5377ad67d 100644 --- a/app/pages/lab-pages-editor/components/TasksPage/ExperimentalPanel.jsx +++ b/app/pages/lab-pages-editor/components/TasksPage/ExperimentalPanel.jsx @@ -5,6 +5,7 @@ export default function ExperimentalPanel({ }) { function experimentalReset() { update({ + first_task: '', tasks: {}, steps: [] }); @@ -12,6 +13,7 @@ export default function ExperimentalPanel({ function experimentalQuickSetup() { update({ + first_task: 'P0', tasks: { 'T0': { answers: [ diff --git a/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx b/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx index b1c1ed6999..f42fca4ab0 100644 --- a/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx +++ b/app/pages/lab-pages-editor/components/TasksPage/TasksPage.jsx @@ -15,7 +15,7 @@ import NewTaskDialog from './components/NewTaskDialog.jsx'; import StepItem from './components/StepItem'; export default function TasksPage() { - const { project, workflow, update } = useWorkflowContext(); + const { workflow, update } = useWorkflowContext(); const editStepDialog = useRef(null); const newTaskDialog = useRef(null); const [ activeStepIndex, setActiveStepIndex ] = useState(-1); // Tracks which Step is being edited. @@ -155,7 +155,8 @@ export default function TasksPage() { } function handleChangeStartingPage(e) { - console.log('+++ handleChangeStartingPage: ', e?.target?.value); + const first_task = e?.target?.value || ''; + update({ first_task }); } // Changes the optional "next page" of a step/page @@ -203,13 +204,14 @@ export default function TasksPage() { stepHasOneTask: activeStep?.[1]?.taskKeys?.length > 0, stepHasManyTasks: activeStep?.[1]?.taskKeys?.length > 1 } + if (!workflow) return null; return (
-

{workflow?.display_name}

- {`#${workflow?.id}`} +

{workflow.display_name}

+ {`#${workflow.id}`} {(isActive) ? Active : Inactive}
@@ -226,20 +228,22 @@ export default function TasksPage() { aria-label="Choose starting Page" className="flex-item" onChange={handleChangeStartingPage} + defaultValue={workflow?.first_task || ''} > - {workflow?.steps?.map(([stepKey, stepBody]) => ( + {workflow.steps?.map(([stepKey, stepBody]) => ( ))}