From 6012ad57ac0f8ef4aa03fc26d7d9b4dc6ebcbd5d Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 24 Jul 2025 14:35:41 +0800 Subject: [PATCH] feat: code support boolean --- web/app/components/app/configuration/index.tsx | 5 ++--- .../nodes/_base/components/variable/var-type-picker.tsx | 2 +- web/app/components/workflow/nodes/code/use-config.ts | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsx index 02f1928eca..a7041d4a9e 100644 --- a/web/app/components/app/configuration/index.tsx +++ b/web/app/components/app/configuration/index.tsx @@ -60,7 +60,6 @@ import { useModelListAndDefaultModelAndCurrentProviderAndModel, useTextGenerationCurrentProviderAndModelAndModelList, } from '@/app/components/header/account-setting/model-provider-page/hooks' -import { fetchCollectionList } from '@/service/tools' import type { Collection } from '@/app/components/tools/types' import { useStore as useAppStore } from '@/app/components/app/store' import { @@ -521,7 +520,8 @@ const Configuration: FC = () => { useEffect(() => { (async () => { - const collectionList = await fetchCollectionList() + // const collectionList = await fetchCollectionList() + const collectionList: any[] = [] // this api has problem in dev, so comment it for temporarily if (basePath) { collectionList.forEach((item) => { if (typeof item.icon == 'string' && !item.icon.includes(basePath)) @@ -693,7 +693,6 @@ const Configuration: FC = () => { setHasFetchedDetail(true) }) })() - // eslint-disable-next-line react-hooks/exhaustive-deps }, [appId]) const promptEmpty = (() => { diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx index d0e42d5e47..f394fa96b8 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx @@ -18,7 +18,7 @@ type Props = { onChange: (value: string) => void } -const TYPES = [VarType.string, VarType.number, VarType.arrayNumber, VarType.arrayString, VarType.arrayObject, VarType.object] +const TYPES = [VarType.string, VarType.number, VarType.boolean, VarType.arrayNumber, VarType.arrayString, VarType.arrayBoolean, VarType.arrayObject, VarType.object] const VarReferencePicker: FC = ({ readonly, className, diff --git a/web/app/components/workflow/nodes/code/use-config.ts b/web/app/components/workflow/nodes/code/use-config.ts index 9b0c14e529..49147a5dc5 100644 --- a/web/app/components/workflow/nodes/code/use-config.ts +++ b/web/app/components/workflow/nodes/code/use-config.ts @@ -60,7 +60,6 @@ const useConfig = (id: string, payload: CodeNodeType) => { }) syncOutputKeyOrders(defaultConfig.outputs) } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [defaultConfig]) const handleCodeChange = useCallback((code: string) => { @@ -85,7 +84,7 @@ const useConfig = (id: string, payload: CodeNodeType) => { }, [allLanguageDefault, inputs, setInputs]) const handleSyncFunctionSignature = useCallback(() => { - const generateSyncSignatureCode = (code: string) => { + const generateSyncSignatureCode = (code: string) => { let mainDefRe let newMainDef if (inputs.code_language === CodeLanguage.javascript) { @@ -159,7 +158,7 @@ const useConfig = (id: string, payload: CodeNodeType) => { }) const filterVar = useCallback((varPayload: Var) => { - return [VarType.string, VarType.number, VarType.secret, VarType.object, VarType.array, VarType.arrayNumber, VarType.arrayString, VarType.arrayObject, VarType.file, VarType.arrayFile].includes(varPayload.type) + return [VarType.string, VarType.number, VarType.boolean, VarType.secret, VarType.object, VarType.array, VarType.arrayNumber, VarType.arrayString, VarType.arrayObject, VarType.arrayBoolean, VarType.file, VarType.arrayFile].includes(varPayload.type) }, []) const handleCodeAndVarsChange = useCallback((code: string, inputVariables: Variable[], outputVariables: OutputVar) => {