From 11576932c91f69dde4713335e0eae4470836cc88 Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 16 Sep 2025 15:57:38 +0800 Subject: [PATCH 1/5] feat: Add original_document_id to pipeline settings and update API key mutation paths --- .../documents/detail/settings/pipeline-settings/index.tsx | 1 + web/models/pipeline.ts | 1 + web/service/knowledge/use-dataset.ts | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/app/components/datasets/documents/detail/settings/pipeline-settings/index.tsx b/web/app/components/datasets/documents/detail/settings/pipeline-settings/index.tsx index b13e7743b0..e69481c3ea 100644 --- a/web/app/components/datasets/documents/detail/settings/pipeline-settings/index.tsx +++ b/web/app/components/datasets/documents/detail/settings/pipeline-settings/index.tsx @@ -126,6 +126,7 @@ const PipelineSettings = ({ start_node_id: lastRunData.datasource_node_id, datasource_type: lastRunData.datasource_type, datasource_info_list: datasourceInfoList, + original_document_id: documentId, is_preview: false, }, { onSuccess: () => { diff --git a/web/models/pipeline.ts b/web/models/pipeline.ts index c1a9b42462..d644d43bf3 100644 --- a/web/models/pipeline.ts +++ b/web/models/pipeline.ts @@ -203,6 +203,7 @@ export type PublishedPipelineRunRequest = { start_node_id: string datasource_type: DatasourceType datasource_info_list: Array> + original_document_id?: string is_preview: boolean } diff --git a/web/service/knowledge/use-dataset.ts b/web/service/knowledge/use-dataset.ts index d572631c60..0caea05f6b 100644 --- a/web/service/knowledge/use-dataset.ts +++ b/web/service/knowledge/use-dataset.ts @@ -87,13 +87,13 @@ export const useDatasetApiBaseUrl = () => { export const useEnableDatasetServiceApi = () => { return useMutation({ mutationKey: [NAME_SPACE, 'enable-api'], - mutationFn: (datasetId: string) => post(`/datasets/${datasetId}/enable`), + mutationFn: (datasetId: string) => post(`/datasets/${datasetId}/api-keys/enable`), }) } export const useDisableDatasetServiceApi = () => { return useMutation({ mutationKey: [NAME_SPACE, 'disable-api'], - mutationFn: (datasetId: string) => post(`/datasets/${datasetId}/disable`), + mutationFn: (datasetId: string) => post(`/datasets/${datasetId}/api-keys/disable`), }) } From 5691ceb0baa75058a0a3db402beac9183faf96c5 Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 16 Sep 2025 16:11:56 +0800 Subject: [PATCH 2/5] fix: Correct isMobile prop logic in LinkedAppsPanel and clean up component styles --- web/app/components/base/linked-apps-panel/index.tsx | 2 +- web/app/components/datasets/extra-info/statistics.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/base/linked-apps-panel/index.tsx b/web/app/components/base/linked-apps-panel/index.tsx index 0655c0a5fd..c3c3f5b46c 100644 --- a/web/app/components/base/linked-apps-panel/index.tsx +++ b/web/app/components/base/linked-apps-panel/index.tsx @@ -49,7 +49,7 @@ const LinkedAppsPanel: FC = ({ isMobile, }) => { return ( -
+
{relatedApps.map((item, index) => ( ))} diff --git a/web/app/components/datasets/extra-info/statistics.tsx b/web/app/components/datasets/extra-info/statistics.tsx index 0671958d67..a5f8c4f9e5 100644 --- a/web/app/components/datasets/extra-info/statistics.tsx +++ b/web/app/components/datasets/extra-info/statistics.tsx @@ -48,7 +48,7 @@ const Statistics = ({ hasRelatedApps ? ( ) : } From 6c7c465b173d790c1ddd577c70c7bb1f07903600 Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 16 Sep 2025 16:17:23 +0800 Subject: [PATCH 3/5] fix: Update reopening logic for chunk details in Drawer component --- .../datasets/documents/detail/completed/common/drawer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/datasets/documents/detail/completed/common/drawer.tsx b/web/app/components/datasets/documents/detail/completed/common/drawer.tsx index 806eff01f6..70cc2c27d7 100644 --- a/web/app/components/datasets/documents/detail/completed/common/drawer.tsx +++ b/web/app/components/datasets/documents/detail/completed/common/drawer.tsx @@ -49,7 +49,7 @@ const Drawer = ({ return chunk && chunk.contains(target) }) const reopenChunkDetail = (currSegment.showModal && isClickOnChildChunk) - || (currChildChunk.showModal && isClickOnChunk && !isClickOnChildChunk) + || (currChildChunk.showModal && isClickOnChunk && !isClickOnChildChunk) || (!isClickOnChunk && !isClickOnChildChunk) return target && !panelContent.contains(target) && (!needCheckChunks || reopenChunkDetail) }, [currSegment, currChildChunk, needCheckChunks]) From 3797d53c78acc73309255a60812a6ffe80ffac5c Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 16 Sep 2025 16:42:15 +0800 Subject: [PATCH 4/5] fix: Update type handling in ToolNodeType to ensure proper formatting for unknown types --- web/app/components/workflow/nodes/tool/default.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/tool/default.ts b/web/app/components/workflow/nodes/tool/default.ts index 51946bf374..0ffd7b1883 100644 --- a/web/app/components/workflow/nodes/tool/default.ts +++ b/web/app/components/workflow/nodes/tool/default.ts @@ -99,8 +99,8 @@ const nodeDefault: NodeDefault = { const dataType = output.type const schemaType = getMatchedSchemaType(output, schemaTypeDefinitions) let type = dataType === 'array' - ? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]` - : `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}` + ? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleLowerCase() + output.items.type.slice(1) : 'Unknown'}]` + : `${output.type ? output.type.slice(0, 1).toLocaleLowerCase() + output.type.slice(1) : 'Unknown'}` if (type === VarType.object && schemaType === 'file') type = VarType.file From 73007362b39079afdea400414692c29908ef93c5 Mon Sep 17 00:00:00 2001 From: twwu Date: Tue, 16 Sep 2025 18:21:08 +0800 Subject: [PATCH 5/5] fix: Remove customContainer prop from PortalToFollowElem and adjust padding in dropdown component --- .../app-sidebar/dataset-info/dropdown.tsx | 1 - .../base/portal-to-follow-elem/index.tsx | 16 ++-------------- .../datasets/extra-info/service-api/index.tsx | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/web/app/components/app-sidebar/dataset-info/dropdown.tsx b/web/app/components/app-sidebar/dataset-info/dropdown.tsx index 94118f04e3..ff110f70bd 100644 --- a/web/app/components/app-sidebar/dataset-info/dropdown.tsx +++ b/web/app/components/app-sidebar/dataset-info/dropdown.tsx @@ -114,7 +114,6 @@ const DropDown = ({ } : { mainAxis: 4, }} - customContainer={document.body} > diff --git a/web/app/components/base/portal-to-follow-elem/index.tsx b/web/app/components/base/portal-to-follow-elem/index.tsx index 430c49f4ba..55891bd8d2 100644 --- a/web/app/components/base/portal-to-follow-elem/index.tsx +++ b/web/app/components/base/portal-to-follow-elem/index.tsx @@ -4,7 +4,6 @@ import { FloatingPortal, autoUpdate, flip, - hide, offset, shift, size, @@ -31,7 +30,6 @@ export type PortalToFollowElemOptions = { offset?: number | OffsetOptions onOpenChange?: (open: boolean) => void triggerPopupSameWidth?: boolean - customContainer?: HTMLElement | null } export function usePortalToFollowElem({ @@ -40,9 +38,7 @@ export function usePortalToFollowElem({ offset: offsetValue = 0, onOpenChange: setControlledOpen, triggerPopupSameWidth, - customContainer = null, }: PortalToFollowElemOptions = {}) { - const container = customContainer || document.getElementById('workflow-container') || document.body const [localOpen, setLocalOpen] = useState(false) const open = controlledOpen ?? localOpen const handleOpenChange = useCallback((newOpen: boolean) => { @@ -60,17 +56,9 @@ export function usePortalToFollowElem({ flip({ crossAxis: placement.includes('-'), fallbackAxisSideDirection: 'start', - padding: 8, - }), - shift({ - padding: 8, - boundary: container, - altBoundary: true, - }), - hide({ - // hide when the reference element is not visible - boundary: container, + padding: 5, }), + shift({ padding: 5 }), size({ apply({ rects, elements }) { if (triggerPopupSameWidth) diff --git a/web/app/components/datasets/extra-info/service-api/index.tsx b/web/app/components/datasets/extra-info/service-api/index.tsx index 3daa58a021..b1843682ee 100644 --- a/web/app/components/datasets/extra-info/service-api/index.tsx +++ b/web/app/components/datasets/extra-info/service-api/index.tsx @@ -34,7 +34,6 @@ const ServiceApi = ({ mainAxis: 4, crossAxis: -4, }} - customContainer={document.body} >