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, current: currPage,
onChange: setCurrPage, onChange: setCurrPage,
}} }}
onManageMetadata={showEditMetadataModal}
/> />
: <EmptyElement canAdd={embeddingAvailable} onClick={routeToDocCreate} type={isDataSourceNotion ? 'sync' : 'upload'} /> : <EmptyElement canAdd={embeddingAvailable} onClick={routeToDocCreate} type={isDataSourceNotion ? 'sync' : 'upload'} />
} }

View File

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

View File

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