Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: Update condition items to support variable type acquisition (#22414)
GuanMub803eeb5289b
diff --git a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsxindex ef94f7c82eb..775f232fd06 100644--- a/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx+++ b/web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx@@ -37,6 +37,8 @@ import { VarType } from '@/app/components/workflow/types'import cn from '@/utils/classnames'import { SimpleSelect as Select } from '@/app/components/base/select'import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'+import { getVarType } from '@/app/components/workflow/nodes/_base/components/variable/utils'+import { useIsChatMode } from '@/app/components/workflow/hooks/use-workflow'const optionNameI18NPrefix = 'workflow.nodes.ifElse.optionName'type ConditionItemProps = {@@ -82,7 +84,7 @@ const ConditionItem = ({filterVar,}: ConditionItemProps) => {const { t } = useTranslation()-+ const isChatMode = useIsChatMode()const [isHovered, setIsHovered] = useState(false)const [open, setOpen] = useState(false)@@ -120,6 +122,7 @@ const ConditionItem = ({}, [condition, doUpdateCondition])const isSubVariable = condition.varType === VarType.arrayFile && [ComparisonOperator.contains, ComparisonOperator.notContains, ComparisonOperator.allOf].includes(condition.comparison_operator!)+const fileAttr = useMemo(() => {if (file)return file@@ -194,15 +197,21 @@ const ConditionItem = ({}, [caseId, condition, conditionId, isSubVariableKey, onRemoveCondition, onRemoveSubVariableCondition])const handleVarChange = useCallback((valueSelector: ValueSelector, varItem: Var) => {+ const resolvedVarType = getVarType({+ valueSelector,+ availableNodes,+ isChatMode,+ })+const newCondition = produce(condition, (draft) => {draft.variable_selector = valueSelector- draft.varType = varItem.type+ draft.varType = resolvedVarTypedraft.value = ''- draft.comparison_operator = getOperators(varItem.type)[0]+ draft.comparison_operator = getOperators(resolvedVarType)[0]})doUpdateCondition(newCondition)setOpen(false)- }, [condition, doUpdateCondition])+ }, [condition, doUpdateCondition, availableNodes, isChatMode])return (<div className={cn('mb-1 flex last-of-type:mb-0', className)}>