mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
chore: don't hide columns in connected instances table (#6264)
Don't hide anything yet, so remove related code. Plus other code we don't need has been removed.
This commit is contained in:
parent
0e9102fb22
commit
bd907244c4
@ -26,28 +26,17 @@ export const ConnectedInstances = () => {
|
||||
);
|
||||
}, [application]);
|
||||
|
||||
const {
|
||||
getTableProps,
|
||||
getTableBodyProps,
|
||||
headerGroups,
|
||||
rows,
|
||||
prepareRow,
|
||||
state: { globalFilter },
|
||||
setHiddenColumns,
|
||||
columns,
|
||||
} = useConnectedInstancesTable(tableData);
|
||||
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =
|
||||
useConnectedInstancesTable(tableData);
|
||||
|
||||
return (
|
||||
<ConnectedInstancesTable
|
||||
loading={false}
|
||||
headerGroups={headerGroups}
|
||||
setHiddenColumns={setHiddenColumns}
|
||||
prepareRow={prepareRow}
|
||||
getTableBodyProps={getTableBodyProps}
|
||||
getTableProps={getTableProps}
|
||||
rows={rows}
|
||||
columns={columns}
|
||||
globalFilter={globalFilter}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -11,27 +11,11 @@ import {
|
||||
TableCell,
|
||||
TablePlaceholder,
|
||||
} from 'component/common/Table';
|
||||
import {
|
||||
Box,
|
||||
styled,
|
||||
Table,
|
||||
TableBody,
|
||||
TableRow,
|
||||
useMediaQuery,
|
||||
} from '@mui/material';
|
||||
import theme from 'themes/theme';
|
||||
import { Box, Table, TableBody, TableRow } from '@mui/material';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
|
||||
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
|
||||
|
||||
const hiddenColumnsSmall = ['ip', 'sdkVersion'];
|
||||
const hiddenColumnsCompact = ['ip', 'sdkVersion', 'lastSeen'];
|
||||
|
||||
type ConnectedInstancesTableProps = {
|
||||
compact?: boolean;
|
||||
loading: boolean;
|
||||
setHiddenColumns: (param: any) => void;
|
||||
columns: any[];
|
||||
rows: Row<object>[];
|
||||
prepareRow: (row: Row<object>) => void;
|
||||
getTableProps: (
|
||||
@ -41,37 +25,15 @@ type ConnectedInstancesTableProps = {
|
||||
propGetter?: TableBodyPropGetter<object> | undefined,
|
||||
) => TableBodyProps;
|
||||
headerGroups: HeaderGroup<object>[];
|
||||
globalFilter: any;
|
||||
};
|
||||
export const ConnectedInstancesTable = ({
|
||||
compact = false,
|
||||
setHiddenColumns,
|
||||
columns,
|
||||
loading,
|
||||
rows,
|
||||
getTableProps,
|
||||
getTableBodyProps,
|
||||
headerGroups,
|
||||
globalFilter,
|
||||
prepareRow,
|
||||
}: ConnectedInstancesTableProps) => {
|
||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
||||
|
||||
useConditionallyHiddenColumns(
|
||||
[
|
||||
{
|
||||
condition: isSmallScreen,
|
||||
columns: hiddenColumnsSmall,
|
||||
},
|
||||
{
|
||||
condition: compact,
|
||||
columns: hiddenColumnsCompact,
|
||||
},
|
||||
],
|
||||
setHiddenColumns,
|
||||
columns,
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ overflowX: 'auto' }}>
|
||||
|
@ -1,13 +1,7 @@
|
||||
import { useMemo } from 'react';
|
||||
import { IApiToken } from 'hooks/api/getters/useApiTokens/useApiTokens';
|
||||
import { DateCell } from 'component/common/Table/cells/DateCell/DateCell';
|
||||
import { HighlightCell } from 'component/common/Table/cells/HighlightCell/HighlightCell';
|
||||
import { IconCell } from 'component/common/Table/cells/IconCell/IconCell';
|
||||
import { TimeAgoCell } from 'component/common/Table/cells/TimeAgoCell/TimeAgoCell';
|
||||
import { useTable, useGlobalFilter, useSortBy } from 'react-table';
|
||||
import { sortTypes } from 'utils/sortTypes';
|
||||
import { ProjectsList } from 'component/admin/apiToken/ProjectsList/ProjectsList';
|
||||
import { Key } from '@mui/icons-material';
|
||||
|
||||
type ConnectedInstancesTableData = {
|
||||
instanceId: string;
|
||||
|
Loading…
Reference in New Issue
Block a user