-
-
+
+
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/hooks.ts b/web/app/components/rag-pipeline/components/panel/test-run/preparation/hooks.ts
index 64f05c0cd5..3f2f49f455 100644
--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/hooks.ts
+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/hooks.ts
@@ -110,13 +110,13 @@ export const useOnlineDrive = () => {
const clearOnlineDriveData = useCallback(() => {
const {
- setFileList,
+ setOnlineDriveFileList,
setBucket,
setPrefix,
setKeywords,
setSelectedFileIds,
} = dataSourceStore.getState()
- setFileList([])
+ setOnlineDriveFileList([])
setBucket('')
setPrefix([])
setKeywords('')
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
index b4dc32c122..0f869c2621 100644
--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
@@ -104,8 +104,8 @@ const Preparation = () => {
})
}
if (datasourceType === DatasourceType.onlineDrive) {
- const { bucket, fileList, selectedFileIds } = dataSourceStore.getState()
- const file = fileList.find(file => file.id === selectedFileIds[0])
+ const { bucket, onlineDriveFileList, selectedFileIds } = dataSourceStore.getState()
+ const file = onlineDriveFileList.find(file => file.id === selectedFileIds[0])
datasourceInfoList.push({
bucket,
id: file?.id,
diff --git a/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts b/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts
index 11031b0a56..4ed8cb95c7 100644
--- a/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts
+++ b/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts
@@ -287,10 +287,9 @@ export const usePipelineRun = () => {
)
const handleStopRun = useCallback((taskId: string) => {
- const { pipelineId, setShowDebugAndPreviewPanel } = workflowStore.getState()
+ const { pipelineId } = workflowStore.getState()
stopWorkflowRun(`/rag/pipeline/${pipelineId}/workflow-runs/tasks/${taskId}/stop`)
- setShowDebugAndPreviewPanel(false)
}, [workflowStore])
const handleRestoreFromPublishedWorkflow = useCallback((publishedWorkflow: VersionHistory) => {
diff --git a/web/app/components/workflow/hooks/use-workflow-variables.ts b/web/app/components/workflow/hooks/use-workflow-variables.ts
index d5eebfde77..b42a41bab5 100644
--- a/web/app/components/workflow/hooks/use-workflow-variables.ts
+++ b/web/app/components/workflow/hooks/use-workflow-variables.ts
@@ -10,6 +10,7 @@ import type {
} from '@/app/components/workflow/types'
import { useIsChatMode } from './use-workflow'
import { useStoreApi } from 'reactflow'
+import { useStore } from '@/app/components/workflow/store'
import type { Type } from '../nodes/llm/types'
import useMatchSchemaType from '../nodes/_base/components/variable/use-match-schema-type'
@@ -18,6 +19,11 @@ export const useWorkflowVariables = () => {
const workflowStore = useWorkflowStore()
const { getMatchedSchemaType } = useMatchSchemaType()
+ const buildInTools = useStore(s => s.buildInTools)
+ const customTools = useStore(s => s.customTools)
+ const workflowTools = useStore(s => s.workflowTools)
+ const mcpTools = useStore(s => s.mcpTools)
+ const dataSourceList = useStore(s => s.dataSourceList)
const getNodeAvailableVars = useCallback(({
parentNode,
beforeNodes,
@@ -37,11 +43,6 @@ export const useWorkflowVariables = () => {
conversationVariables,
environmentVariables,
ragPipelineVariables,
- buildInTools,
- customTools,
- workflowTools,
- mcpTools,
- dataSourceList,
} = workflowStore.getState()
return toNodeAvailableVars({
parentNode,
@@ -61,7 +62,7 @@ export const useWorkflowVariables = () => {
},
getMatchedSchemaType,
})
- }, [t, workflowStore, getMatchedSchemaType])
+ }, [t, workflowStore, getMatchedSchemaType, buildInTools])
const getCurrentVariableType = useCallback(({
parentNode,
@@ -71,6 +72,7 @@ export const useWorkflowVariables = () => {
availableNodes,
isChatMode,
isConstant,
+ preferSchemaType,
}: {
valueSelector: ValueSelector
parentNode?: Node | null
@@ -79,6 +81,7 @@ export const useWorkflowVariables = () => {
availableNodes: any[]
isChatMode: boolean
isConstant?: boolean
+ preferSchemaType?: boolean
}) => {
const {
conversationVariables,
@@ -109,8 +112,9 @@ export const useWorkflowVariables = () => {
dataSourceList: dataSourceList ?? [],
},
getMatchedSchemaType,
+ preferSchemaType,
})
- }, [workflowStore])
+ }, [workflowStore, getVarType, getMatchedSchemaType])
return {
getNodeAvailableVars,
diff --git a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
index a7a3a89676..663ed074e8 100644
--- a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
+++ b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
@@ -27,6 +27,7 @@ export const AddVariablePopup = ({
hideSearch
vars={availableVars}
onChange={onSelect}
+ isSupportFileVar
/>