Update next step ids on step update (#11605)

When inserting a new step between step 1 et step 2, then step 1 should
have the new step as next step id, add stop having step 2.

When deleting a step, we link the parent and next steps together. It may
change in the future
This commit is contained in:
Thomas Trompette
2025-04-16 15:30:05 +02:00
committed by GitHub
parent bf704bd1bc
commit 78e10b2da5
10 changed files with 338 additions and 17 deletions

View File

@ -15,4 +15,16 @@ export class CreateWorkflowVersionStepInput {
nullable: false,
})
stepType: WorkflowActionType;
@Field(() => String, {
description: 'Parent step ID',
nullable: true,
})
parentStepId?: string;
@Field(() => String, {
description: 'Next step ID',
nullable: true,
})
nextStepId?: string;
}

View File

@ -26,12 +26,11 @@ export class WorkflowStepResolver {
async createWorkflowVersionStep(
@AuthWorkspace() { id: workspaceId }: Workspace,
@Args('input')
{ stepType, workflowVersionId }: CreateWorkflowVersionStepInput,
input: CreateWorkflowVersionStepInput,
): Promise<WorkflowActionDTO> {
return this.workflowVersionStepWorkspaceService.createWorkflowVersionStep({
workspaceId,
workflowVersionId,
stepType,
input,
});
}
@ -57,7 +56,7 @@ export class WorkflowStepResolver {
return this.workflowVersionStepWorkspaceService.deleteWorkflowVersionStep({
workspaceId,
workflowVersionId,
stepId,
stepIdToDelete: stepId,
});
}