Skip to content

Commit

Permalink
chore: update header props
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Dec 11, 2024
1 parent 9db3076 commit 2e8350b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
24 changes: 16 additions & 8 deletions frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import './InfraMonitoringK8s.styles.scss';

import { Button, Input } from 'antd';
Expand All @@ -13,20 +14,20 @@ import { IPodColumn } from './utils';

function K8sHeader({
defaultAddedColumns,
addedColumns,
availableColumns,
addedColumns = [],
availableColumns = [],
handleFiltersChange,
onAddColumn,
onRemoveColumn,
onAddColumn = () => {},
onRemoveColumn = () => {},
handleFilterVisibilityChange,
isFiltersVisible,
}: {
defaultAddedColumns: IPodColumn[];
addedColumns: IPodColumn[];
availableColumns: IPodColumn[];
addedColumns?: IPodColumn[];
availableColumns?: IPodColumn[];
handleFiltersChange: (value: IBuilderQuery['filters']) => void;
onAddColumn: (column: IPodColumn) => void;
onRemoveColumn: (column: IPodColumn) => void;
onAddColumn?: (column: IPodColumn) => void;
onRemoveColumn?: (column: IPodColumn) => void;
handleFilterVisibilityChange: () => void;
isFiltersVisible: boolean;
}): JSX.Element {
Expand Down Expand Up @@ -127,4 +128,11 @@ function K8sHeader({
);
}

K8sHeader.defaultProps = {
addedColumns: [],
availableColumns: [],
onAddColumn: () => {},
onRemoveColumn: () => {},
};

export default K8sHeader;
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ function K8sNodesList({
isFiltersVisible={isFiltersVisible}
handleFilterVisibilityChange={handleFilterVisibilityChange}
defaultAddedColumns={defaultAddedColumns}
addedColumns={[]}
availableColumns={[]}
handleFiltersChange={handleFiltersChange}
onAddColumn={() => {}}
onRemoveColumn={() => {}}
/>
{isError && <Typography>{data?.error || 'Something went wrong'}</Typography>}

Expand Down

0 comments on commit 2e8350b

Please sign in to comment.