From 7ff42b1b7a0651892c0d992ab541d6f1ca87ac27 Mon Sep 17 00:00:00 2001 From: yihong Date: Mon, 9 Dec 2024 09:04:11 +0800 Subject: [PATCH 1/9] fix: unit tests env will need clear too (#11445) Signed-off-by: yihong0618 --- api/tests/unit_tests/configs/test_dify_config.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/tests/unit_tests/configs/test_dify_config.py b/api/tests/unit_tests/configs/test_dify_config.py index 0eb310a51a335b..385eb08c3681ff 100644 --- a/api/tests/unit_tests/configs/test_dify_config.py +++ b/api/tests/unit_tests/configs/test_dify_config.py @@ -37,7 +37,11 @@ def test_dify_config_undefined_entry(example_env_file): assert config["LOG_LEVEL"] == "INFO" +# NOTE: If there is a `.env` file in your Workspace, this test might not succeed as expected. +# This is due to `pymilvus` loading all the variables from the `.env` file into `os.environ`. def test_dify_config(example_env_file): + # clear system environment variables + os.environ.clear() # load dotenv file with pydantic-settings config = DifyConfig(_env_file=example_env_file) From 41d90c24082814f05b3aa55b0532785b648988a5 Mon Sep 17 00:00:00 2001 From: Trey Dong <1346650911@qq.com> Date: Mon, 9 Dec 2024 09:10:59 +0800 Subject: [PATCH 2/9] fix(api): throw error when notion block can not find (#11433) --- api/libs/oauth_data_source.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/libs/oauth_data_source.py b/api/libs/oauth_data_source.py index 48249e4a353e10..1d39abd8fa7886 100644 --- a/api/libs/oauth_data_source.py +++ b/api/libs/oauth_data_source.py @@ -253,6 +253,8 @@ def notion_block_parent_page_id(self, access_token: str, block_id: str): } response = requests.get(url=f"{self._NOTION_BLOCK_SEARCH}/{block_id}", headers=headers) response_json = response.json() + if response.status_code != 200: + raise ValueError(f"Error fetching block parent page ID: {response_json.message}") parent = response_json["parent"] parent_type = parent["type"] if parent_type == "block_id": From a594e256aef573518dad9dcf58cd3990179f70b2 Mon Sep 17 00:00:00 2001 From: VoidIsVoid <343750470@qq.com> Date: Mon, 9 Dec 2024 09:33:18 +0800 Subject: [PATCH 3/9] remove mermail render cache (#11470) Co-authored-by: Gimling --- web/app/components/base/mermaid/index.tsx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/web/app/components/base/mermaid/index.tsx b/web/app/components/base/mermaid/index.tsx index 88c5386fb7a664..776abf3dff79c3 100644 --- a/web/app/components/base/mermaid/index.tsx +++ b/web/app/components/base/mermaid/index.tsx @@ -1,7 +1,6 @@ import React, { useCallback, useEffect, useRef, useState } from 'react' import mermaid from 'mermaid' import { usePrevious } from 'ahooks' -import CryptoJS from 'crypto-js' import { useTranslation } from 'react-i18next' import { ExclamationTriangleIcon } from '@heroicons/react/24/outline' import LoadingAnim from '@/app/components/base/chat/chat/loading-anim' @@ -38,7 +37,6 @@ const Flowchart = React.forwardRef((props: { const [svgCode, setSvgCode] = useState(null) const [look, setLook] = useState<'classic' | 'handDrawn'>('classic') - const chartId = useRef(`flowchart_${CryptoJS.MD5(props.PrimitiveCode).toString()}`) const prevPrimitiveCode = usePrevious(props.PrimitiveCode) const [isLoading, setIsLoading] = useState(true) const timeRef = useRef() @@ -51,12 +49,10 @@ const Flowchart = React.forwardRef((props: { try { if (typeof window !== 'undefined' && mermaidAPI) { - const svgGraph = await mermaidAPI.render(chartId.current, PrimitiveCode) + const svgGraph = await mermaidAPI.render('flowchart', PrimitiveCode) const base64Svg: any = await svgToBase64(svgGraph.svg) setSvgCode(base64Svg) setIsLoading(false) - if (chartId.current && base64Svg) - localStorage.setItem(chartId.current, base64Svg) } } catch (error) { @@ -79,19 +75,11 @@ const Flowchart = React.forwardRef((props: { }, }) - localStorage.removeItem(chartId.current) renderFlowchart(props.PrimitiveCode) } }, [look]) useEffect(() => { - const cachedSvg: any = localStorage.getItem(chartId.current) - - if (cachedSvg) { - setSvgCode(cachedSvg) - setIsLoading(false) - return - } if (timeRef.current) clearTimeout(timeRef.current) From c3fae5e8014fdfd37838e5c43888a03c08561722 Mon Sep 17 00:00:00 2001 From: xiandan-erizo Date: Mon, 9 Dec 2024 09:35:52 +0800 Subject: [PATCH 4/9] Update ext_redis.py (#11214) From 6c60ecb2376731115ef56bcb18cdf5ece90ebbd4 Mon Sep 17 00:00:00 2001 From: "Charlie.Wei" Date: Mon, 9 Dec 2024 09:47:58 +0800 Subject: [PATCH 5/9] Refactor: Remove redundant style and simplify Mermaid component (#11472) --- web/app/components/base/mermaid/index.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/web/app/components/base/mermaid/index.tsx b/web/app/components/base/mermaid/index.tsx index 776abf3dff79c3..bcc30ca9393623 100644 --- a/web/app/components/base/mermaid/index.tsx +++ b/web/app/components/base/mermaid/index.tsx @@ -13,12 +13,6 @@ mermaidAPI = null if (typeof window !== 'undefined') mermaidAPI = mermaid.mermaidAPI -const style = { - minWidth: '480px', - height: 'auto', - overflow: 'auto', -} - const svgToBase64 = (svgGraph: string) => { const svgBytes = new TextEncoder().encode(svgGraph) const blob = new Blob([svgBytes], { type: 'image/svg+xml;charset=utf-8' }) @@ -118,8 +112,8 @@ const Flowchart = React.forwardRef((props: { { svgCode - &&
setImagePreviewUrl(svgCode)}> - {svgCode && mermaid_chart} + &&
setImagePreviewUrl(svgCode)}> + {svgCode && mermaid_chart}
} {isLoading From abb1cdde5628964b7d83acbb7cf503cb65dfc674 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Mon, 9 Dec 2024 10:43:06 +0800 Subject: [PATCH 6/9] fix: link --- web/app/components/workflow/hooks/use-workflow-run.ts | 2 +- .../nodes/_base/components/error-handle/default-value.tsx | 7 +++++++ .../_base/components/error-handle/fail-branch-card.tsx | 7 +++++++ web/app/components/workflow/run/node.tsx | 7 +++++++ web/app/components/workflow/run/status.tsx | 7 +++++++ web/i18n/zh-Hans/workflow.ts | 4 ++-- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/hooks/use-workflow-run.ts b/web/app/components/workflow/hooks/use-workflow-run.ts index 37c58ccf7f1e4f..f6a9d24cd336ee 100644 --- a/web/app/components/workflow/hooks/use-workflow-run.ts +++ b/web/app/components/workflow/hooks/use-workflow-run.ts @@ -332,7 +332,7 @@ export const useWorkflowRun = () => { incomeEdges.forEach((edge) => { const incomeNode = nodes.find(node => node.id === edge.source)! if ( - !incomeNode.data._runningBranchId + (!incomeNode.data._runningBranchId && edge.sourceHandle === 'source') || (incomeNode.data._runningBranchId && edge.sourceHandle === incomeNode.data._runningBranchId) ) { edge.data = { diff --git a/web/app/components/workflow/nodes/_base/components/error-handle/default-value.tsx b/web/app/components/workflow/nodes/_base/components/error-handle/default-value.tsx index c5fbf220110216..11045ac7afe58d 100644 --- a/web/app/components/workflow/nodes/_base/components/error-handle/default-value.tsx +++ b/web/app/components/workflow/nodes/_base/components/error-handle/default-value.tsx @@ -32,6 +32,13 @@ const DefaultValue = ({
{t('workflow.nodes.common.errorHandle.defaultValue.desc')} + + {t('workflow.common.learnMore')} +
{ diff --git a/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx b/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx index c0d551181cac57..f4b61538518f51 100644 --- a/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx +++ b/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx @@ -15,6 +15,13 @@ const FailBranchCard = () => {
{t('workflow.nodes.common.errorHandle.failBranch.customizeTip')} + + {t('workflow.common.learnMore')} +
diff --git a/web/app/components/workflow/run/node.tsx b/web/app/components/workflow/run/node.tsx index 5217ded4badb7f..3ed40fb1e05064 100644 --- a/web/app/components/workflow/run/node.tsx +++ b/web/app/components/workflow/run/node.tsx @@ -178,6 +178,13 @@ const NodePanel: FC = ({ {(nodeInfo.status === 'exception') && ( {nodeInfo.error} + + {t('workflow.common.learnMore')} + )} {nodeInfo.status === 'failed' && ( diff --git a/web/app/components/workflow/run/status.tsx b/web/app/components/workflow/run/status.tsx index e46bde0f573730..408e9e600a28b0 100644 --- a/web/app/components/workflow/run/status.tsx +++ b/web/app/components/workflow/run/status.tsx @@ -133,6 +133,13 @@ const StatusPanel: FC = ({
) diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index f42505d93ee06f..8e1d49308ca9c3 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -312,8 +312,8 @@ const translation = { }, defaultValue: { title: '默认值', - desc: '当发生异常时,指定默认输出内容', - tip: '当发生异常时,将返回以下值', + desc: '当发生异常时,指定默认输出内容。', + tip: '当发生异常时,将返回以下值。', inLog: '节点异常,根据默认值输出。', output: '输出默认值', }, From 32f8a98cf8af5746efef0a4c8a9de16ce019dac3 Mon Sep 17 00:00:00 2001 From: Yi Xiao <54782454+YIXIAO0@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:06:47 +0800 Subject: [PATCH 7/9] feat: ifelse condition variable editable after selection (#11431) --- .../nodes/_base/components/variable-tag.tsx | 2 +- .../variable/var-reference-vars.tsx | 2 +- .../condition-list/condition-item.tsx | 23 +++++++- .../condition-list/condition-var-selector.tsx | 58 +++++++++++++++++++ .../if-else/components/condition-value.tsx | 2 +- 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx diff --git a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx index 6e1b1ed1437c5d..fc8c1ce9c9a1c6 100644 --- a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx @@ -72,7 +72,7 @@ const VariableTag = ({ {isEnv && } {isChatVar && }
{variableName} diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx index 9c2cba6e4113b7..eb28279c0c1cf8 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx @@ -274,7 +274,7 @@ const VarReferenceVars: FC = ({ { !hideSearch && ( <> -
e.stopPropagation()}> +
e.stopPropagation()}> { if (isSubVariableKey) @@ -190,6 +193,17 @@ const ConditionItem = ({ onRemoveCondition?.(caseId, condition.id) }, [caseId, condition, conditionId, isSubVariableKey, onRemoveCondition, onRemoveSubVariableCondition]) + const handleVarChange = useCallback((valueSelector: ValueSelector, varItem: Var) => { + const newCondition = produce(condition, (draft) => { + draft.variable_selector = valueSelector + draft.varType = varItem.type + draft.value = '' + draft.comparison_operator = getOperators(varItem.type)[0] + }) + doUpdateCondition(newCondition) + setOpen(false) + }, [condition, doUpdateCondition]) + return (
) : ( - )} diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx new file mode 100644 index 00000000000000..68a012d1a0a3c0 --- /dev/null +++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-var-selector.tsx @@ -0,0 +1,58 @@ +import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger } from '@/app/components/base/portal-to-follow-elem' +import VariableTag from '@/app/components/workflow/nodes/_base/components/variable-tag' +import VarReferenceVars from '@/app/components/workflow/nodes/_base/components/variable/var-reference-vars' +import type { Node, NodeOutPutVar, ValueSelector, Var, VarType } from '@/app/components/workflow/types' + +type ConditionVarSelectorProps = { + open: boolean + onOpenChange: (open: boolean) => void + valueSelector: ValueSelector + varType: VarType + availableNodes: Node[] + nodesOutputVars: NodeOutPutVar[] + onChange: (valueSelector: ValueSelector, varItem: Var) => void +} + +const ConditionVarSelector = ({ + open, + onOpenChange, + valueSelector, + varType, + availableNodes, + nodesOutputVars, + onChange, +}: ConditionVarSelectorProps) => { + return ( + + onOpenChange(!open)}> +
+ +
+
+ +
+ +
+
+
+ ) +} + +export default ConditionVarSelector diff --git a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx index 182e38f71ed412..792064e6ed4f74 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx @@ -73,7 +73,7 @@ const ConditionValue = ({
Date: Mon, 9 Dec 2024 11:12:10 +0800 Subject: [PATCH 8/9] fix: exception variable color --- .../plugins/workflow-variable-block/component.tsx | 6 ++++-- .../_base/components/variable/var-reference-picker.tsx | 9 ++++++--- .../variable-assigner/components/node-group-item.tsx | 3 +++ .../variable-assigner/components/node-variable-item.tsx | 8 +++++--- web/app/components/workflow/utils.ts | 9 ++++++++- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx index 65f3dad3a21f6e..0073ac300b7a90 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx @@ -26,6 +26,7 @@ import { VarBlockIcon } from '@/app/components/workflow/block-icon' import { Line3 } from '@/app/components/base/icons/src/public/common' import { isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' import Tooltip from '@/app/components/base/tooltip' +import { isExceptionVariable } from '@/app/components/workflow/utils' type WorkflowVariableBlockComponentProps = { nodeKey: string @@ -53,6 +54,7 @@ const WorkflowVariableBlockComponent = ({ const node = localWorkflowNodesMap![variables[0]] const isEnv = isENV(variables) const isChatVar = isConversationVar(variables) + const isException = isExceptionVariable(varName, node?.type) useEffect(() => { if (!editor.hasNodes([WorkflowVariableBlockNode])) @@ -98,10 +100,10 @@ const WorkflowVariableBlockComponent = ({
)}
- {!isEnv && !isChatVar && } + {!isEnv && !isChatVar && } {isEnv && } {isChatVar && } -
{varName}
+
{varName}
{ !node && !isEnv && !isChatVar && ( diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx index e4d354a615fe9a..3a4cece35c9863 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx @@ -36,6 +36,7 @@ import TypeSelector from '@/app/components/workflow/nodes/_base/components/selec import AddButton from '@/app/components/base/button/add-button' import Badge from '@/app/components/base/badge' import Tooltip from '@/app/components/base/tooltip' +import { isExceptionVariable } from '@/app/components/workflow/utils' const TRIGGER_DEFAULT_WIDTH = 227 @@ -224,16 +225,18 @@ const VarReferencePicker: FC = ({ isConstant: !!isConstant, }) - const { isEnv, isChatVar, isValidVar } = useMemo(() => { + const { isEnv, isChatVar, isValidVar, isException } = useMemo(() => { const isEnv = isENV(value as ValueSelector) const isChatVar = isConversationVar(value as ValueSelector) const isValidVar = Boolean(outputVarNode) || isEnv || isChatVar + const isException = isExceptionVariable(varName, outputVarNode?.type) return { isEnv, isChatVar, isValidVar, + isException, } - }, [value, outputVarNode]) + }, [value, outputVarNode, varName]) // 8(left/right-padding) + 14(icon) + 4 + 14 + 2 = 42 + 17 buff const availableWidth = triggerWidth - 56 @@ -335,7 +338,7 @@ const VarReferencePicker: FC = ({ {!hasValue && } {isEnv && } {isChatVar && } -
{varName}
diff --git a/web/app/components/workflow/nodes/variable-assigner/components/node-group-item.tsx b/web/app/components/workflow/nodes/variable-assigner/components/node-group-item.tsx index e0c15e396bbd3c..a58acb5e921b9a 100644 --- a/web/app/components/workflow/nodes/variable-assigner/components/node-group-item.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/components/node-group-item.tsx @@ -21,6 +21,7 @@ import AddVariable from './add-variable' import NodeVariableItem from './node-variable-item' import { isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' import cn from '@/utils/classnames' +import { isExceptionVariable } from '@/app/components/workflow/utils' const i18nPrefix = 'workflow.nodes.variableAssigner' type GroupItem = { @@ -128,12 +129,14 @@ const NodeGroupItem = ({ const node = isSystem ? nodes.find(node => node.data.type === BlockEnum.Start) : nodes.find(node => node.id === variable[0]) const varName = isSystem ? `sys.${variable[variable.length - 1]}` : variable.slice(1).join('.') + const isException = isExceptionVariable(varName, node?.data.type) return ( { const { t } = useTranslation() return ( @@ -50,14 +52,14 @@ const NodeVariableItem = ({
)}
- {!isEnv && !isChatVar && } + {!isEnv && !isChatVar && } {isEnv && } - {!isChatVar &&
{varName}
} + {!isChatVar &&
{varName}
} {isChatVar &&
-
{varName}
+
{varName}
{writeMode && }
diff --git a/web/app/components/workflow/utils.ts b/web/app/components/workflow/utils.ts index e1dea4f9bd9bdd..f5c112d6e8ef7f 100644 --- a/web/app/components/workflow/utils.ts +++ b/web/app/components/workflow/utils.ts @@ -766,7 +766,7 @@ export const getParallelInfo = (nodes: Node[], edges: Edge[], parentNodeId?: str } } -export const hasErrorHandleNode = (nodeType: BlockEnum) => { +export const hasErrorHandleNode = (nodeType?: BlockEnum) => { return nodeType === BlockEnum.LLM || nodeType === BlockEnum.Tool || nodeType === BlockEnum.HttpRequest || nodeType === BlockEnum.Code } @@ -789,3 +789,10 @@ export const getEdgeColor = (nodeRunningStatus?: NodeRunningStatus, isFailBranch return 'var(--color-workflow-link-line-normal)' } + +export const isExceptionVariable = (variable: string, nodeType?: BlockEnum) => { + if ((variable === 'error_message' || variable === 'error_type') && hasErrorHandleNode(nodeType)) + return true + + return false +} From ec9f82ce898a0f4d66d365b5b1835ea9a014e326 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Mon, 9 Dec 2024 11:34:38 +0800 Subject: [PATCH 9/9] fix: exception variable color --- .../workflow/nodes/_base/components/variable-tag.tsx | 6 ++++-- .../nodes/if-else/components/condition-value.tsx | 12 +++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx index fc8c1ce9c9a1c6..0c5c3bde4bf171 100644 --- a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx @@ -17,6 +17,7 @@ import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others import { getNodeInfoById, isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' import Tooltip from '@/app/components/base/tooltip' import cn from '@/utils/classnames' +import { isExceptionVariable } from '@/app/components/workflow/utils' type VariableTagProps = { valueSelector: ValueSelector @@ -45,6 +46,7 @@ const VariableTag = ({ const isValid = Boolean(node) || isEnv || isChatVar const variableName = isSystemVar(valueSelector) ? valueSelector.slice(0).join('.') : valueSelector.slice(1).join('.') + const isException = isExceptionVariable(variableName, node?.data.type) const { t } = useTranslation() return ( @@ -67,12 +69,12 @@ const VariableTag = ({ )} - + )} {isEnv && } {isChatVar && }
{variableName} diff --git a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx index 792064e6ed4f74..e997c2cbd2df51 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-value.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-value.tsx @@ -3,6 +3,7 @@ import { useMemo, } from 'react' import { useTranslation } from 'react-i18next' +import { useNodes } from 'reactflow' import { ComparisonOperator } from '../types' import { comparisonOperatorNotRequireValue, @@ -13,6 +14,11 @@ import { Variable02 } from '@/app/components/base/icons/src/vender/solid/develop import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others' import cn from '@/utils/classnames' import { isConversationVar, isENV, isSystemVar } from '@/app/components/workflow/nodes/_base/components/variable/utils' +import { isExceptionVariable } from '@/app/components/workflow/utils' +import type { + CommonNodeType, + Node, +} from '@/app/components/workflow/types' type ConditionValueProps = { variableSelector: string[] @@ -27,11 +33,14 @@ const ConditionValue = ({ value, }: ConditionValueProps) => { const { t } = useTranslation() + const nodes = useNodes() const variableName = labelName || (isSystemVar(variableSelector) ? variableSelector.slice(0).join('.') : variableSelector.slice(1).join('.')) const operatorName = isComparisonOperatorNeedTranslate(operator) ? t(`workflow.nodes.ifElse.comparisonOperator.${operator}`) : operator const notHasValue = comparisonOperatorNotRequireValue(operator) const isEnvVar = isENV(variableSelector) const isChatVar = isConversationVar(variableSelector) + const node: Node | undefined = nodes.find(n => n.id === variableSelector[0]) as Node + const isException = isExceptionVariable(variableName, node?.data.type) const formatValue = useMemo(() => { if (notHasValue) return '' @@ -67,7 +76,7 @@ const ConditionValue = ({ return (
- {!isEnvVar && !isChatVar && } + {!isEnvVar && !isChatVar && } {isEnvVar && } {isChatVar && } @@ -75,6 +84,7 @@ const ConditionValue = ({ className={cn( 'shrink-0 ml-0.5 truncate text-xs font-medium text-text-accent', !notHasValue && 'max-w-[70px]', + isException && 'text-text-warning', )} title={variableName} >