From b288dc8c355b91c7b0e33cab06381eef4176ca38 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Fri, 4 Mar 2022 23:34:16 +0100 Subject: [PATCH] refactor: use step.executionSteps[].dataOut --- packages/backend/src/graphql/types/execution-step.ts | 1 + packages/backend/src/graphql/types/step.ts | 1 - packages/web/src/components/PowerInput/data.ts | 2 +- packages/web/src/components/PowerInput/index.tsx | 1 + .../graphql/queries/get-step-with-test-executions.ts | 10 ++++++++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/graphql/types/execution-step.ts b/packages/backend/src/graphql/types/execution-step.ts index 5415c71b..f48d306d 100644 --- a/packages/backend/src/graphql/types/execution-step.ts +++ b/packages/backend/src/graphql/types/execution-step.ts @@ -4,6 +4,7 @@ import { GraphQLJSONObject } from 'graphql-type-json'; const executionStepType = new GraphQLObjectType({ name: 'ExecutionStep', fields: { + id: { type: GraphQLString }, executionId: { type: GraphQLString }, stepId: { type: GraphQLString }, status: { type: GraphQLString }, diff --git a/packages/backend/src/graphql/types/step.ts b/packages/backend/src/graphql/types/step.ts index 0dddef85..76460805 100644 --- a/packages/backend/src/graphql/types/step.ts +++ b/packages/backend/src/graphql/types/step.ts @@ -33,7 +33,6 @@ const stepType = new GraphQLObjectType({ parameters: { type: GraphQLJSONObject }, connection: { type: ConnectionType }, flow: { type: FlowType }, - output: { type: GraphQLJSONObject }, position: { type: GraphQLInt }, status: { type: GraphQLString }, executionSteps: { diff --git a/packages/web/src/components/PowerInput/data.ts b/packages/web/src/components/PowerInput/data.ts index 0c192b9d..0e2fa219 100644 --- a/packages/web/src/components/PowerInput/data.ts +++ b/packages/web/src/components/PowerInput/data.ts @@ -39,6 +39,6 @@ export const processStepWithExecutions = (steps: IStep[]): any[] => { id: step.id, // TODO: replace with step.name once introduced name: `${index + 1}. ${step.appKey}`, - output: process(step.output, `step.${step.id}`), + output: process(step.executionSteps?.[0]?.dataOut || {}, `step.${step.id}`), })); }; diff --git a/packages/web/src/components/PowerInput/index.tsx b/packages/web/src/components/PowerInput/index.tsx index d2e3196e..28b25bc0 100644 --- a/packages/web/src/components/PowerInput/index.tsx +++ b/packages/web/src/components/PowerInput/index.tsx @@ -13,6 +13,7 @@ import { useSelected, useFocused, } from 'slate-react'; +import type { IExecutionStep, IStep } from '@automatisch/types'; import { serialize, diff --git a/packages/web/src/graphql/queries/get-step-with-test-executions.ts b/packages/web/src/graphql/queries/get-step-with-test-executions.ts index 813d764d..0c23c0c0 100644 --- a/packages/web/src/graphql/queries/get-step-with-test-executions.ts +++ b/packages/web/src/graphql/queries/get-step-with-test-executions.ts @@ -5,7 +5,13 @@ export const GET_STEP_WITH_TEST_EXECUTIONS = gql` getStepWithTestExecutions(stepId: $stepId) { id appKey - output + executionSteps { + id + executionId + stepId + status + dataOut + } } } -`; \ No newline at end of file +`;