mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(ui/datatables): allow datatable to globally filter on object value [EE-5824] (#9955)
This commit is contained in:
parent
440f4e8dda
commit
cb7377ead6
34 changed files with 271 additions and 186 deletions
|
@ -7,8 +7,9 @@ import { Datatable } from '@@/datatables';
|
|||
import { BasicTableSettings } from '@@/datatables/types';
|
||||
import { Button } from '@@/buttons';
|
||||
import { TableState } from '@@/datatables/useTableState';
|
||||
import { withMeta } from '@@/datatables/extend-options/withMeta';
|
||||
|
||||
import { FileData, FilesTableMeta } from './types';
|
||||
import { FileData } from './types';
|
||||
import { columns } from './columns';
|
||||
|
||||
interface Props {
|
||||
|
@ -72,14 +73,19 @@ export function FilesTable({
|
|||
}
|
||||
|
||||
return (
|
||||
<Datatable<FileData, FilesTableMeta>
|
||||
<Datatable<FileData>
|
||||
title={title}
|
||||
titleIcon={FileIcon}
|
||||
dataset={isRoot ? dataset : [goToParent(onGoToParent), ...dataset]}
|
||||
settingsManager={tableState}
|
||||
columns={columns}
|
||||
getRowId={(row) => row.Name}
|
||||
meta={{
|
||||
initialTableState={{
|
||||
columnVisibility: {
|
||||
Dir: false,
|
||||
},
|
||||
}}
|
||||
extendTableOptions={withMeta({
|
||||
table: 'files',
|
||||
isEdit,
|
||||
setIsEdit,
|
||||
|
@ -87,12 +93,7 @@ export function FilesTable({
|
|||
onBrowse,
|
||||
onDownload,
|
||||
onDelete,
|
||||
}}
|
||||
initialTableState={{
|
||||
columnVisibility: {
|
||||
Dir: false,
|
||||
},
|
||||
}}
|
||||
})}
|
||||
disableSelect
|
||||
renderTableActions={() => {
|
||||
if (!isUploadAllowed) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue