do not allow empty steps in workflows

This commit is contained in:
Joao Correia
2025-02-03 11:34:56 +00:00
parent 835a9bee03
commit d59b654ac2
3 changed files with 28 additions and 2 deletions

View File

@@ -124,6 +124,16 @@ export default function Home({ user, allConfiguredWorkflows, userEntitiesWithLab
return;
}
for (const workflow of workflows) {
for (const step of workflow.steps) {
if (step.assignees.every(x => !x)) {
toast.warning("There are empty steps in at least one of the configured workflows.");
setIsLoading(false);
return;
}
}
}
const filteredWorkflows: ApprovalWorkflow[] = workflows.map(workflow => ({
...workflow,
steps: workflow.steps.map(step => ({