From 264b95e572a9ffd7177bd12cce3f39b679f2c5c7 Mon Sep 17 00:00:00 2001 From: twwu Date: Fri, 27 Jun 2025 15:23:04 +0800 Subject: [PATCH] feat: separate input fields into datasource and global categories in RAG pipeline --- .../components/input-field/index.tsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/web/app/components/rag-pipeline/components/input-field/index.tsx b/web/app/components/rag-pipeline/components/input-field/index.tsx index 401001d418..b3aa6a2ceb 100644 --- a/web/app/components/rag-pipeline/components/input-field/index.tsx +++ b/web/app/components/rag-pipeline/components/input-field/index.tsx @@ -67,16 +67,27 @@ const InputFieldDialog = ({ const updateInputFields = useCallback(async (key: string, value: InputVar[]) => { inputFieldsMap.current[key] = value - const newRagPipelineVariables: RAGPipelineVariables = [] + const datasourceNodeInputFields: RAGPipelineVariables = [] + const globalInputFields: RAGPipelineVariables = [] Object.keys(inputFieldsMap.current).forEach((key) => { const inputFields = inputFieldsMap.current[key] inputFields.forEach((inputField) => { - newRagPipelineVariables.push({ - ...inputField, - belong_to_node_id: key, - }) + if (key === 'shared') { + globalInputFields.push({ + ...inputField, + belong_to_node_id: key, + }) + } + else { + datasourceNodeInputFields.push({ + ...inputField, + belong_to_node_id: key, + }) + } }) }) + // Datasource node input fields come first, then global input fields + const newRagPipelineVariables = [...datasourceNodeInputFields, ...globalInputFields] setRagPipelineVariables?.(newRagPipelineVariables) handleSyncWorkflowDraft() }, [setRagPipelineVariables, handleSyncWorkflowDraft])