diff --git a/web/app/components/workflow/nodes/data-source/default.ts b/web/app/components/workflow/nodes/data-source/default.ts index 8608aa314c..6be0666375 100644 --- a/web/app/components/workflow/nodes/data-source/default.ts +++ b/web/app/components/workflow/nodes/data-source/default.ts @@ -2,7 +2,6 @@ import type { NodeDefault } from '../../types' import type { DataSourceNodeType } from './types' import { genNodeMetaData } from '@/app/components/workflow/utils' import { BlockEnum } from '@/app/components/workflow/types' -import { CollectionType } from '@/app/components/tools/types' import { OUTPUT_VARIABLES_MAP } from './constants' const metaData = genNodeMetaData({ @@ -22,8 +21,8 @@ const nodeDefault: NodeDefault = { } }, getOutputVars(payload) { - const { datasource_name, provider_type } = payload - const isLocalFile = datasource_name === 'local_file' && provider_type === CollectionType.datasource + const { provider_type } = payload + const isLocalFile = provider_type === 'local_file' return [ { variable: OUTPUT_VARIABLES_MAP.datasource_type.name, diff --git a/web/app/components/workflow/nodes/data-source/panel.tsx b/web/app/components/workflow/nodes/data-source/panel.tsx index 232726fe35..258f181e4f 100644 --- a/web/app/components/workflow/nodes/data-source/panel.tsx +++ b/web/app/components/workflow/nodes/data-source/panel.tsx @@ -2,7 +2,6 @@ import type { FC } from 'react' import { useTranslation } from 'react-i18next' import { memo } from 'react' import type { DataSourceNodeType } from './types' -import { CollectionType } from '@/app/components/tools/types' import type { NodePanelProps } from '@/app/components/workflow/types' import { BoxGroupField } from '@/app/components/workflow/nodes/_base/components/layout' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' @@ -15,10 +14,9 @@ const Panel: FC> = ({ id, data }) => { const { provider_type, fileExtensions = [], - datasource_name, } = data const { handleFileExtensionsChange } = useConfig(id) - const isLocalFile = datasource_name === 'local_file' && provider_type === CollectionType.datasource + const isLocalFile = provider_type === 'local_file' return (
diff --git a/web/app/components/workflow/nodes/data-source/types.ts b/web/app/components/workflow/nodes/data-source/types.ts index 9ac0538b65..fadfc96de5 100644 --- a/web/app/components/workflow/nodes/data-source/types.ts +++ b/web/app/components/workflow/nodes/data-source/types.ts @@ -1,6 +1,5 @@ import type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types' import type { RAGPipelineVariables } from '@/models/pipeline' -import type { CollectionType } from '@/app/components/tools/types' export enum VarType { variable = 'variable', @@ -17,7 +16,7 @@ export type DataSourceNodeType = CommonNodeType & { variables: RAGPipelineVariables fileExtensions?: string[] provider_id: string - provider_type: CollectionType + provider_type: string provider_name: string datasource_name: string datasource_label: string