Start using next step ids (#11683)

- update workflow executor
- update next step ids on step creation/deletion
- use these in workflow run
- use these in variables
This commit is contained in:
Thomas Trompette
2025-04-29 16:29:25 +02:00
committed by GitHub
parent 19f46a0091
commit d8b2e1fb34
28 changed files with 325 additions and 105 deletions

View File

@ -6,13 +6,13 @@ import { updateRecordFromCache } from '@/object-record/cache/utils/updateRecordF
import { DELETE_WORKFLOW_VERSION_STEP } from '@/workflow/graphql/mutations/deleteWorkflowVersionStep';
import { WorkflowVersion } from '@/workflow/types/Workflow';
import { useApolloClient, useMutation } from '@apollo/client';
import { isDefined } from 'twenty-shared/utils';
import {
DeleteWorkflowVersionStepInput,
DeleteWorkflowVersionStepMutation,
DeleteWorkflowVersionStepMutationVariables,
WorkflowAction,
} from '~/generated/graphql';
import { isDefined } from 'twenty-shared/utils';
export const useDeleteWorkflowVersionStep = () => {
const apolloClient = useApolloClient();
@ -47,9 +47,16 @@ export const useDeleteWorkflowVersionStep = () => {
const newCachedRecord = {
...cachedRecord,
steps: (cachedRecord.steps || []).filter(
(step: WorkflowAction) => step.id !== deletedStep.id,
),
steps: (cachedRecord.steps || [])
.filter((step: WorkflowAction) => step.id !== deletedStep.id)
.map((step) => {
return {
...step,
nextStepIds: step.nextStepIds?.filter(
(nextStepId) => nextStepId !== deletedStep.id,
),
};
}),
};
const recordGqlFields = {