-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathpagination-table-headers.js
More file actions
120 lines (103 loc) · 3.45 KB
/
pagination-table-headers.js
File metadata and controls
120 lines (103 loc) · 3.45 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import { UI_PROJECT_SECRET_COPY } from '@shell/config/labels-annotations';
import {
STATE, NAME as NAME_COL, NAMESPACE as NAMESPACE_COL, AGE, OBJECT,
EVENT_LAST_SEEN_TIME,
EVENT_TYPE,
SECRET_ORIGIN,
EVENT_FIRST_SEEN_TIME,
WORKLOAD_HEALTH_SCALE,
MGMT_CLUSTER_PROVIDER,
MGMT_CLUSTER_KUBE_VERSION,
AUTOSCALER_ENABLED
} from '@shell/config/table-headers';
// This file contains table headers
// These table headers are used for server side pagination
// They MUST contain sort and search values that are paths to raw properties (not computed properties in models)
// They SHOULD avoid formatters that change the value from the same used by sort and search (user will see an order that doesn't match what they see)
export const STEVE_NAME_COL = {
...NAME_COL,
defaultSort: true,
value: 'metadata.name',
sort: ['metadata.name'],
search: 'metadata.name',
};
export const STEVE_ID_COL = {
name: 'steve-id',
labelKey: 'tableHeaders.id',
value: 'id',
sort: ['id'],
search: 'id',
};
export const STEVE_STATE_COL = {
// Note, we're show the 'state' as per model, not the 'metadata.state.name' that's available in the model to remotely sort/filter
...STATE,
// non vai sort works on colour --> name. the best we can do here is error --> transitioning --> name
sort: ['metadata.state.error:desc', 'metadata.state.transitioning:desc', 'metadata.state.name'],
search: 'metadata.state.name',
};
export const STEVE_AGE_COL = {
...AGE,
value: 'metadata.creationTimestamp',
sort: 'metadata.creationTimestamp',
search: false,
};
export const STEVE_NAMESPACE_COL = {
...NAMESPACE_COL,
value: 'metadata.namespace',
sort: 'metadata.namespace',
search: 'metadata.namespace',
};
export const STEVE_EVENT_OBJECT = {
...OBJECT,
sort: 'involvedObject.kind',
search: 'involvedObject.kind',
};
export const STEVE_EVENT_FIRST_SEEN = {
...EVENT_FIRST_SEEN_TIME,
value: 'metadata.fields.7',
sort: 'metadata.fields.7:desc',
};
export const STEVE_EVENT_LAST_SEEN = {
...EVENT_LAST_SEEN_TIME,
value: 'metadata.fields.0',
sort: 'metadata.fields.0:desc',
};
export const STEVE_EVENT_TYPE = {
...EVENT_TYPE,
value: '_type',
sort: '_type',
};
export const STEVE_LIST_GROUPS = [{
tooltipKey: 'resourceTable.groupBy.none',
icon: 'icon-list-flat',
value: 'none',
}, {
icon: 'icon-folder',
value: 'metadata.namespace',
field: 'metadata.namespace', // Default groupByLabel field in models is NS based
hideColumn: NAMESPACE_COL.name,
tooltipKey: 'resourceTable.groupBy.namespace',
groupLabelKey: 'groupByLabel',
}];
export const STEVE_SECRET_ORIGIN = {
...SECRET_ORIGIN,
// We can't sort by the 'UI_PROJECT_SECRET' label (management.cattle.io/project-scoped-secret) due to backend limitations.
// So we sort by the 'UI_PROJECT_SECRET_COPY' annotation (management.cattle.io/project-scoped-secret-copy) which at least groups the copies.
sort: `metadata.annotations[${ UI_PROJECT_SECRET_COPY }]:desc`,
};
export const STEVE_WORKLOAD_HEALTH_SCALE = {
...WORKLOAD_HEALTH_SCALE,
sort: false,
search: false,
};
export const STEVE_MGMT_CLUSTER_PROVIDER = { ...MGMT_CLUSTER_PROVIDER };
export const STEVE_MGMT_CLUSTER_KUBE_VERSION = {
...MGMT_CLUSTER_KUBE_VERSION,
sort: 'status.info.kubernetesVersion',
search: 'status.info.kubernetesVersion',
};
export const STEVE_AUTOSCALER_ENABLED = {
...AUTOSCALER_ENABLED,
sort: false,
search: false,
};