From 5e71f7c8250f6111dfa339e01dea3ec672ade908 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Tue, 10 Jun 2025 15:09:32 +0800 Subject: [PATCH] publish as pipeline --- .../data-source-options/hooks.tsx | 2 +- .../rag-pipeline-header/publisher/popup.tsx | 11 ++++++++++- .../components/workflow/hooks/use-nodes-meta-data.ts | 4 ++-- web/app/components/workflow/hooks/use-tool-icon.ts | 4 ++-- web/service/use-pipeline.ts | 11 +++++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source-options/hooks.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source-options/hooks.tsx index 4ceec18733..7f3a736da8 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source-options/hooks.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source-options/hooks.tsx @@ -24,7 +24,7 @@ export const useDatasourceIcon = (data: DataSourceNodeType) => { useDataSourceList(!!pipelineId, handleUpdateDataSourceList) const datasourceIcon = useMemo(() => { - return dataSourceList?.find(toolWithProvider => toolWithProvider.name === data.provider_id)?.icon + return dataSourceList?.find(toolWithProvider => toolWithProvider.plugin_id === data.plugin_id)?.icon }, [data, dataSourceList]) return datasourceIcon diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx index 3349192087..8b1e38b35c 100644 --- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx +++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx @@ -31,7 +31,10 @@ import { useToastContext } from '@/app/components/base/toast' import { useParams, useRouter } from 'next/navigation' import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail' import { useInvalid } from '@/service/use-base' -import { publishedPipelineInfoQueryKeyPrefix } from '@/service/use-pipeline' +import { + publishedPipelineInfoQueryKeyPrefix, + usePublishAsCustomizedPipeline, +} from '@/service/use-pipeline' import Confirm from '@/app/components/base/confirm' const PUBLISH_SHORTCUT = ['⌘', '⇧', 'P'] @@ -58,6 +61,10 @@ const Popup = () => { setFalse: hidePublishing, setTrue: showPublishing, }] = useBoolean(false) + const { + mutate: publishAsCustomizedPipeline, + isPending: isPublishingAsCustomizedPipeline, + } = usePublishAsCustomizedPipeline() const invalidPublishedPipelineInfo = useInvalid([...publishedPipelineInfoQueryKeyPrefix, pipelineId]) @@ -183,6 +190,8 @@ const Popup = () => {