From 5193fa211883f62a3b5a5bd8ff9735d2000c683a Mon Sep 17 00:00:00 2001 From: twwu Date: Fri, 6 Jun 2025 11:43:00 +0800 Subject: [PATCH] fix: update condition for handling datasource selection in DataSourceOptions --- .../create-from-pipeline/data-source-options/index.tsx | 2 +- .../components/panel/test-run/data-source-options/index.tsx | 2 +- .../panel/test-run/data-source/local-file/file-uploader.tsx | 2 +- .../panel/test-run/data-source/website-crawl/base/crawler.tsx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source-options/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source-options/index.tsx index b56e393fca..d0a410f5e0 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source-options/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source-options/index.tsx @@ -26,7 +26,7 @@ const DataSourceOptions = ({ }, [datasources, onSelect]) useEffect(() => { - if (options.length > 0) + if (options.length > 0 && !datasourceNodeId) handelSelect(options[0].value) // eslint-disable-next-line react-hooks/exhaustive-deps }, []) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source-options/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source-options/index.tsx index afbba09594..f9a0b4c9b8 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source-options/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source-options/index.tsx @@ -22,7 +22,7 @@ const DataSourceOptions = ({ }, [datasources, onSelect]) useEffect(() => { - if (options.length > 0) + if (options.length > 0 && !dataSourceNodeId) handelSelect(options[0].value) // eslint-disable-next-line react-hooks/exhaustive-deps }, []) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/file-uploader.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/file-uploader.tsx index a8568266c4..125ba15983 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/file-uploader.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/file-uploader.tsx @@ -242,7 +242,7 @@ const FileUploader = ({ }, [handleDrop]) return ( -
+
{!hideUpload && ( +
{!isInit && ( -
+
{isRunning && (