feat: add FooterTips component and integrate it into TestRunPanel; extend DatasourceType enum with onlineDrive

wtw/rag-pipeline
twwu 11 months ago
parent c7cec120a6
commit cf7574bd10

@ -18,7 +18,7 @@ import { useFileUploadConfig } from '@/service/use-common'
const FILES_NUMBER_LIMIT = 20 const FILES_NUMBER_LIMIT = 20
type IFileUploaderProps = { export type FileUploaderProps = {
fileList: FileItem[] fileList: FileItem[]
allowedExtensions: string[] allowedExtensions: string[]
prepareFileList: (files: FileItem[]) => void prepareFileList: (files: FileItem[]) => void
@ -36,7 +36,7 @@ const FileUploader = ({
onFileListUpdate, onFileListUpdate,
onPreview, onPreview,
notSupportBatchUpload, notSupportBatchUpload,
}: IFileUploaderProps) => { }: FileUploaderProps) => {
const { t } = useTranslation() const { t } = useTranslation()
const { notify } = useContext(ToastContext) const { notify } = useContext(ToastContext)
const { locale } = useContext(I18n) const { locale } = useContext(I18n)

@ -0,0 +1,14 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
const FooterTips = () => {
const { t } = useTranslation()
return (
<div className='system-xs-regular flex grow flex-col justify-end p-4 pt-2 text-text-tertiary'>
{t('datasetPipeline.testRun.tooltip')}
</div>
)
}
export default React.memo(FooterTips)

@ -1,4 +1,3 @@
import Tooltip from '@/app/components/base/tooltip'
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import StepIndicator from './step-indicator' import StepIndicator from './step-indicator'
@ -16,12 +15,8 @@ const Header = ({
return ( return (
<div className='flex flex-col gap-y-0.5 px-3 pb-2 pt-3.5'> <div className='flex flex-col gap-y-0.5 px-3 pb-2 pt-3.5'>
<div className='flex items-center gap-x-1 pl-1 pr-8'> <div className='system-md-semibold-uppercase flex items-center gap-x-1 pl-1 pr-8 text-text-primary'>
<span className='system-md-semibold-uppercase text-text-primary'>{t('datasetPipeline.testRun.title')}</span> {t('datasetPipeline.testRun.title')}
<Tooltip
popupContent={t('datasetPipeline.testRun.tooltip')}
popupClassName='max-w-[240px]'
/>
</div> </div>
<StepIndicator steps={steps} currentStep={currentStep} /> <StepIndicator steps={steps} currentStep={currentStep} />
</div> </div>

@ -15,6 +15,7 @@ import { DatasourceType } from '@/models/pipeline'
import { TransferMethod } from '@/types/app' import { TransferMethod } from '@/types/app'
import CloseButton from './close-button' import CloseButton from './close-button'
import Header from './header' import Header from './header'
import FooterTips from './footer-tips'
const TestRunPanel = () => { const TestRunPanel = () => {
const setShowDebugAndPreviewPanel = useWorkflowStoreWithSelector(state => state.setShowDebugAndPreviewPanel) const setShowDebugAndPreviewPanel = useWorkflowStoreWithSelector(state => state.setShowDebugAndPreviewPanel)
@ -108,7 +109,7 @@ const TestRunPanel = () => {
> >
<CloseButton handleClose={handleClose} /> <CloseButton handleClose={handleClose} />
<Header steps={steps} currentStep={currentStep} /> <Header steps={steps} currentStep={currentStep} />
<div className='grow overflow-y-auto'> <div className='flex grow flex-col overflow-y-auto'>
{ {
currentStep === 1 && ( currentStep === 1 && (
<> <>
@ -161,6 +162,7 @@ const TestRunPanel = () => {
)} )}
</div> </div>
<Actions disabled={nextBtnDisabled} handleNextStep={handleNextStep} /> <Actions disabled={nextBtnDisabled} handleNextStep={handleNextStep} />
<FooterTips />
</> </>
) )
} }

@ -11,6 +11,7 @@ export enum DatasourceType {
localFile = 'local_file', localFile = 'local_file',
onlineDocument = 'online_document', onlineDocument = 'online_document',
websiteCrawl = 'website_crawl', websiteCrawl = 'website_crawl',
onlineDrive = 'online_drive',
} }
export type PipelineTemplateListParams = { export type PipelineTemplateListParams = {

Loading…
Cancel
Save