) => boolean
- }
+ filterFns={{
+ kubeObjectSearch: (row, id, filterValue) => {
+ const customFilterResult = filterFunc(row.original, filterValue);
+ const fuzzyColumnsResult = MRT_FilterFns.contains(row, id, filterValue);
+ return customFilterResult || fuzzyColumnsResult;
+ },
+ }}
+ globalFilterFn="kubeObjectSearch"
+ filterFunction={filterFunc as any}
/>
>
);
diff --git a/frontend/src/components/common/Resource/__snapshots__/ResourceListView.stories.storyshot b/frontend/src/components/common/Resource/__snapshots__/ResourceListView.stories.storyshot
index b8d761af125..60406e5199a 100644
--- a/frontend/src/components/common/Resource/__snapshots__/ResourceListView.stories.storyshot
+++ b/frontend/src/components/common/Resource/__snapshots__/ResourceListView.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots Resource/ListView One Hidden Column 1`] = `
/>
-
diff --git a/frontend/src/components/common/Resource/__snapshots__/ResourceTable.stories.storyshot b/frontend/src/components/common/Resource/__snapshots__/ResourceTable.stories.storyshot
index 8f54bdfe3b2..f7abeccd6d3 100644
--- a/frontend/src/components/common/Resource/__snapshots__/ResourceTable.stories.storyshot
+++ b/frontend/src/components/common/Resource/__snapshots__/ResourceTable.stories.storyshot
@@ -19,7 +19,7 @@ exports[`Storyshots ResourceTable Name Search 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
-
@@ -549,7 +603,7 @@ exports[`Storyshots ResourceTable Name Search 1`] = `
- 1-1 of 1
+ 1-4 of 4
@@ -1299,7 +1353,7 @@ exports[`Storyshots ResourceTable With Hidden Cols 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/common/SectionFilterHeader.tsx b/frontend/src/components/common/SectionFilterHeader.tsx
index df83a23ef8d..93b93c47025 100644
--- a/frontend/src/components/common/SectionFilterHeader.tsx
+++ b/frontend/src/components/common/SectionFilterHeader.tsx
@@ -1,22 +1,21 @@
-import { Icon } from '@iconify/react';
import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
-import IconButton from '@mui/material/IconButton';
-import TextField from '@mui/material/TextField';
import React from 'react';
-import { useHotkeys } from 'react-hotkeys-hook';
-import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
-import { useHistory, useLocation } from 'react-router-dom';
-import { addQuery, getFilterValueByNameFromURL } from '../../helpers';
-import { resetFilter, setNamespaceFilter, setSearchFilter } from '../../redux/filterSlice';
+import { useLocation } from 'react-router-dom';
+import { getFilterValueByNameFromURL } from '../../helpers';
+import { setNamespaceFilter } from '../../redux/filterSlice';
import { useTypedSelector } from '../../redux/reducers/reducers';
import { NamespacesAutocomplete } from './NamespacesAutocomplete';
import SectionHeader, { SectionHeaderProps } from './SectionHeader';
export interface SectionFilterHeaderProps extends SectionHeaderProps {
noNamespaceFilter?: boolean;
+ /**
+ * @deprecated
+ * This prop has no effect, search has moved inside the Table component.
+ * To disable namespace filter use `noNamespaceFilter`
+ */
noSearch?: boolean;
preRenderFromFilterActions?: React.ReactNode[];
}
@@ -24,7 +23,6 @@ export interface SectionFilterHeaderProps extends SectionHeaderProps {
export default function SectionFilterHeader(props: SectionFilterHeaderProps) {
const {
noNamespaceFilter = false,
- noSearch = false,
actions: propsActions = [],
preRenderFromFilterActions,
...headerProps
@@ -32,42 +30,6 @@ export default function SectionFilterHeader(props: SectionFilterHeaderProps) {
const filter = useTypedSelector(state => state.filter);
const dispatch = useDispatch();
const location = useLocation();
- const history = useHistory();
- const hasNamespaceFilters = !noNamespaceFilter && filter.namespaces.size > 0;
- const hasSearch = !noSearch && !!filter.search;
- const { t } = useTranslation();
-
- // When the user moves to a different route, the search filter is reset (to an empty string), but
- // this goes through redux, so when the new route is rendered, the search filter is still the old
- // one. Eventually, the redux state will be updated, but at this point we already have the filter
- // being shown (when it should actually be shown). OTOH, if we always hide the filter when the
- // search (and namespace) are empty, it will also hide when the user deletes the whole string, and
- // that's not desireable (because they may want to keep writing and at that point the filter has
- // been hidden and input is lost).
- // To solve this, we keep track of whether the filter has been shown by the user, in which case we
- // don't hide it even when the search is empty.
- const [showFilters, setShowFilters] = React.useState<{ show: boolean; userTriggered: boolean }>({
- show: hasNamespaceFilters || hasSearch,
- userTriggered: false,
- });
-
- function resetFilters() {
- addQuery({ namespace: '' }, { namespace: '' }, history, location);
- dispatch(resetFilter());
- setShowFilters({ show: false, userTriggered: true });
- }
-
- useHotkeys('ctrl+shift+f', () => {
- if (!noSearch || !noNamespaceFilter) {
- setShowFilters({ show: true, userTriggered: true });
- }
- });
-
- const focusedRef = React.useCallback(node => {
- if (node !== null) {
- node.focus();
- }
- }, []);
React.useEffect(
() => {
@@ -81,89 +43,26 @@ export default function SectionFilterHeader(props: SectionFilterHeaderProps) {
.every((value: string, index: number) => value !== namespaceFromStore[index])
) {
dispatch(setNamespaceFilter(namespace));
- if (!noNamespaceFilter) {
- setShowFilters({ show: true, userTriggered: false });
- }
}
}
- // We don't want the search to be used globally, but we're using Redux with it because
- // this way we manage it the same way as with the other filters.
- return function cleanup() {
- dispatch(setSearchFilter(''));
- };
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
- React.useEffect(() => {
- setShowFilters(state => {
- return {
- show: hasSearch || hasNamespaceFilters || state.userTriggered,
- userTriggered: state.userTriggered,
- };
- });
- }, [hasSearch]);
-
let actions: React.ReactNode[] = [];
- if (preRenderFromFilterActions && !showFilters.show) {
+ if (preRenderFromFilterActions) {
actions.push(...preRenderFromFilterActions);
}
- if (!noSearch) {
- if (!showFilters.show) {
- actions.push(
-
setShowFilters({ show: true, userTriggered: true })}
- size="medium"
- >
-
-
- );
- } else {
- actions.push(
-
- {!noNamespaceFilter && (
-
-
-
- )}
-
- {
- dispatch(setSearchFilter(event.target.value));
- setShowFilters({ show: true, userTriggered: true });
- }}
- inputRef={focusedRef}
- />
-
-
- }
- onClick={resetFilters}
- aria-controls="standard-search"
- >
- {t('Clear')}
-
-
-
- );
- }
- }
-
if (!!propsActions) {
actions = actions.concat(propsActions);
}
+ if (!noNamespaceFilter) {
+ actions.push(
);
+ }
+
return (
({
sectionHeader: ({ noPadding }: HeaderStyleProps) => ({
padding: theme.spacing(noPadding ? 0 : 2),
paddingTop: theme.spacing(noPadding ? 0 : 3),
- paddingRight: '0',
+ paddingRight: theme.spacing(noPadding ? 0 : 2),
}),
sectionTitle: ({ headerStyle }: HeaderStyleProps) => ({
...theme.palette.headerStyle[headerStyle || 'normal'],
diff --git a/frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx b/frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx
index d8dd3abb535..a7f36705f73 100644
--- a/frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx
+++ b/frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx
@@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next';
const useStyles = makeStyles({
fullText: {
wordBreak: 'break-all',
+ whiteSpace: 'normal',
},
});
diff --git a/frontend/src/components/common/SimpleTable.stories.tsx b/frontend/src/components/common/SimpleTable.stories.tsx
index 8bc8b94cba7..38a1fc01ce3 100644
--- a/frontend/src/components/common/SimpleTable.stories.tsx
+++ b/frontend/src/components/common/SimpleTable.stories.tsx
@@ -223,31 +223,30 @@ ReflectInURLWithPrefix.args = {
// filter Function
-type SimpleTableWithFilterProps = SimpleTableProps & { matchCriteria?: string[] };
+type SimpleTableWithFilterProps = SimpleTableProps & { matchCriteria?: string[]; search?: string };
function SimpleTableWithFilter(props: SimpleTableWithFilterProps) {
- const { matchCriteria, ...otherProps } = props;
+ const { matchCriteria, search, ...otherProps } = props;
const filterFunc = useFilterFunc(matchCriteria);
- return ;
+ return filterFunc(item, search)} {...otherProps} />;
}
const TemplateWithFilter: StoryFn<{
simpleTableArgs: SimpleTableWithFilterProps;
namespaces: string[];
- search: string;
+ search?: string;
}> = args => {
- const { simpleTableArgs, search, namespaces = [] } = args;
+ const { simpleTableArgs, namespaces = [], search } = args;
const storeWithFilterAndSettings = configureStore({
reducer: (
state = {
- filter: { namespaces: new Set(), search: '' },
+ filter: { namespaces: new Set() },
config: { settings: { tableRowsPerPageOptions: [10, 20, 50, 100] } },
}
) => state,
preloadedState: {
filter: {
namespaces: new Set(namespaces),
- search,
},
config: {
settings: {
@@ -260,7 +259,7 @@ const TemplateWithFilter: StoryFn<{
return (
-
+
);
};
diff --git a/frontend/src/components/common/Table/Table.tsx b/frontend/src/components/common/Table/Table.tsx
index 36347b5fa12..a799bd1c7f0 100644
--- a/frontend/src/components/common/Table/Table.tsx
+++ b/frontend/src/components/common/Table/Table.tsx
@@ -1,4 +1,4 @@
-import { Paper } from '@mui/material';
+import { Box, Paper } from '@mui/material';
import { useTheme } from '@mui/styles';
import {
MaterialReactTable,
@@ -12,7 +12,7 @@ import { MRT_Localization_EN } from 'material-react-table/locales/en';
import { MRT_Localization_ES } from 'material-react-table/locales/es';
import { MRT_Localization_FR } from 'material-react-table/locales/fr';
import { MRT_Localization_PT } from 'material-react-table/locales/pt';
-import { useEffect, useMemo, useState } from 'react';
+import { ReactNode, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import helpers from '../../../helpers';
import { useURLState } from '../../../lib/util';
@@ -21,29 +21,70 @@ import Empty from '../EmptyContent';
import Loader from '../Loader';
/**
+ * Column definition
+ * We reuse the Material React Table column definition
+ * Additional gridTemplate property is added because we have our own layout
+ * based on the CSS grid
+ *
* @see https://www.material-react-table.com/docs/api/column-options
*/
export type TableColumn, Value = any> = MaterialTableColumn<
RowItem,
Value
->;
+> & {
+ /**
+ * Column width in the grid template format
+ * Number values will be converted to "fr"
+ * @example
+ * 1
+ * "1.5fr"
+ * "min-content"
+ */
+ gridTemplate?: string | number;
+};
/**
* All the options provided by the MRT and some of our custom behaviour
*
* @see https://www.material-react-table.com/docs/api/table-options
*/
-export type TableProps> = MaterialTableOptions & {
- emptyMessage?: string;
- errorMessage?: any;
+export type TableProps> = Omit<
+ MaterialTableOptions,
+ 'columns'
+> & {
+ columns: TableColumn[];
+ /**
+ * Message to show when the table is empty
+ */
+ emptyMessage?: ReactNode;
+ /**
+ * Error message to show instead of the table
+ */
+ errorMessage?: ReactNode;
/** Whether to reflect the page/perPage properties in the URL.
* If assigned to a string, it will be the prefix for the page/perPage parameters.
* If true or '', it'll reflect the parameters without a prefix.
* By default, no parameters are reflected in the URL. */
reflectInURL?: string | boolean;
+ /**
+ * Initial page to show in the table
+ * Important: page is 1-indexed!
+ * @default 1
+ */
initialPage?: number;
+ /**
+ * List of options for the rows per page selector
+ * @example [15, 25, 50]
+ */
rowsPerPage?: number[];
+ /**
+ * Function to filter the rows
+ * Works in addition to the default table filtering and searching
+ */
filterFunction?: (item: RowItem) => boolean;
+ /**
+ * Whether to show a loading spinner
+ */
loading?: boolean;
};
@@ -118,10 +159,7 @@ export default function Table>({
tableProps.columns.map((column, i) => ({
...column,
id: column.id ?? String(i),
- // If columns sets empty string as its' header then it's not visible
- // in the show/hide columns popup
- header: column.header || ' ',
- size: column.size ?? 80,
+ header: column.header || '',
})),
[tableProps.columns]
);
@@ -131,6 +169,19 @@ export default function Table>({
return (tableProps.data ?? []).filter(it => filterFunction(it));
}, [tableProps.data, filterFunction]);
+ const gridTemplateColumns = tableProps.columns
+ .filter(it => {
+ const isHidden = tableProps.state?.columnVisibility?.[it.id!] === false;
+ return !isHidden;
+ })
+ .map(it => {
+ if (typeof it.gridTemplate === 'number') {
+ return `${it.gridTemplate}fr`;
+ }
+ return it.gridTemplate ?? '1fr';
+ })
+ .join(' ');
+
const table = useMaterialReactTable({
...tableProps,
columns: tableColumns ?? [],
@@ -138,6 +189,7 @@ export default function Table>({
enableDensityToggle: tableProps.enableDensityToggle ?? false,
enableFullScreenToggle: tableProps.enableFullScreenToggle ?? false,
localization: tableLocalizationMap[i18n.language],
+ autoResetAll: false,
onPaginationChange: (updater: any) => {
if (!tableProps.data?.length) return;
const pagination = updater({ pageIndex: Number(page) - 1, pageSize: Number(pageSize) });
@@ -155,11 +207,30 @@ export default function Table>({
pageSize: pageSize,
},
},
+ layoutMode: 'grid',
+ // Need to provide our own empty message
+ // because default one breaks with our custom layout
+ renderEmptyRowsFallback: () => (
+
+
+ {t('No results found')}
+
+
+ ),
muiPaginationProps: {
rowsPerPageOptions: rowsPerPageOptions,
showFirstButton: false,
showLastButton: false,
},
+ muiTableBodyCellProps: {
+ sx: {
+ // By default in compact mode text doesn't wrap
+ // so we need to override that
+ whiteSpace: 'normal',
+ width: 'unset',
+ minWidth: 'unset',
+ },
+ },
muiTablePaperProps: {
variant: 'outlined',
elevation: 0,
@@ -167,9 +238,15 @@ export default function Table>({
display: 'grid',
},
},
+ muiTableBodyProps: {
+ sx: {
+ display: 'contents',
+ },
+ },
muiTableBodyRowProps: {
sx: {
- backgroundColor: undefined,
+ display: 'contents',
+ backgroundColor: theme.palette.tables.body.background,
},
},
muiBottomToolbarProps: {
@@ -180,11 +257,18 @@ export default function Table>({
},
muiTableProps: {
sx: {
- backgroundColor: theme.palette.tables.body.background,
+ gridTemplateColumns,
+ },
+ },
+ muiTableHeadProps: {
+ sx: {
+ display: 'contents',
},
},
muiTableHeadCellProps: {
sx: {
+ width: 'unset',
+ minWidth: 'unset',
borderTop: '1px solid',
borderColor: theme.palette.tables.head.borderColor,
paddingTop: '0.5rem',
@@ -192,6 +276,7 @@ export default function Table>({
},
muiTableHeadRowProps: {
sx: {
+ display: 'contents',
background: theme.palette.tables.head.background,
boxShadow: undefined,
},
diff --git a/frontend/src/components/common/Table/__snapshots__/Table.stories.storyshot b/frontend/src/components/common/Table/__snapshots__/Table.stories.storyshot
index 6bd4155116e..1859722a4aa 100644
--- a/frontend/src/components/common/Table/__snapshots__/Table.stories.storyshot
+++ b/frontend/src/components/common/Table/__snapshots__/Table.stories.storyshot
@@ -133,17 +133,17 @@ exports[`Storyshots Table Datum 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
some name0
some status0
some age0
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
some name1
some status1
some age1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
some name2
some status2
some age2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
@@ -544,7 +544,7 @@ exports[`Storyshots Table Datum 1`] = `
@@ -805,17 +805,17 @@ exports[`Storyshots Table Getter 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
some name0
some status0
some age0
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
22
some name1
some status1
some age1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
33
some name2
some status2
some age2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
44
@@ -1311,7 +1311,7 @@ exports[`Storyshots Table Getter 1`] = `
@@ -1470,126 +1470,69 @@ exports[`Storyshots Table Label Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -1726,17 +1669,17 @@ exports[`Storyshots Table Label Search 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
+ mydefinition.phonyresources0.io
+
+
+ MyNamespace0
+
+
+ phony0
+
+
+
+
+
mydefinition.phonyresources1.io
MyNamespace1
phony1
{"mylabel1":"myvalue1"}
mydefinition.phonyresources2.io
MyNamespace2
phony2
{"mykey2":"mylabel"}
+
+
+ mydefinition.phonyresources3.io
+
+
+ MyNamespace3
+
+
+ phony3
+
+
+ {"mykey3":"myvalue3"}
+
+
@@ -2172,7 +2171,7 @@ exports[`Storyshots Table Label Search 1`] = `
- 1-2 of 2
+ 1-4 of 4
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -2523,17 +2465,17 @@ exports[`Storyshots Table Name Search 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
+ mydefinition.phonyresources0.io
+
+
+ MyNamespace0
+
+
+ phony0
+
+
+
+
+
+ mydefinition.phonyresources1.io
+
+
+ MyNamespace1
+
+
+ phony1
+
+
+ {"mylabel1":"myvalue1"}
+
+
+
+
mydefinition.phonyresources2.io
MyNamespace2
phony2
{"mykey2":"mylabel"}
+
+
+ mydefinition.phonyresources3.io
+
+
+ MyNamespace3
+
+
+ phony3
+
+
+ {"mykey3":"myvalue3"}
+
+
@@ -2940,7 +2967,7 @@ exports[`Storyshots Table Name Search 1`] = `
- 1-1 of 1
+ 1-4 of 4
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -3291,17 +3261,17 @@ exports[`Storyshots Table Namespace Search 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
+ mydefinition.phonyresources0.io
+
+
+ MyNamespace0
+
+
+ phony0
+
+
+
+
+
+ mydefinition.phonyresources1.io
+
+
+ MyNamespace1
+
+
+ phony1
+
+
+ {"mylabel1":"myvalue1"}
+
+
+
+
+ mydefinition.phonyresources2.io
+
+
+ MyNamespace2
+
+
+ phony2
+
+
+ {"mykey2":"mylabel"}
+
+
+
+
mydefinition.phonyresources3.io
MyNamespace3
phony3
{"mykey3":"myvalue3"}
@@ -3644,7 +3699,7 @@ exports[`Storyshots Table Namespace Search 1`] = `
@@ -3708,7 +3763,7 @@ exports[`Storyshots Table Namespace Search 1`] = `
- 1-1 of 1
+ 1-4 of 4
-
-
-
- Clear
-
-
-
-
-
-
@@ -4093,17 +4091,17 @@ exports[`Storyshots Table Namespace Select 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
mydefinition.phonyresources0.io
MyNamespace0
phony0
mydefinition.phonyresources1.io
MyNamespace1
phony1
{"mylabel1":"myvalue1"}
@@ -4473,7 +4471,7 @@ exports[`Storyshots Table Namespace Select 1`] = `
@@ -4632,126 +4630,69 @@ exports[`Storyshots Table Not Found Message 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -4774,7 +4715,7 @@ exports[`Storyshots Table Not Found Message 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
-
+
-
- No records to display
-
+ mydefinition.phonyresources0.io
+
+
+ MyNamespace0
+
+
+ phony0
+
+
+
+
+
+ mydefinition.phonyresources1.io
+
+
+ MyNamespace1
+
+
+ phony1
+
+
+ {"mylabel1":"myvalue1"}
+
+
+
+
+ mydefinition.phonyresources2.io
+
+
+ MyNamespace2
+
+
+ phony2
+
+
+ {"mykey2":"mylabel"}
+
+
+
+
+ mydefinition.phonyresources3.io
+
+
+ MyNamespace3
+
+
+ phony3
+
+
+ {"mykey3":"myvalue3"}
@@ -5287,7 +5331,7 @@ exports[`Storyshots Table Not Found Message 1`] = `
- 0-0 of 0
+ 1-4 of 4
-
-
-
-
-
+
+
@@ -5638,17 +5625,17 @@ exports[`Storyshots Table Number Search 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
+ mydefinition.phonyresources0.io
+
+
+ MyNamespace0
+
+
+ 0
+
+
+
+
+ mydefinition.phonyresources1.io
+
+
+ MyNamespace1
+
+
+ 10
+
+
+
+
+ mydefinition.phonyresources2.io
+
+
+ MyNamespace2
+
+
+ 20
+
+
+
+
mydefinition.phonyresources3.io
MyNamespace3
30
@@ -5908,7 +5964,7 @@ exports[`Storyshots Table Number Search 1`] = `
@@ -5972,7 +6028,7 @@ exports[`Storyshots Table Number Search 1`] = `
- 1-1 of 1
+ 1-4 of 4
Name 0
Namespace 0
0
Name 1
Namespace 1
1
Name 2
Namespace 2
2
Name 3
Namespace 3
3
Name 4
Namespace 4
4
@@ -6548,7 +6604,7 @@ exports[`Storyshots Table Reflect In URL 1`] = `
@@ -6829,17 +6885,17 @@ exports[`Storyshots Table Reflect In URL With Prefix 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
Name 0
Namespace 0
Name 1
Namespace 1
Name 2
Namespace 2
Name 3
Namespace 3
Name 4
Namespace 4
@@ -7343,126 +7399,69 @@ exports[`Storyshots Table UID Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -7599,17 +7598,17 @@ exports[`Storyshots Table UID Search 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
mydefinition.phonyresources0.io
MyNamespace0
phony0
+
+
+ mydefinition.phonyresources1.io
+
+
+ MyNamespace1
+
+
+ phony1
+
+
+ {"mylabel1":"myvalue1"}
+
+
+
+
+ mydefinition.phonyresources2.io
+
+
+ MyNamespace2
+
+
+ phony2
+
+
+ {"mykey2":"mylabel"}
+
+
+
+
+ mydefinition.phonyresources3.io
+
+
+ MyNamespace3
+
+
+ phony3
+
+
+ {"mykey3":"myvalue3"}
+
+
@@ -8014,7 +8100,7 @@ exports[`Storyshots Table UID Search 1`] = `
- 1-1 of 1
+ 1-4 of 4
mydefinition.phonyresources0.io
MyNamespace0
mydefinition.phonyresources1.io
MyNamespace1
mydefinition.phonyresources2.io
MyNamespace2
mydefinition.phonyresources3.io
MyNamespace3
@@ -8449,7 +8535,7 @@ exports[`Storyshots Table With Filter Multi Select 1`] = `
@@ -8775,17 +8861,17 @@ exports[`Storyshots Table With Global Filter 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
-
+
-
- No results found
-
+
+
@@ -9371,17 +9472,17 @@ exports[`Storyshots Table With Sorting 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
mydefinition.phonyresources3.io
MyNamespace3
phony3
{"mykey3":"myvalue3"}
mydefinition.phonyresources2.io
MyNamespace2
phony2
{"mykey2":"mylabel"}
mydefinition.phonyresources1.io
MyNamespace1
phony1
{"mylabel1":"myvalue1"}
mydefinition.phonyresources0.io
MyNamespace0
phony0
diff --git a/frontend/src/components/common/__snapshots__/SimpleTable.stories.storyshot b/frontend/src/components/common/__snapshots__/SimpleTable.stories.storyshot
index 81589ec7831..730859e90e4 100644
--- a/frontend/src/components/common/__snapshots__/SimpleTable.stories.storyshot
+++ b/frontend/src/components/common/__snapshots__/SimpleTable.stories.storyshot
@@ -294,126 +294,69 @@ exports[`Storyshots SimpleTable Label Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -545,126 +488,69 @@ exports[`Storyshots SimpleTable Name Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -772,126 +658,69 @@ exports[`Storyshots SimpleTable Namespace Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -999,160 +828,103 @@ exports[`Storyshots SimpleTable Namespace Select 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -1282,126 +1054,69 @@ exports[`Storyshots SimpleTable Not Found Message 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -1503,126 +1218,69 @@ exports[`Storyshots SimpleTable Number Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
@@ -2021,126 +1679,69 @@ exports[`Storyshots SimpleTable UID Search 1`] = `
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
-
-
-
-
-
- Clear
-
-
-
-
-
-
diff --git a/frontend/src/components/configmap/List.tsx b/frontend/src/components/configmap/List.tsx
index e72e341caf9..a29dace7679 100644
--- a/frontend/src/components/configmap/List.tsx
+++ b/frontend/src/components/configmap/List.tsx
@@ -16,6 +16,7 @@ export default function ConfigMapList() {
id: 'data',
label: t('translation|Data'),
getValue: (configmap: ConfigMap) => Object.keys(configmap.data || {}).length || 0,
+ gridTemplate: 0.5,
},
'age',
]}
diff --git a/frontend/src/components/configmap/__snapshots__/List.stories.storyshot b/frontend/src/components/configmap/__snapshots__/List.stories.storyshot
index 3f810f6ea49..ecc6266ec65 100644
--- a/frontend/src/components/configmap/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/configmap/__snapshots__/List.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots ConfigMap/ListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots ConfigMap/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/crd/__snapshots__/CustomResourceDefinition.stories.storyshot b/frontend/src/components/crd/__snapshots__/CustomResourceDefinition.stories.storyshot
index d265b294a32..7c21eb1b60c 100644
--- a/frontend/src/components/crd/__snapshots__/CustomResourceDefinition.stories.storyshot
+++ b/frontend/src/components/crd/__snapshots__/CustomResourceDefinition.stories.storyshot
@@ -459,17 +459,71 @@ exports[`Storyshots crd/CustomResourceDefinition Details 1`] = `
@@ -608,17 +662,17 @@ exports[`Storyshots crd/CustomResourceDefinition Details 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
mycustomresource
myotherresource
@@ -1329,29 +1383,6 @@ exports[`Storyshots crd/CustomResourceDefinition List 1`] = `
/>
-
my.phonyresources.io
Namespaced
diff --git a/frontend/src/components/crd/__snapshots__/CustomResourceList.stories.storyshot b/frontend/src/components/crd/__snapshots__/CustomResourceList.stories.storyshot
index 008f73c0e1f..1a34b6ad96c 100644
--- a/frontend/src/components/crd/__snapshots__/CustomResourceList.stories.storyshot
+++ b/frontend/src/components/crd/__snapshots__/CustomResourceList.stories.storyshot
@@ -107,17 +107,71 @@ exports[`Storyshots crd/CustomResourceList List 1`] = `
@@ -256,17 +310,17 @@ exports[`Storyshots crd/CustomResourceList List 1`] = `
class="MuiTableContainer-root css-nhjqqh-MuiTableContainer-root"
>
mycustomresource
myotherresource
diff --git a/frontend/src/components/cronjob/List.tsx b/frontend/src/components/cronjob/List.tsx
index 84c5eaa1334..3594acc1992 100644
--- a/frontend/src/components/cronjob/List.tsx
+++ b/frontend/src/components/cronjob/List.tsx
@@ -48,11 +48,13 @@ export default function CronJobList() {
id: 'suspend',
label: t('translation|Suspend'),
getValue: cronJob => cronJob.spec.suspend.toString(),
+ gridTemplate: 0.6,
},
{
id: 'active',
label: t('translation|Active'),
getValue: cronJob => cronJob.status?.active?.length || 0,
+ gridTemplate: 0.6,
},
{
id: 'lastScheduleTime',
diff --git a/frontend/src/components/cronjob/__snapshots__/CronJobDetails.stories.storyshot b/frontend/src/components/cronjob/__snapshots__/CronJobDetails.stories.storyshot
index 5486a2dd0db..b91eb09fc75 100644
--- a/frontend/src/components/cronjob/__snapshots__/CronJobDetails.stories.storyshot
+++ b/frontend/src/components/cronjob/__snapshots__/CronJobDetails.stories.storyshot
@@ -280,29 +280,6 @@ exports[`Storyshots CronJob/CronJobDetailsView Every Ast 1`] = `
/>
-
-
daemonSet.status?.currentNumberScheduled || 0,
+ gridTemplate: 0.6,
},
{
id: 'currentPods',
label: t('translation|Current'),
getValue: daemonSet => daemonSet.status?.currentNumberScheduled || 0,
+ gridTemplate: 0.6,
},
{
id: 'desiredPods',
label: t('translation|Desired', { context: 'pods' }),
getValue: daemonSet => daemonSet.status?.desiredNumberScheduled || 0,
+ gridTemplate: 0.6,
},
{
id: 'readyPods',
label: t('translation|Ready'),
getValue: daemonSet => daemonSet.status?.numberReady || 0,
+ gridTemplate: 0.6,
},
{
id: 'nodeSelector',
diff --git a/frontend/src/components/daemonset/__snapshots__/List.stories.storyshot b/frontend/src/components/daemonset/__snapshots__/List.stories.storyshot
index 7b51e64171c..f7b3f913b78 100644
--- a/frontend/src/components/daemonset/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/daemonset/__snapshots__/List.stories.storyshot
@@ -36,17 +36,71 @@ exports[`Storyshots DaemonSet/List Daemon Sets 1`] = `
@@ -71,7 +125,7 @@ exports[`Storyshots DaemonSet/List Daemon Sets 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/deployments/List.tsx b/frontend/src/components/deployments/List.tsx
index 9fd50312ae0..c7d850bd5e6 100644
--- a/frontend/src/components/deployments/List.tsx
+++ b/frontend/src/components/deployments/List.tsx
@@ -45,7 +45,7 @@ export default function DeploymentsList() {
.map((condition: any) => {
const { type, message } = condition;
return (
-
+
{type}
@@ -69,17 +69,25 @@ export default function DeploymentsList() {
getValue: deployment => deployment.status.availableReplicas,
render: deployment => renderPods(deployment),
sort: sortByPods,
+ gridTemplate: 0.5,
},
{
id: 'replicas',
label: t('Replicas'),
getValue: deployment => deployment.spec.replicas || 0,
+ gridTemplate: 0.6,
},
{
id: 'conditions',
label: t('translation|Conditions'),
getValue: deployment => deployment.status?.conditions?.map((c: any) => c.type)?.join(''),
render: deployment => renderConditions(deployment),
+ cellProps: {
+ sx: {
+ flexWrap: 'wrap',
+ gap: '4px',
+ },
+ },
},
{
id: 'containers',
diff --git a/frontend/src/components/endpoints/List.tsx b/frontend/src/components/endpoints/List.tsx
index 65ee574ed0f..7a5c0e1a5d4 100644
--- a/frontend/src/components/endpoints/List.tsx
+++ b/frontend/src/components/endpoints/List.tsx
@@ -25,6 +25,7 @@ export default function EndpointList() {
label: t('translation|Addresses'),
getValue: endpoint => endpoint.getAddresses().join(', '),
render: endpoint => ,
+ gridTemplate: 1.5,
},
'age',
]}
diff --git a/frontend/src/components/endpoints/__snapshots__/EndpointList.stories.storyshot b/frontend/src/components/endpoints/__snapshots__/EndpointList.stories.storyshot
index 2ba122fa426..73953b15ce6 100644
--- a/frontend/src/components/endpoints/__snapshots__/EndpointList.stories.storyshot
+++ b/frontend/src/components/endpoints/__snapshots__/EndpointList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots endpoints/EndpointsListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots endpoints/EndpointsListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/horizontalPodAutoscaler/__snapshots__/HPAList.stories.storyshot b/frontend/src/components/horizontalPodAutoscaler/__snapshots__/HPAList.stories.storyshot
index 437bf836e61..26628ab805a 100644
--- a/frontend/src/components/horizontalPodAutoscaler/__snapshots__/HPAList.stories.storyshot
+++ b/frontend/src/components/horizontalPodAutoscaler/__snapshots__/HPAList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots hpa/HpaListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots hpa/HpaListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
1
10
1
1
10
1
1
10
1
1
10
1
1
10
1
diff --git a/frontend/src/components/ingress/ClassList.tsx b/frontend/src/components/ingress/ClassList.tsx
index 2ebec0389a5..391b3188c31 100644
--- a/frontend/src/components/ingress/ClassList.tsx
+++ b/frontend/src/components/ingress/ClassList.tsx
@@ -17,6 +17,7 @@ export default function IngressClassList() {
{
id: 'default',
label: '',
+ gridTemplate: 0.1,
getValue: resource => (resource?.isDefault ? t('Default Ingress Class') : null),
render: (resource: IngressClass) =>
resource && resource.isDefault ?
: null,
diff --git a/frontend/src/components/ingress/__snapshots__/ClassList.stories.storyshot b/frontend/src/components/ingress/__snapshots__/ClassList.stories.storyshot
index 7c8c15053f0..c6942a246a4 100644
--- a/frontend/src/components/ingress/__snapshots__/ClassList.stories.storyshot
+++ b/frontend/src/components/ingress/__snapshots__/ClassList.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots IngressClass/ListView Items 1`] = `
/>
-
-
-
+ class="Mui-TableHeadCell-Content-Wrapper MuiBox-root css-1sbs8jn"
+ />
test
test
diff --git a/frontend/src/components/ingress/__snapshots__/List.stories.storyshot b/frontend/src/components/ingress/__snapshots__/List.stories.storyshot
index f10848be934..e4b69a90d06 100644
--- a/frontend/src/components/ingress/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/ingress/__snapshots__/List.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots Ingress/ListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots Ingress/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/job/List.tsx b/frontend/src/components/job/List.tsx
index b5037e46e4e..a3fd0026edd 100644
--- a/frontend/src/components/job/List.tsx
+++ b/frontend/src/components/job/List.tsx
@@ -121,6 +121,7 @@ export function JobsListRenderer(props: JobsListRendererProps) {
}
return '-';
},
+ gridTemplate: 0.6,
},
{
id: 'containers',
diff --git a/frontend/src/components/job/__snapshots__/JobList.stories.storyshot b/frontend/src/components/job/__snapshots__/JobList.stories.storyshot
index 773b5ab1109..2ac61d4aecf 100644
--- a/frontend/src/components/job/__snapshots__/JobList.stories.storyshot
+++ b/frontend/src/components/job/__snapshots__/JobList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots Job/List Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots Job/List Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/lease/__snapshots__/List.stories.storyshot b/frontend/src/components/lease/__snapshots__/List.stories.storyshot
index b12bfa2be2b..d0fb1afccfb 100644
--- a/frontend/src/components/lease/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/lease/__snapshots__/List.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots Lease/ListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots Lease/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/limitRange/List.tsx b/frontend/src/components/limitRange/List.tsx
index ca8492fe2e8..894ec6fe4d6 100644
--- a/frontend/src/components/limitRange/List.tsx
+++ b/frontend/src/components/limitRange/List.tsx
@@ -9,7 +9,7 @@ export interface LimitRangeProps {
error: ApiError | null;
hideColumns?: string[];
reflectTableInURL?: SimpleTableProps['reflectInURL'];
- noSearch?: boolean;
+ noNamespaceFilter?: boolean;
}
export function LimitRangeRenderer(props: LimitRangeProps) {
@@ -18,7 +18,7 @@ export function LimitRangeRenderer(props: LimitRangeProps) {
error,
hideColumns = [],
reflectTableInURL = 'limitranges',
- noSearch,
+ noNamespaceFilter,
} = props;
const { t } = useTranslation(['glossary', 'translation']);
@@ -28,7 +28,7 @@ export function LimitRangeRenderer(props: LimitRangeProps) {
columns={['name', 'namespace', 'age']}
hideColumns={hideColumns}
headerProps={{
- noSearch,
+ noNamespaceFilter,
}}
errorMessage={LimitRange.getErrorMessage(error)}
data={limitRanges}
diff --git a/frontend/src/components/limitRange/__snapshots__/List.stories.storyshot b/frontend/src/components/limitRange/__snapshots__/List.stories.storyshot
index 88b82c0351f..110fe44d283 100644
--- a/frontend/src/components/limitRange/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/limitRange/__snapshots__/List.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots LimitRange/ListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots LimitRange/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/namespace/Details.tsx b/frontend/src/components/namespace/Details.tsx
index 3d00178fa0e..e4460de9d9e 100644
--- a/frontend/src/components/namespace/Details.tsx
+++ b/frontend/src/components/namespace/Details.tsx
@@ -48,7 +48,7 @@ export default function NamespaceDetails() {
{
id: 'headlamp.namespace-owned-pods',
section: (
-
+
),
},
{
@@ -77,7 +77,7 @@ export function NamespacedLimitRangesSection(props: NamespacedLimitRangesSection
hideColumns={['namespace']}
limitRanges={limitRanges}
error={error}
- noSearch
+ noNamespaceFilter
/>
);
}
@@ -98,7 +98,7 @@ export function NamespacedResourceQuotasSection(props: NamespacedResourceQuotasS
hideColumns={['namespace']}
resourceQuotas={resourceQuotas}
error={error}
- noSearch
+ noNamespaceFilter
/>
);
}
diff --git a/frontend/src/components/namespace/__snapshots__/NamespaceDetails.stories.storyshot b/frontend/src/components/namespace/__snapshots__/NamespaceDetails.stories.storyshot
index f29b320087d..d00e83b8c61 100644
--- a/frontend/src/components/namespace/__snapshots__/NamespaceDetails.stories.storyshot
+++ b/frontend/src/components/namespace/__snapshots__/NamespaceDetails.stories.storyshot
@@ -199,7 +199,7 @@ exports[`Storyshots Namespace/DetailsView Active 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
@@ -1145,7 +1139,7 @@ exports[`Storyshots Namespace/DetailsView Active 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
@@ -1635,7 +1629,7 @@ exports[`Storyshots Namespace/DetailsView Active 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
0
0/1
0.0.0.2
0
0/1
0.0.0.2
0
0/1
0.0.0.2
337 (3mo ago)
0/1
0.0.0.2
0
0/1
0.0.0.2
0
1/1
0.0.0.2
0
1/1
0.0.0.2
0
1/1
0.0.0.2
diff --git a/frontend/src/components/namespace/__snapshots__/NamespaceList.stories.storyshot b/frontend/src/components/namespace/__snapshots__/NamespaceList.stories.storyshot
index 55f87c918cf..1866d109e1e 100644
--- a/frontend/src/components/namespace/__snapshots__/NamespaceList.stories.storyshot
+++ b/frontend/src/components/namespace/__snapshots__/NamespaceList.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots Namespace/ListView Regular 1`] = `
/>
-
diff --git a/frontend/src/components/node/List.tsx b/frontend/src/components/node/List.tsx
index 49897bd7719..a495c644c9e 100644
--- a/frontend/src/components/node/List.tsx
+++ b/frontend/src/components/node/List.tsx
@@ -25,9 +25,6 @@ export default function NodeList() {
{
id: 'cpu',
label: t('CPU'),
- cellProps: {
- sx: { width: '20%' },
- },
getValue: node => {
const [used] = getResourceMetrics(node, nodeMetrics || [], 'cpu');
return used;
@@ -44,9 +41,6 @@ export default function NodeList() {
{
id: 'memory',
label: t('Memory'),
- cellProps: {
- sx: { width: '20%' },
- },
getValue: node => {
const [used] = getResourceMetrics(node, nodeMetrics || [], 'memory');
return used;
@@ -63,6 +57,7 @@ export default function NodeList() {
{
id: 'ready',
label: t('translation|Ready'),
+ gridTemplate: 'minmax(150px, .3fr)',
getValue: node => {
const isReady = !!node.status.conditions.find(
condition => condition.type === 'Ready' && condition.status === 'True'
@@ -81,6 +76,7 @@ export default function NodeList() {
{
id: 'roles',
label: t('Roles'),
+ gridTemplate: 'minmax(150px, .5fr)',
getValue: node => {
return Object.keys(node.metadata.labels)
.filter((t: String) => t.startsWith('node-role.kubernetes.io/'))
@@ -101,11 +97,13 @@ export default function NodeList() {
{
id: 'version',
label: t('translation|Version'),
+ gridTemplate: 'minmax(150px, .5fr)',
getValue: node => node.status.nodeInfo.kubeletVersion,
},
{
id: 'software',
label: t('translation|Software'),
+ gridTemplate: 'minmax(200px, 1.5fr)',
getValue: node => node.status.nodeInfo.operatingSystem,
render: node => {
let osIcon = 'mdi:desktop-classic';
diff --git a/frontend/src/components/node/__snapshots__/List.stories.storyshot b/frontend/src/components/node/__snapshots__/List.stories.storyshot
index df36dbb598d..17a3d4ddc24 100644
--- a/frontend/src/components/node/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/node/__snapshots__/List.stories.storyshot
@@ -27,29 +27,6 @@ exports[`Storyshots node/List Nodes 1`] = `
/>
-
agent
1.2.3.4
v1.26.3
10.2.3.4
v1.23.12
diff --git a/frontend/src/components/pod/List.tsx b/frontend/src/components/pod/List.tsx
index 1b31a5a9b08..9f374eb8854 100644
--- a/frontend/src/components/pod/List.tsx
+++ b/frontend/src/components/pod/List.tsx
@@ -71,18 +71,10 @@ export interface PodListProps {
hideColumns?: ('namespace' | 'restarts')[];
reflectTableInURL?: SimpleTableProps['reflectInURL'];
noNamespaceFilter?: boolean;
- noSearch?: boolean;
}
export function PodListRenderer(props: PodListProps) {
- const {
- pods,
- error,
- hideColumns = [],
- reflectTableInURL = 'pods',
- noNamespaceFilter,
- noSearch,
- } = props;
+ const { pods, error, hideColumns = [], reflectTableInURL = 'pods', noNamespaceFilter } = props;
const { t } = useTranslation(['glossary', 'translation']);
return (
@@ -90,7 +82,6 @@ export function PodListRenderer(props: PodListProps) {
title={t('Pods')}
headerProps={{
noNamespaceFilter,
- noSearch,
}}
hideColumns={hideColumns}
errorMessage={Pod.getErrorMessage(error)}
@@ -126,7 +117,7 @@ export function PodListRenderer(props: PodListProps) {
{
id: 'ip',
label: t('glossary|IP'),
- getValue: (pod: Pod) => pod.status.podIP,
+ getValue: (pod: Pod) => String(pod.status.podIP),
},
{
id: 'node',
diff --git a/frontend/src/components/pod/__snapshots__/PodList.stories.storyshot b/frontend/src/components/pod/__snapshots__/PodList.stories.storyshot
index f5100f7ffea..992f129ff0c 100644
--- a/frontend/src/components/pod/__snapshots__/PodList.stories.storyshot
+++ b/frontend/src/components/pod/__snapshots__/PodList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots Pod/PodListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots Pod/PodListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
0
0/1
0.0.0.2
0
0/1
0.0.0.2
0
0/1
0.0.0.2
337 (3mo ago)
0/1
0.0.0.2
0
0/1
0.0.0.2
0
1/1
0.0.0.2
0
1/1
0.0.0.2
0
1/1
0.0.0.2
diff --git a/frontend/src/components/podDisruptionBudget/__snapshots__/pdbList.stories.storyshot b/frontend/src/components/podDisruptionBudget/__snapshots__/pdbList.stories.storyshot
index 9d4a6f4c3ca..2fef4cdb6fe 100644
--- a/frontend/src/components/podDisruptionBudget/__snapshots__/pdbList.stories.storyshot
+++ b/frontend/src/components/podDisruptionBudget/__snapshots__/pdbList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots PDB/PDBListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots PDB/PDBListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
1
N/A
1
1
N/A
1
1
N/A
1
1
N/A
1
1
N/A
1
diff --git a/frontend/src/components/priorityClass/__snapshots__/priorityClassList.stories.storyshot b/frontend/src/components/priorityClass/__snapshots__/priorityClassList.stories.storyshot
index b49e71b2426..97096349482 100644
--- a/frontend/src/components/priorityClass/__snapshots__/priorityClassList.stories.storyshot
+++ b/frontend/src/components/priorityClass/__snapshots__/priorityClassList.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots PriorityClass/PriorityClassListView Items 1`] = `
/>
-
1000000
False
1000000
False
1000000
False
1000000
False
1000000
False
diff --git a/frontend/src/components/replicaset/List.tsx b/frontend/src/components/replicaset/List.tsx
index 040d6e48507..c6dd81df4ef 100644
--- a/frontend/src/components/replicaset/List.tsx
+++ b/frontend/src/components/replicaset/List.tsx
@@ -24,16 +24,19 @@ export default function ReplicaSetList() {
id: 'currentReplicas',
label: t('translation|Current', { context: 'replicas' }),
getValue: replicaSet => replicaSet?.status?.replicas || 0,
+ gridTemplate: 0.6,
},
{
id: 'desiredReplicas',
label: t('translation|Desired', { context: 'replicas' }),
getValue: replicaSet => replicaSet?.spec?.replicas || 0,
+ gridTemplate: 0.6,
},
{
id: 'readyReplicas',
label: t('translation|Ready'),
getValue: replicaSet => replicaSet?.status?.readyReplicas || 0,
+ gridTemplate: 0.6,
},
{
id: 'containers',
diff --git a/frontend/src/components/replicaset/__snapshots__/List.stories.storyshot b/frontend/src/components/replicaset/__snapshots__/List.stories.storyshot
index f9e4d2565fb..1c9ffccd405 100644
--- a/frontend/src/components/replicaset/__snapshots__/List.stories.storyshot
+++ b/frontend/src/components/replicaset/__snapshots__/List.stories.storyshot
@@ -36,17 +36,71 @@ exports[`Storyshots ReplicaSet/List Replica Sets 1`] = `
@@ -71,7 +125,7 @@ exports[`Storyshots ReplicaSet/List Replica Sets 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/resourceQuota/List.tsx b/frontend/src/components/resourceQuota/List.tsx
index 1e9a1e378c6..50a5bd88a24 100644
--- a/frontend/src/components/resourceQuota/List.tsx
+++ b/frontend/src/components/resourceQuota/List.tsx
@@ -25,7 +25,7 @@ export interface ResourceQuotaProps {
error: ApiError | null;
hideColumns?: string[];
reflectTableInURL?: SimpleTableProps['reflectInURL'];
- noSearch?: boolean;
+ noNamespaceFilter?: boolean;
}
export function ResourceQuotaRenderer(props: ResourceQuotaProps) {
@@ -34,7 +34,7 @@ export function ResourceQuotaRenderer(props: ResourceQuotaProps) {
error,
hideColumns = [],
reflectTableInURL = 'resourcequotas',
- noSearch,
+ noNamespaceFilter,
} = props;
const { t } = useTranslation(['glossary', 'translation']);
@@ -56,17 +56,11 @@ export function ResourceQuotaRenderer(props: ResourceQuotaProps) {
});
return
{requests} ;
},
- cellProps: {
- style: {
- width: 'fit-content',
- minWidth: '100%',
- },
- },
},
{
id: 'limits',
label: t('translation|Limit'),
- getValue: item => item.limits.join(', '),
+ getValue: item => item?.limits?.join(', '),
render: item => {
const limits: JSX.Element[] = [];
item.limits.forEach((limit: string) => {
@@ -78,7 +72,7 @@ export function ResourceQuotaRenderer(props: ResourceQuotaProps) {
'age',
]}
headerProps={{
- noSearch,
+ noNamespaceFilter,
}}
errorMessage={ResourceQuota.getErrorMessage(error)}
data={resourceQuotas}
diff --git a/frontend/src/components/resourceQuota/__snapshots__/resourceQuotaList.stories.storyshot b/frontend/src/components/resourceQuota/__snapshots__/resourceQuotaList.stories.storyshot
index c907f3b9a57..ec243d0e7f5 100644
--- a/frontend/src/components/resourceQuota/__snapshots__/resourceQuotaList.stories.storyshot
+++ b/frontend/src/components/resourceQuota/__snapshots__/resourceQuotaList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots ResourceQuota/ResourceQuotaListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots ResourceQuota/ResourceQuotaListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/role/BindingList.tsx b/frontend/src/components/role/BindingList.tsx
index 1a6aedb5adf..9b09eeecd14 100644
--- a/frontend/src/components/role/BindingList.tsx
+++ b/frontend/src/components/role/BindingList.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import ClusterRoleBinding from '../../lib/k8s/clusterRoleBinding';
import RoleBinding from '../../lib/k8s/roleBinding';
-import { useErrorState, useFilterFunc } from '../../lib/util';
+import { useErrorState } from '../../lib/util';
import { Link } from '../common';
import LabelListItem from '../common/LabelListItem';
import ResourceListView from '../common/Resource/ResourceListView';
@@ -35,7 +35,6 @@ export default function RoleBindingList() {
const [clusterRoleBindingError, onClusterRoleBindingError] =
useErrorState(setupClusterRoleBindings);
const { t } = useTranslation(['glossary', 'translation']);
- const filterFunc = useFilterFunc
(['.jsonData.kind']);
function setRoleBindings(newBindings: RoleBinding[] | null, kind: string) {
setBindings(currentBindings => ({ ...currentBindings, [kind]: newBindings }));
@@ -100,7 +99,6 @@ export default function RoleBindingList() {
return (
(['.jsonData.kind']);
function setupRolesWithKind(newRoles: Role[] | null, kind: string) {
setRoles(oldRoles => ({ ...(oldRoles || {}), [kind]: newRoles }));
@@ -61,7 +60,6 @@ export default function RoleList() {
return (
-
diff --git a/frontend/src/components/secret/List.tsx b/frontend/src/components/secret/List.tsx
index c0206a9f25f..e4729c372a3 100644
--- a/frontend/src/components/secret/List.tsx
+++ b/frontend/src/components/secret/List.tsx
@@ -1,17 +1,14 @@
import { useTranslation } from 'react-i18next';
import Secret from '../../lib/k8s/secret';
-import { useFilterFunc } from '../../lib/util';
import ResourceListView from '../common/Resource/ResourceListView';
export default function SecretList() {
- const filterFunc = useFilterFunc
(['.jsonData.type']);
const { t } = useTranslation(['glossary', 'translation']);
return (
-
-
-
-
+
+
@@ -68,7 +122,7 @@ exports[`Storyshots Secret/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
diff --git a/frontend/src/components/serviceaccount/List.tsx b/frontend/src/components/serviceaccount/List.tsx
index 471eefe6827..bdf27ed581b 100644
--- a/frontend/src/components/serviceaccount/List.tsx
+++ b/frontend/src/components/serviceaccount/List.tsx
@@ -16,6 +16,7 @@ export default function ServiceAccountList() {
id: 'secrets',
label: t('Secrets'),
getValue: (serviceaccount: ServiceAccount) => serviceaccount?.secrets?.length || 0,
+ gridTemplate: 0.5,
},
'age',
]}
diff --git a/frontend/src/components/statefulset/List.tsx b/frontend/src/components/statefulset/List.tsx
index 8eb6b424026..98479013673 100644
--- a/frontend/src/components/statefulset/List.tsx
+++ b/frontend/src/components/statefulset/List.tsx
@@ -24,11 +24,13 @@ export default function StatefulSetList() {
id: 'pods',
label: t('Pods'),
getValue: statefulSet => renderPods(statefulSet),
+ gridTemplate: 0.6,
},
{
id: 'replicas',
label: t('Replicas'),
getValue: statefulSet => statefulSet.spec.replicas,
+ gridTemplate: 0.6,
},
{
id: 'containers',
diff --git a/frontend/src/components/storage/ClaimList.tsx b/frontend/src/components/storage/ClaimList.tsx
index 8d609a8bf2c..d4552414b25 100644
--- a/frontend/src/components/storage/ClaimList.tsx
+++ b/frontend/src/components/storage/ClaimList.tsx
@@ -35,6 +35,7 @@ export default function VolumeClaimList() {
id: 'capacity',
label: t('Capacity'),
getValue: volumeClaim => volumeClaim.status.capacity?.storage,
+ gridTemplate: 0.8,
},
{
id: 'accessModes',
@@ -68,6 +69,7 @@ export default function VolumeClaimList() {
label: t('translation|Status'),
getValue: volume => volume.status.phase,
render: volume => makePVCStatusLabel(volume),
+ gridTemplate: 0.3,
},
'age',
]}
diff --git a/frontend/src/components/storage/VolumeList.tsx b/frontend/src/components/storage/VolumeList.tsx
index b56e116e3c7..c2017f13ec7 100644
--- a/frontend/src/components/storage/VolumeList.tsx
+++ b/frontend/src/components/storage/VolumeList.tsx
@@ -86,6 +86,7 @@ export default function VolumeList() {
label: t('translation|Status'),
getValue: volume => volume.status?.phase,
render: volume => makePVStatusLabel(volume),
+ gridTemplate: 0.3,
},
'age',
]}
diff --git a/frontend/src/components/storage/__snapshots__/ClaimList.stories.storyshot b/frontend/src/components/storage/__snapshots__/ClaimList.stories.storyshot
index a7b3a2f0789..60d66d7f894 100644
--- a/frontend/src/components/storage/__snapshots__/ClaimList.stories.storyshot
+++ b/frontend/src/components/storage/__snapshots__/ClaimList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots PersistentVolumeClaim/ListView Items 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots PersistentVolumeClaim/ListView Items 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
8Gi
Filesystem
8Gi
Filesystem
8Gi
Block
diff --git a/frontend/src/components/storage/__snapshots__/ClassList.stories.storyshot b/frontend/src/components/storage/__snapshots__/ClassList.stories.storyshot
index 7e856e41b2d..db920d77d86 100644
--- a/frontend/src/components/storage/__snapshots__/ClassList.stories.storyshot
+++ b/frontend/src/components/storage/__snapshots__/ClassList.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots StorageClass/ListView Items 1`] = `
/>
-
csi.test
Delete
WaitForFirstConsumer
diff --git a/frontend/src/components/storage/__snapshots__/VolumeList.stories.storyshot b/frontend/src/components/storage/__snapshots__/VolumeList.stories.storyshot
index c1f6fa6b2ef..90feb4e3489 100644
--- a/frontend/src/components/storage/__snapshots__/VolumeList.stories.storyshot
+++ b/frontend/src/components/storage/__snapshots__/VolumeList.stories.storyshot
@@ -24,29 +24,6 @@ exports[`Storyshots PersistentVolume/ListView Items 1`] = `
/>
-
csi.test
Delete
WaitForFirstConsumer
diff --git a/frontend/src/components/verticalPodAutoscaler/__snapshots__/VPAList.stories.storyshot b/frontend/src/components/verticalPodAutoscaler/__snapshots__/VPAList.stories.storyshot
index b2bcdcf5539..ff09f0ad75d 100644
--- a/frontend/src/components/verticalPodAutoscaler/__snapshots__/VPAList.stories.storyshot
+++ b/frontend/src/components/verticalPodAutoscaler/__snapshots__/VPAList.stories.storyshot
@@ -33,17 +33,71 @@ exports[`Storyshots VPA/VPAListView List 1`] = `
@@ -68,7 +122,7 @@ exports[`Storyshots VPA/VPAListView List 1`] = `
class="MuiCollapse-wrapperInner MuiCollapse-vertical css-9l5vo-MuiCollapse-wrapperInner"
>
1
2Gi
True
1
2Gi
True
1
2Gi
True
1
2Gi
True
1
2Gi
True
diff --git a/frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigList.stories.storyshot b/frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigList.stories.storyshot
index 73a52546a63..725e352dcbc 100644
--- a/frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigList.stories.storyshot
+++ b/frontend/src/components/webhookconfiguration/__snapshots__/MutatingWebhookConfigList.stories.storyshot
@@ -27,29 +27,6 @@ exports[`Storyshots WebhookConfiguration/MutatingWebhookConfig/List Items 1`] =
/>
-
diff --git a/frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigList.stories.storyshot b/frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigList.stories.storyshot
index 45698fdd24c..febbe4b4a5c 100644
--- a/frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigList.stories.storyshot
+++ b/frontend/src/components/webhookconfiguration/__snapshots__/ValidatingWebhookConfigList.stories.storyshot
@@ -27,29 +27,6 @@ exports[`Storyshots WebhookConfiguration/ValidatingWebhookConfig/List Items 1`]
/>
-
diff --git a/frontend/src/components/workload/Overview.tsx b/frontend/src/components/workload/Overview.tsx
index 7b569657d0a..d02a77e3917 100644
--- a/frontend/src/components/workload/Overview.tsx
+++ b/frontend/src/components/workload/Overview.tsx
@@ -12,7 +12,7 @@ import Job from '../../lib/k8s/job';
import Pod from '../../lib/k8s/pod';
import ReplicaSet from '../../lib/k8s/replicaSet';
import StatefulSet from '../../lib/k8s/statefulSet';
-import { getReadyReplicas, getTotalReplicas, useFilterFunc } from '../../lib/util';
+import { getReadyReplicas, getTotalReplicas } from '../../lib/util';
import { PageGrid, ResourceLink } from '../common/Resource';
import ResourceListView from '../common/Resource/ResourceListView';
import { SectionBox } from '../common/SectionBox';
@@ -25,7 +25,6 @@ interface WorkloadDict {
export default function Overview() {
const [workloadsData, setWorkloadsData] = React.useState
({});
const location = useLocation();
- const filterFunc = useFilterFunc(['.jsonData.kind']);
const { t } = useTranslation('glossary');
const cluster = useCluster();
@@ -113,7 +112,6 @@ export default function Overview() {
(matchCriteria?: string[]) {
const filter = useTypedSelector(state => state.filter);
- return (item: T) => {
+ return (item: T, search?: string) => {
if (!!item.metadata) {
- return filterResource(item as KubeObjectInterface | KubeEvent, filter, matchCriteria);
+ return filterResource(item as KubeObjectInterface | KubeEvent, filter, search, matchCriteria);
}
- return filterGeneric(item, filter, matchCriteria);
+ return filterGeneric(item, search, matchCriteria);
};
}
diff --git a/frontend/src/redux/filterSlice.test.ts b/frontend/src/redux/filterSlice.test.ts
index cc74a6a83cd..37d67948851 100644
--- a/frontend/src/redux/filterSlice.test.ts
+++ b/frontend/src/redux/filterSlice.test.ts
@@ -3,7 +3,6 @@ import filterReducer, {
initialState,
resetFilter,
setNamespaceFilter,
- setSearchFilter,
} from './filterSlice';
describe('filterSlice', () => {
@@ -19,17 +18,10 @@ describe('filterSlice', () => {
expect(state.namespaces).toEqual(new Set(namespaces));
});
- it('should handle setSearchFilter', () => {
- const search = 'pod';
- state = filterReducer(state, setSearchFilter(search));
- expect(state.search).toEqual(search);
- });
-
it('should handle resetFilter', () => {
state = {
...state,
namespaces: new Set(['default']),
- search: 'pod',
};
state = filterReducer(state, resetFilter());
diff --git a/frontend/src/redux/filterSlice.ts b/frontend/src/redux/filterSlice.ts
index 04655d88362..4497054de68 100644
--- a/frontend/src/redux/filterSlice.ts
+++ b/frontend/src/redux/filterSlice.ts
@@ -6,13 +6,10 @@ import { KubeEvent } from '../lib/k8s/event';
export interface FilterState {
/** The namespaces to filter on. */
namespaces: Set;
- /** The search string to filter on. */
- search: string;
}
export const initialState: FilterState = {
namespaces: new Set(),
- search: '',
};
/**
@@ -27,6 +24,7 @@ export const initialState: FilterState = {
export function filterResource(
item: KubeObjectInterface | KubeEvent,
filter: FilterState,
+ search?: string,
matchCriteria?: string[]
) {
let matches: boolean = true;
@@ -39,8 +37,8 @@ export function filterResource(
return false;
}
- if (filter.search) {
- const filterString = filter.search.toLowerCase();
+ if (search) {
+ const filterString = search.toLowerCase();
const usedMatchCriteria = [
item.metadata.uid.toLowerCase(),
item.metadata.namespace ? item.metadata.namespace.toLowerCase() : '',
@@ -54,7 +52,7 @@ export function filterResource(
return true;
}
- matches = filterGeneric(item, filter, matchCriteria);
+ matches = filterGeneric(item, search, matchCriteria);
}
return matches;
@@ -72,14 +70,14 @@ export function filterResource(
*/
export function filterGeneric(
item: T,
- filter: FilterState,
+ search?: string,
matchCriteria?: string[]
) {
- if (!filter.search) {
+ if (!search) {
return true;
}
- const filterString = filter.search.toLowerCase();
+ const filterString = search.toLowerCase();
const usedMatchCriteria: string[] = [];
// Use the custom matchCriteria if any
@@ -124,22 +122,15 @@ const filterSlice = createSlice({
setNamespaceFilter(state, action: PayloadAction) {
state.namespaces = new Set(action.payload);
},
- /**
- * Sets the search filter with a string.
- */
- setSearchFilter(state, action: PayloadAction) {
- state.search = action.payload;
- },
/**
* Resets the filter state.
*/
resetFilter(state) {
state.namespaces = new Set();
- state.search = '';
},
},
});
-export const { setNamespaceFilter, setSearchFilter, resetFilter } = filterSlice.actions;
+export const { setNamespaceFilter, resetFilter } = filterSlice.actions;
export default filterSlice.reducer;