@@ -5,6 +5,7 @@ import {useDispatch} from 'react-redux';
55import DataTable from '@gravity-ui/react-data-table' ;
66
77import type { EPathType } from '../../types/api/schema' ;
8+ import type { ValueOf } from '../../types/common' ;
89
910import { AccessDenied } from '../../components/Errors/403' ;
1011import { Illustration } from '../../components/Illustration' ;
@@ -16,11 +17,7 @@ import {EntitiesCount} from '../../components/EntitiesCount';
1617
1718import routes , { CLUSTER_PAGES , createHref } from '../../routes' ;
1819
19- import {
20- ALL ,
21- DEFAULT_TABLE_SETTINGS ,
22- USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY ,
23- } from '../../utils/constants' ;
20+ import { DEFAULT_TABLE_SETTINGS , USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY } from '../../utils/constants' ;
2421import { useAutofetcher , useSetting , useTypedSelector } from '../../utils/hooks' ;
2522import { AdditionalNodesInfo , isUnavailableNode , NodesUptimeFilterValues } from '../../utils/nodes' ;
2623
@@ -33,7 +30,7 @@ import {
3330 resetNodesState ,
3431 getComputeNodes ,
3532} from '../../store/reducers/nodes' ;
36- import { changeFilter } from '../../store/reducers/settings' ;
33+ import { changeFilter , ProblemFilterValues } from '../../store/reducers/settings /settings' ;
3734import { hideTooltip , showTooltip } from '../../store/reducers/tooltip' ;
3835
3936import { isDatabaseEntityType } from '../Tenant/utils/schema' ;
@@ -104,7 +101,7 @@ export const Nodes = ({path, type, className, additionalNodesInfo = {}}: NodesPr
104101 } ;
105102
106103 const handleProblemFilterChange = ( value : string ) => {
107- dispatch ( changeFilter ( value ) ) ;
104+ dispatch ( changeFilter ( value as ValueOf < typeof ProblemFilterValues > ) ) ;
108105 } ;
109106
110107 const handleUptimeFilterChange = ( value : string ) => {
@@ -148,7 +145,10 @@ export const Nodes = ({path, type, className, additionalNodesInfo = {}}: NodesPr
148145 } ) ;
149146
150147 if ( nodes && nodes . length === 0 ) {
151- if ( problemFilter !== ALL || nodesUptimeFilter !== NodesUptimeFilterValues . All ) {
148+ if (
149+ problemFilter !== ProblemFilterValues . ALL ||
150+ nodesUptimeFilter !== NodesUptimeFilterValues . All
151+ ) {
152152 return < Illustration name = "thumbsUp" width = "200" /> ;
153153 }
154154 }
0 commit comments