-
Notifications
You must be signed in to change notification settings - Fork 594
/
filter-utils.ts
42 lines (35 loc) · 1.12 KB
/
filter-utils.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { RootState } from '@console/internal/redux';
import { getQueryArgument } from '@console/internal/components/utils';
export const TOPOLOGY_SEARCH_FILTER_KEY = 'searchQuery';
export const FILTER_ACTIVE_CLASS = 'odc-m-filter-active';
export enum ShowFiltersKeyValue {
podCount = 'Pod Count',
eventSources = 'Event Sources',
virtualMachines = 'Virtual Machines',
showLabels = 'Show Labels',
}
export enum ExpandFiltersKeyValue {
appGrouping = 'Application Groupings',
helmGrouping = 'Helm Releases',
knativeServices = 'Knative Services',
operatorGrouping = 'Operator Groupings',
}
export const getTopologyFilters = ({
plugins: {
devconsole: { topology },
},
}: RootState): TopologyFilters => topology.get('filters');
export const getTopologySearchQuery = () => getQueryArgument(TOPOLOGY_SEARCH_FILTER_KEY) ?? '';
export type TopologyFilters = {
display: DisplayFilters;
};
export type DisplayFilters = {
podCount: boolean;
eventSources: boolean;
virtualMachines: boolean;
showLabels: boolean;
knativeServices: boolean;
appGrouping: boolean;
operatorGrouping: boolean;
helmGrouping: boolean;
};