do not allow empty steps in workflows
This commit is contained in:
@@ -94,6 +94,14 @@ export default function Home({ user, workflow, workflowEntityApprovers }: Props)
|
||||
return;
|
||||
}
|
||||
|
||||
for (const step of updatedWorkflow.steps) {
|
||||
if (step.assignees.every(x => !x)) {
|
||||
toast.warning("There is at least one empty step in the workflow.");
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const filteredWorkflow: ApprovalWorkflow = {
|
||||
...updatedWorkflow,
|
||||
steps: updatedWorkflow.steps.map(step => ({
|
||||
@@ -174,7 +182,7 @@ export default function Home({ user, workflow, workflowEntityApprovers }: Props)
|
||||
exit={{ opacity: 0, x: 60 }}
|
||||
transition={{ duration: 0.20 }}
|
||||
>
|
||||
{updatedWorkflow &&
|
||||
{/* {updatedWorkflow &&
|
||||
<WorkflowForm
|
||||
workflow={updatedWorkflow}
|
||||
onWorkflowChange={onWorkflowChange}
|
||||
@@ -182,7 +190,7 @@ export default function Home({ user, workflow, workflowEntityApprovers }: Props)
|
||||
isLoading={isLoading}
|
||||
isRedirecting={isRedirecting}
|
||||
/>
|
||||
}
|
||||
} */}
|
||||
</motion.div>
|
||||
</form>
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user