From 78af8dae67d4e50fe5b788159a5deafff187530c Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Fri, 31 May 2024 19:09:39 +0800 Subject: [PATCH] fix: plugin-workflow, import Instruction from nodes (#1095) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1095 Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../json-parse/JSONParse.instruction.ts | 3 ++- .../client/features/loop/LoopInstruction.tsx | 18 ++++++------- .../features/manual/instruction/index.tsx | 15 ++++------- .../features/parallel/ParallelInstruction.tsx | 25 +++++++++---------- .../features/request/RequestInstruction.tsx | 9 ++----- .../client/features/sql/SQLInstruction.tsx | 3 ++- 6 files changed, 32 insertions(+), 41 deletions(-) diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/json-parse/JSONParse.instruction.ts b/packages/plugins/@tachybase/plugin-workflow/src/client/features/json-parse/JSONParse.instruction.ts index f4456201d..ff02c1a5c 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/json-parse/JSONParse.instruction.ts +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/json-parse/JSONParse.instruction.ts @@ -1,9 +1,10 @@ import { css } from '@tachybase/client'; import { ArrayTable } from '@tachybase/components'; -import { Instruction, WorkflowVariableInput } from '@tachybase/plugin-workflow/client'; +import { WorkflowVariableInput } from '../..'; import { NAMESPACE_INSTRUCTION_JSON_PARSE } from '../../../common/constants'; import { tval } from '../../locale'; +import { Instruction } from '../../nodes'; export class JSONParseInstruction extends Instruction { title = tval('JSON Parse'); diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/loop/LoopInstruction.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/loop/LoopInstruction.tsx index 8fe860ca0..2def966d2 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/loop/LoopInstruction.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/loop/LoopInstruction.tsx @@ -1,22 +1,22 @@ import React from 'react'; -import { ArrowUpOutlined } from '@ant-design/icons'; - import { css, cx, useCompile } from '@tachybase/client'; +import { ArrowUpOutlined } from '@ant-design/icons'; + import { - NodeDefaultView, Branch, + defaultFieldNames, + NodeDefaultView, + nodesOptions, + scopeOptions, + triggerOptions, useFlowContext, useStyles, VariableOption, WorkflowVariableInput, - defaultFieldNames, - nodesOptions, - scopeOptions, - triggerOptions, - Instruction, } from '../..'; -import { NAMESPACE, lang } from '../../locale'; +import { lang, NAMESPACE } from '../../locale'; +import { Instruction } from '../../nodes'; function findOption(options: VariableOption[], paths: string[]) { let opts = options; diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/index.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/index.tsx index 2534347db..2c5efe4aa 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/index.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/manual/instruction/index.tsx @@ -1,16 +1,11 @@ import { SchemaInitializerItemType, useCollectionManager_deprecated, useCompile, usePlugin } from '@tachybase/client'; -import WorkflowPlugin, { - defaultFieldNames, - getCollectionFieldOptions, - CollectionBlockInitializer, - Instruction, -} from '../../..'; - -import { SchemaConfig, SchemaConfigButton } from './SchemaConfig'; -import { ModeConfig } from './ModeConfig'; -import { AssigneesSelect } from './AssigneesSelect'; +import WorkflowPlugin, { CollectionBlockInitializer, defaultFieldNames, getCollectionFieldOptions } from '../../..'; import { NAMESPACE } from '../../../locale'; +import { Instruction } from '../../../nodes'; +import { AssigneesSelect } from './AssigneesSelect'; +import { ModeConfig } from './ModeConfig'; +import { SchemaConfig, SchemaConfigButton } from './SchemaConfig'; const MULTIPLE_ASSIGNED_MODE = { SINGLE: Symbol('single'), diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/parallel/ParallelInstruction.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/parallel/ParallelInstruction.tsx index 9340fa7c0..964175f2c 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/parallel/ParallelInstruction.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/parallel/ParallelInstruction.tsx @@ -1,20 +1,19 @@ import React, { useState } from 'react'; -import { Button, Tooltip } from 'antd'; -import { PlusOutlined } from '@ant-design/icons'; - import { css } from '@tachybase/client'; -import { - NodeDefaultView, - Branch, - useFlowContext, - useStyles, - useGetAriaLabelOfAddButton, - RadioWithTooltip, - Instruction, -} from '../..'; +import { PlusOutlined } from '@ant-design/icons'; +import { Button, Tooltip } from 'antd'; -import { NAMESPACE, lang } from '../../locale'; +import { + Branch, + NodeDefaultView, + RadioWithTooltip, + useFlowContext, + useGetAriaLabelOfAddButton, + useStyles, +} from '../..'; +import { lang, NAMESPACE } from '../../locale'; +import { Instruction } from '../../nodes'; export default class extends Instruction { title = `{{t("Parallel branch", { ns: "${NAMESPACE}" })}}`; diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/request/RequestInstruction.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/request/RequestInstruction.tsx index 1e38e70fb..159e52e39 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/request/RequestInstruction.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/request/RequestInstruction.tsx @@ -1,13 +1,8 @@ import { ArrayItems } from '@tachybase/components'; -import { - defaultFieldNames, - Instruction, - WorkflowVariableInput, - WorkflowVariableJSON, - WorkflowVariableTextArea, -} from '../..'; +import { defaultFieldNames, WorkflowVariableInput, WorkflowVariableJSON, WorkflowVariableTextArea } from '../..'; import { NAMESPACE } from '../../locale'; +import { Instruction } from '../../nodes'; export default class extends Instruction { title = `{{t("HTTP request", { ns: "${NAMESPACE}" })}}`; diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/sql/SQLInstruction.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/sql/SQLInstruction.tsx index 36ac7ff8b..8bc70c543 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/sql/SQLInstruction.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/sql/SQLInstruction.tsx @@ -3,8 +3,9 @@ import { css } from '@tachybase/client'; import { Trans } from 'react-i18next'; -import { defaultFieldNames, Instruction, WorkflowVariableRawTextArea } from '../..'; +import { defaultFieldNames, WorkflowVariableRawTextArea } from '../..'; import { NAMESPACE } from '../../locale'; +import { Instruction } from '../../nodes'; export default class extends Instruction { title = `{{t("SQL action", { ns: "${NAMESPACE}" })}}`;