feat: list page show mangage

This commit is contained in:
Joel 2025-02-28 15:47:10 +08:00
parent 9780795010
commit f0495b499d
3 changed files with 10 additions and 0 deletions

View File

@ -324,6 +324,7 @@ const Documents: FC<IDocumentsProps> = ({ datasetId }) => {
current: currPage,
onChange: setCurrPage,
}}
onManageMetadata={showEditMetadataModal}
/>
: <EmptyElement canAdd={embeddingAvailable} onClick={routeToDocCreate} type={isDataSourceNotion ? 'sync' : 'upload'} />
}

View File

@ -403,6 +403,7 @@ type IDocumentListProps = {
datasetId: string
pagination: PaginationProps
onUpdate: () => void
onManageMetadata: () => void
}
/**
@ -416,6 +417,7 @@ const DocumentList: FC<IDocumentListProps> = ({
datasetId,
pagination,
onUpdate,
onManageMetadata,
}) => {
const { t } = useTranslation()
const { formatTime } = useTimestamp()
@ -664,6 +666,10 @@ const DocumentList: FC<IDocumentListProps> = ({
list={originalList}
onSave={handleSave}
onHide={hideEditModal}
onShowManage={() => {
hideEditModal()
onManageMetadata()
}}
/>
)}
</div>

View File

@ -23,6 +23,7 @@ type Props = {
list: MetadataItemInBatchEdit[]
onSave: (list: MetadataItemInBatchEdit[], isApplyToAllSelectDocument: boolean) => void
onHide: () => void
onShowManage: () => void
}
const EditMetadataBatchModal: FC<Props> = ({
@ -30,6 +31,7 @@ const EditMetadataBatchModal: FC<Props> = ({
list,
onSave,
onHide,
onShowManage,
}) => {
const { t } = useTranslation()
const [templeList, setTempleList] = useState<MetadataItemWithEdit[]>(list)
@ -137,6 +139,7 @@ const EditMetadataBatchModal: FC<Props> = ({
<AddMetadataButton />
}
onSave={data => setAddedList([...addedList, data])}
onManage={onShowManage}
/>
</div>
</div>