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 e493b7b6b9..42eb8b99f5 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 @@ -350,7 +350,7 @@ const VarReferencePicker: FC = ({ const data = await fetchDynamicOptions() setDynamicOptions(data?.options || []) } - finally { + finally { setIsLoading(false) } } diff --git a/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts b/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts index 9f974e13f3..3e845ecdbf 100644 --- a/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts +++ b/web/app/components/workflow/nodes/_base/hooks/use-available-var-list.ts @@ -25,9 +25,9 @@ const useAvailableVarList = (nodeId: string, { hideChatVar, passedInAvailableNodes, }: Params = { - onlyLeafNodeVar: false, - filterVar: () => true, -}) => { + onlyLeafNodeVar: false, + filterVar: () => true, + }) => { const { getTreeLeafNodes, getNodeById, getBeforeNodesInSameBranchIncludeParent } = useWorkflow() const { getNodeAvailableVars } = useWorkflowVariables() const isChatMode = useIsChatMode() @@ -40,7 +40,7 @@ const useAvailableVarList = (nodeId: string, { const ragPipelineVariables = useWorkflowStore(s => s.ragPipelineVariables) const isDataSourceNode = currNode?.data?.type === BlockEnum.DataSource const dataSourceRagVars: NodeOutPutVar[] = [] - if(isDataSourceNode) { + if (isDataSourceNode) { const ragVariablesInDataSource = ragPipelineVariables?.filter(ragVariable => ragVariable.belong_to_node_id === nodeId) const filterVars = ragVariablesInDataSource?.filter(v => filterVar({ variable: v.variable, @@ -48,18 +48,18 @@ const useAvailableVarList = (nodeId: string, { nodeId, isRagVariable: true, }, ['rag', nodeId, v.variable])) - if(filterVars?.length) { + if (filterVars?.length) { dataSourceRagVars.push({ - nodeId, - title: currNode.data?.title, - vars: filterVars.map((v) => { - return { - variable: `rag.${nodeId}.${v.variable}`, - type: inputVarTypeToVarType(v.type), - description: v.label, - isRagVariable: true, + nodeId, + title: currNode.data?.title, + vars: filterVars.map((v) => { + return { + variable: `rag.${nodeId}.${v.variable}`, + type: inputVarTypeToVarType(v.type), + description: v.label, + isRagVariable: true, } as Var - }), + }), }) } } diff --git a/web/app/components/workflow/nodes/data-source/utils.ts b/web/app/components/workflow/nodes/data-source/utils.ts index 4240d6f464..fbda69f3fd 100644 --- a/web/app/components/workflow/nodes/data-source/utils.ts +++ b/web/app/components/workflow/nodes/data-source/utils.ts @@ -6,5 +6,6 @@ export const inputVarTypeToVarType = (type: PipelineInputVarType): VarType => { [PipelineInputVarType.number]: VarType.number, [PipelineInputVarType.singleFile]: VarType.file, [PipelineInputVarType.multiFiles]: VarType.arrayFile, + [PipelineInputVarType.checkbox]: VarType.boolean, } as any)[type] || VarType.string }