Migrate update step changes to diff (#14663)
This PR should fix optimistic rendering issues on step updates: - compute a diff for trigger and steps on mutations - build an util that applies that diff (built a more robust version from https://github.com/AsyncBanana/micropatch) - apply diff in cache
This commit is contained in:
+6
@@ -45,4 +45,10 @@ export class CreateWorkflowVersionStepInput {
|
||||
nullable: true,
|
||||
})
|
||||
position?: WorkflowStepPositionInput;
|
||||
|
||||
@Field(() => String, {
|
||||
description: 'Step ID',
|
||||
nullable: true,
|
||||
})
|
||||
id?: string;
|
||||
}
|
||||
|
||||
+6
-13
@@ -1,20 +1,13 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import graphqlTypeJson from 'graphql-type-json';
|
||||
|
||||
import { WorkflowActionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-step.dto';
|
||||
import GraphQLJSON from 'graphql-type-json';
|
||||
import { Difference } from 'microdiff';
|
||||
|
||||
@ObjectType('WorkflowVersionStepChanges')
|
||||
export class WorkflowVersionStepChangesDTO {
|
||||
@Field(() => [String], { nullable: true })
|
||||
triggerNextStepIds?: string[];
|
||||
@Field(() => GraphQLJSON, { nullable: true })
|
||||
triggerDiff?: Difference[];
|
||||
|
||||
@Field(() => graphqlTypeJson, { nullable: true })
|
||||
stepsNextStepIds?: Record<string, string[] | undefined>;
|
||||
|
||||
@Field(() => WorkflowActionDTO, { nullable: true })
|
||||
createdStep?: WorkflowActionDTO;
|
||||
|
||||
@Field(() => [String], { nullable: true })
|
||||
deletedStepIds?: string[];
|
||||
@Field(() => GraphQLJSON, { nullable: true })
|
||||
stepsDiff?: Difference[];
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import { DuplicateWorkflowVersionStepInput } from 'src/engine/core-modules/workf
|
||||
import { SubmitFormStepInput } from 'src/engine/core-modules/workflow/dtos/submit-form-step-input.dto';
|
||||
import { UpdateWorkflowRunStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-run-step-input.dto';
|
||||
import { UpdateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-step-input.dto';
|
||||
import { WorkflowActionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-step.dto';
|
||||
import { WorkflowActionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-action.dto';
|
||||
import { WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
|
||||
import { WorkflowVersionStepGraphqlApiExceptionFilter } from 'src/engine/core-modules/workflow/filters/workflow-version-step-graphql-api-exception.filter';
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
|
||||
Reference in New Issue
Block a user