implement initialization of approval workflows on exam creation.

This commit is contained in:
Joao Correia
2025-02-04 22:04:58 +00:00
parent d3385caaf8
commit de15eb5ee1
12 changed files with 175 additions and 20 deletions

View File

@@ -41,7 +41,7 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res, params }
const { id } = params as { id: string };
const workflow: ApprovalWorkflow | null = await getApprovalWorkflow("configured-workflows", id);
const workflow: ApprovalWorkflow | null = await getApprovalWorkflow("active-workflows", id);
if (!workflow)
return redirect("/approval-workflows")
@@ -161,7 +161,11 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
return;
})
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
if (selectedStepIndex + 1 < currentWorkflow.steps.length){
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
} else {
setIsPanelOpen(false);
}
};
const handleRejectStep = () => {