1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

refactor(ui/datatables): allow datatable to globally filter on object value [EE-5824] (#9955)

This commit is contained in:
Chaim Lev-Ari 2023-09-04 10:33:07 +01:00 committed by GitHub
parent 440f4e8dda
commit cb7377ead6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 271 additions and 186 deletions

View file

@ -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) {