From 11dd23d8aa40e9b96ee720c9455cce0459a1397f Mon Sep 17 00:00:00 2001 From: balibabu Date: Wed, 21 Aug 2024 19:27:41 +0800 Subject: [PATCH] feat: Delete Answer and Relevant from RestrictedUpstreamMap of Switch #1739 (#2039) ### What problem does this PR solve? feat: Delete Answer and Relevant from RestrictedUpstreamMap of Switch #1739 ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- web/src/locales/zh-traditional.ts | 2 +- web/src/locales/zh.ts | 2 +- web/src/pages/flow/constant.tsx | 2 +- web/src/pages/flow/switch-form/index.tsx | 31 ++++++++++++------------ web/src/pages/flow/utils.ts | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts index 5f430c99e..6e27d3b1b 100644 --- a/web/src/locales/zh-traditional.ts +++ b/web/src/locales/zh-traditional.ts @@ -563,7 +563,7 @@ export default { yes: '是', no: '否', key: 'key', - componentId: '組件id', + componentId: '組件ID', add: '新增', operation: '操作', run: '運行', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 53261c235..414e4c1cd 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -582,7 +582,7 @@ export default { yes: '是', no: '否', key: 'key', - componentId: '组件id', + componentId: '组件ID', add: '新增', operation: '操作', run: '运行', diff --git a/web/src/pages/flow/constant.tsx b/web/src/pages/flow/constant.tsx index 7b0e689d6..b2fa7d6ae 100644 --- a/web/src/pages/flow/constant.tsx +++ b/web/src/pages/flow/constant.tsx @@ -471,7 +471,7 @@ export const RestrictedUpstreamMap = { [Operator.BaiduFanyi]: [Operator.Begin, Operator.Retrieval], [Operator.QWeather]: [Operator.Begin, Operator.Retrieval], [Operator.ExeSQL]: [Operator.Begin], - [Operator.Switch]: [Operator.Begin, Operator.Answer, Operator.Relevant], + [Operator.Switch]: [Operator.Begin], }; export const NodeMap = { diff --git a/web/src/pages/flow/switch-form/index.tsx b/web/src/pages/flow/switch-form/index.tsx index 01d1455fa..6f9d11a83 100644 --- a/web/src/pages/flow/switch-form/index.tsx +++ b/web/src/pages/flow/switch-form/index.tsx @@ -1,5 +1,5 @@ import { CloseOutlined } from '@ant-design/icons'; -import { Button, Card, Form, Input, Select, Typography } from 'antd'; +import { Button, Card, Divider, Form, Input, Select, Typography } from 'antd'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { @@ -14,11 +14,11 @@ import { IOperatorForm, ISwitchForm } from '../interface'; import { getOtherFieldValues } from '../utils'; const subLabelCol = { - span: 9, + span: 11, }; const subWrapperCol = { - span: 15, + span: 13, }; const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => { @@ -53,27 +53,21 @@ const SwitchForm = ({ onValuesChange, node, form }: IOperatorForm) => { return (
- - + {() => ( diff --git a/web/src/pages/flow/utils.ts b/web/src/pages/flow/utils.ts index 7943c8525..86b605423 100644 --- a/web/src/pages/flow/utils.ts +++ b/web/src/pages/flow/utils.ts @@ -232,5 +232,5 @@ export const getOtherFieldValues = ( ); export const generateSwitchHandleText = (idx: number) => { - return `Item ${idx + 1}`; + return `Case ${idx + 1}`; };