From 590c14c9777e83102d74b1c05930684a04628d00 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 28 Jul 2025 16:02:50 +0800 Subject: [PATCH] chore: conveersion pass boolean string boolean --- .../loop/components/loop-variables/form-item.tsx | 12 +++++++++++- .../components/array-bool-list.tsx | 11 +++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/web/app/components/workflow/nodes/loop/components/loop-variables/form-item.tsx b/web/app/components/workflow/nodes/loop/components/loop-variables/form-item.tsx index 6a66c242ba..52e1e93c55 100644 --- a/web/app/components/workflow/nodes/loop/components/loop-variables/form-item.tsx +++ b/web/app/components/workflow/nodes/loop/components/loop-variables/form-item.tsx @@ -27,6 +27,7 @@ import { arrayStringPlaceholder, objectPlaceholder, } from '@/app/components/workflow/panel/chat-variable-panel/utils' +import ArrayBoolList from '@/app/components/workflow/panel/chat-variable-panel/components/array-bool-list' type FormItemProps = { nodeId: string @@ -114,7 +115,7 @@ const FormItem = ({ } { value_type === ValueType.constant - && (var_type === VarType.object || var_type === VarType.arrayString || var_type === VarType.arrayNumber || var_type === VarType.arrayObject || var_type === VarType.arrayBoolean) + && (var_type === VarType.object || var_type === VarType.arrayString || var_type === VarType.arrayNumber || var_type === VarType.arrayObject) && (
) } + { + value_type === ValueType.constant && var_type === VarType.arrayBoolean && ( + + ) + }
) } diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx index 460b86d51c..c6c1cfaf37 100644 --- a/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx +++ b/web/app/components/workflow/panel/chat-variable-panel/components/array-bool-list.tsx @@ -7,20 +7,23 @@ import produce from 'immer' import RemoveButton from '@/app/components/workflow/nodes/_base/components/remove-button' import Button from '@/app/components/base/button' import BoolValue from './bool-value' +import cn from '@/utils/classnames' type Props = { + className?: string list: any[] - onChange: (list: any[]) => void + onChange: (list: string[]) => void } const ArrayValueList: FC = ({ + className, list, onChange, }) => { const { t } = useTranslation() const handleChange = useCallback((index: number) => { - return (value: boolean) => { + return (value: string) => { const newList = produce(list, (draft: any[]) => { draft[index] = value }) @@ -39,13 +42,13 @@ const ArrayValueList: FC = ({ const handleItemAdd = useCallback(() => { const newList = produce(list, (draft: any[]) => { - draft.push(true) + draft.push('false') }) onChange(newList) }, [list, onChange]) return ( -
+
{list.map((item, index) => (