diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx index b80756a5a7..a0677ae183 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/local-file/index.tsx @@ -1,4 +1,3 @@ -import VectorSpaceFull from '@/app/components/billing/vector-space-full' import type { FileItem } from '@/models/datasets' import FileUploader from './file-uploader' @@ -7,7 +6,6 @@ type LocalFileProps = { updateFileList: (files: FileItem[]) => void updateFile: (fileItem: FileItem, progress: number, list: FileItem[]) => void notSupportBatchUpload: boolean - isShowVectorSpaceFull: boolean } const LocalFile = ({ @@ -15,21 +13,15 @@ const LocalFile = ({ updateFileList, updateFile, notSupportBatchUpload, - isShowVectorSpaceFull, }: LocalFileProps) => { return ( - <> - - {isShowVectorSpaceFull && ( - - )} - + ) } diff --git a/web/app/components/rag-pipeline/components/panel/test-run/data-source/notion/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/data-source/notion/index.tsx index af72789e18..f6177d5e70 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/data-source/notion/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/data-source/notion/index.tsx @@ -2,20 +2,17 @@ import { useDataSources } from '@/service/use-common' import { useCallback, useMemo } from 'react' import { NotionPageSelector } from '@/app/components/base/notion-page-selector' import type { NotionPage } from '@/models/common' -import VectorSpaceFull from '@/app/components/billing/vector-space-full' import { NotionConnector } from '@/app/components/base/notion-connector' import { useModalContextSelector } from '@/context/modal-context' type NotionProps = { notionPages: NotionPage[] updateNotionPages: (value: NotionPage[]) => void - isShowVectorSpaceFull: boolean } const Notion = ({ notionPages, updateNotionPages, - isShowVectorSpaceFull, }: NotionProps) => { const { data: dataSources } = useDataSources() const setShowAccountSettingModal = useModalContextSelector(state => state.setShowAccountSettingModal) @@ -33,16 +30,11 @@ const Notion = ({ <> {!hasConnection && } {hasConnection && ( - <> - page.page_id)} - onSelect={updateNotionPages} - canPreview={false} - /> - {isShowVectorSpaceFull && ( - - )} - + page.page_id)} + onSelect={updateNotionPages} + canPreview={false} + /> )} ) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx index bb542a1422..4ae3624d08 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx @@ -13,10 +13,11 @@ import { useTranslation } from 'react-i18next' import { useProviderContextSelector } from '@/context/provider-context' import type { NotionPage } from '@/models/common' import Notion from './data-source/notion' +import VectorSpaceFull from '@/app/components/billing/vector-space-full' const TestRunPanel = () => { const { t } = useTranslation() - const [currentStep, setCurrentStep] = useState(0) + const [currentStep, setCurrentStep] = useState(1) const [dataSourceType, setDataSourceType] = useState(DataSourceType.FILE) const [fileList, setFiles] = useState([]) const [notionPages, setNotionPages] = useState([]) @@ -40,6 +41,14 @@ const TestRunPanel = () => { return isShowVectorSpaceFull }, [fileList, isShowVectorSpaceFull]) + const nextBtnDisabled = useMemo(() => { + if (dataSourceType === DataSourceType.FILE) + return nextDisabled + if (dataSourceType === DataSourceType.NOTION) + return isShowVectorSpaceFull || !notionPages.length + return false + }, [dataSourceType, nextDisabled, isShowVectorSpaceFull, notionPages.length]) + const handleClose = () => { setShowTestRunPanel?.(false) } @@ -87,7 +96,7 @@ const TestRunPanel = () => { { - currentStep === 0 && ( + currentStep === 1 && ( <>
{ updateFile={updateFile} updateFileList={updateFileList} notSupportBatchUpload={notSupportBatchUpload} - isShowVectorSpaceFull={isShowVectorSpaceFull} /> )} {dataSourceType === DataSourceType.NOTION && ( )} + {isShowVectorSpaceFull && ( + + )}
- {dataSourceType === DataSourceType.FILE && ( - - )} - {dataSourceType === DataSourceType.NOTION && ( - - )} +
) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/step-indicator.tsx b/web/app/components/rag-pipeline/components/panel/test-run/step-indicator.tsx index 870961f0e8..5fc599833a 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/step-indicator.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/step-indicator.tsx @@ -19,7 +19,7 @@ const StepIndicator = ({ return (
{steps.map((step, index) => { - const isCurrentStep = index === currentStep + const isCurrentStep = index === currentStep - 1 const isLastStep = index === steps.length - 1 return (