diff --git a/frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx b/frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx index eee4c6fa9d..c04151b4fc 100644 --- a/frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx +++ b/frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/explicit-function-return-type */ import './InfraMonitoringK8s.styles.scss'; import { Button, Input } from 'antd'; @@ -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 { @@ -127,4 +128,11 @@ function K8sHeader({ ); } +K8sHeader.defaultProps = { + addedColumns: [], + availableColumns: [], + onAddColumn: () => {}, + onRemoveColumn: () => {}, +}; + export default K8sHeader; diff --git a/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx b/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx index a0ff5608d4..ae75ea16dd 100644 --- a/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx +++ b/frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx @@ -163,11 +163,7 @@ function K8sNodesList({ isFiltersVisible={isFiltersVisible} handleFilterVisibilityChange={handleFilterVisibilityChange} defaultAddedColumns={defaultAddedColumns} - addedColumns={[]} - availableColumns={[]} handleFiltersChange={handleFiltersChange} - onAddColumn={() => {}} - onRemoveColumn={() => {}} /> {isError && {data?.error || 'Something went wrong'}}