@centreon/ui 23.10.32-MON-19938-cloud-notifications-fix-search-select-boxes.2 → 23.10.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -12
- package/src/Dashboard/DashboardLayout.stories.tsx +5 -3
- package/src/Dashboard/Layout.tsx +4 -4
- package/src/Dashboard/utils.ts +28 -28
- package/src/Form/Inputs/ConnectedAutocomplete.tsx +3 -13
- package/src/Form/Inputs/models.ts +0 -13
- package/src/InputField/Select/Autocomplete/Connected/index.tsx +0 -10
- package/src/ThemeProvider/index.tsx +5 -6
- package/src/ThemeProvider/palettes.ts +215 -389
- package/src/api/TestQueryProvider.tsx +1 -2
- package/src/api/useFetchQuery/index.ts +7 -8
- package/src/api/useMutationQuery/index.ts +10 -11
- package/src/components/Button/Button.styles.ts +3 -17
- package/src/components/Button/Button.tsx +3 -6
- package/src/components/Button/Icon/IconButton.styles.ts +2 -9
- package/src/components/DataTable/DataTable.stories.tsx +0 -9
- package/src/components/DataTable/DataTable.styles.ts +0 -5
- package/src/components/DataTable/DataTable.tsx +6 -8
- package/src/components/DataTable/EmptyState/DataTableEmptyState.tsx +1 -4
- package/src/components/DataTable/Item/DataTableItem.styles.ts +2 -5
- package/src/components/DataTable/Item/DataTableItem.tsx +18 -36
- package/src/components/Header/Header.stories.tsx +27 -0
- package/src/components/Header/Header.styles.ts +27 -0
- package/src/components/Header/Header.tsx +23 -0
- package/src/components/Header/index.ts +1 -1
- package/src/components/Modal/index.ts +0 -2
- package/src/components/index.ts +0 -3
- package/src/index.ts +2 -0
- package/src/layout/TiledListingPage/TiledListingActions.tsx +15 -0
- package/src/layout/TiledListingPage/TiledListingContent.tsx +21 -0
- package/src/layout/TiledListingPage/TiledListingList.tsx +11 -0
- package/src/layout/TiledListingPage/TiledListingPage.styles.ts +16 -0
- package/src/layout/TiledListingPage/TiledListingPage.tsx +15 -0
- package/src/layout/TiledListingPage/index.ts +4 -0
- package/src/screens/dashboard/DashboardsOverview.stories.tsx +102 -110
- package/src/utils/index.ts +1 -1
- package/src/utils/sanitizedHTML.ts +1 -1
- package/test/setupTests.js +1 -1
- package/src/base/tokens/README.md +0 -3
- package/src/base/tokens/source/$metadata.json +0 -5
- package/src/base/tokens/source/base.json +0 -142
- package/src/base/tokens/themes/base.tokens.d.ts +0 -38
- package/src/base/tokens/themes/base.tokens.json +0 -695
- package/src/base/tokens/themes/base.tokens.ts +0 -38
- package/src/base/tokens/themes/ui-dark.tokens.d.ts +0 -38
- package/src/base/tokens/themes/ui-dark.tokens.json +0 -695
- package/src/base/tokens/themes/ui-dark.tokens.ts +0 -38
- package/src/base/tokens/themes/ui-light.tokens.d.ts +0 -38
- package/src/base/tokens/themes/ui-light.tokens.json +0 -695
- package/src/base/tokens/themes/ui-light.tokens.ts +0 -38
- package/src/components/Header/PageHeader/PageHeader.stories.tsx +0 -88
- package/src/components/Header/PageHeader/PageHeader.styles.ts +0 -99
- package/src/components/Header/PageHeader/PageHeader.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderActions.tsx +0 -17
- package/src/components/Header/PageHeader/PageHeaderMain.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderMenu.tsx +0 -15
- package/src/components/Header/PageHeader/PageHeaderTitle.tsx +0 -47
- package/src/components/Header/PageHeader/index.ts +0 -12
- package/src/components/Layout/AreaIndicator.styles.ts +0 -33
- package/src/components/Layout/AreaIndicator.tsx +0 -35
- package/src/components/Layout/PageLayout/PageLayout.stories.tsx +0 -81
- package/src/components/Layout/PageLayout/PageLayout.styles.ts +0 -40
- package/src/components/Layout/PageLayout/PageLayout.tsx +0 -21
- package/src/components/Layout/PageLayout/PageLayoutActions.tsx +0 -15
- package/src/components/Layout/PageLayout/PageLayoutBody.tsx +0 -24
- package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +0 -15
- package/src/components/Layout/PageLayout/index.ts +0 -10
- package/src/components/Layout/index.ts +0 -1
- package/src/components/Menu/Button/MenuButton.stories.tsx +0 -16
- package/src/components/Menu/Button/MenuButton.styles.ts +0 -27
- package/src/components/Menu/Button/MenuButton.tsx +0 -62
- package/src/components/Menu/Button/index.ts +0 -1
- package/src/components/Menu/Menu.stories.tsx +0 -71
- package/src/components/Menu/Menu.styles.ts +0 -70
- package/src/components/Menu/Menu.tsx +0 -25
- package/src/components/Menu/MenuDivider.tsx +0 -13
- package/src/components/Menu/MenuItem.tsx +0 -36
- package/src/components/Menu/MenuItems.tsx +0 -35
- package/src/components/Menu/index.ts +0 -12
- package/src/components/Menu/useMenu.tsx +0 -79
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +0 -70
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +0 -5
- package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +0 -115
- package/src/components/Tooltip/TextOverflowTooltip/index.tsx +0 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -41
- package/src/components/Tooltip/Tooltip.styles.ts +0 -5
- package/src/components/Tooltip/Tooltip.tsx +0 -46
- package/src/components/Tooltip/index.ts +0 -1
- package/src/screens/dashboard/DashboardsDetail.stories.tsx +0 -108
- package/src/styles/tokens/themes/_ui-dark.tokens.json +0 -695
- package/src/styles/tokens/themes/_ui-light.tokens.json +0 -695
- package/src/utils/useResizeObserver.ts +0 -6
|
@@ -1,389 +1,215 @@
|
|
|
1
|
-
import { equals } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import { alpha, PaletteOptions } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
import { ThemeMode } from '@centreon/ui-context';
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
contrastText: '#
|
|
179
|
-
main: '#
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
hover: BaseTokens.colorGrey950
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
mode: ThemeMode.light,
|
|
221
|
-
pending: {
|
|
222
|
-
contrastText: '#000',
|
|
223
|
-
main: '#1EBEB3'
|
|
224
|
-
},
|
|
225
|
-
primary: {
|
|
226
|
-
contrastText: '#fff',
|
|
227
|
-
dark: '#255891',
|
|
228
|
-
light: '#cde7fc',
|
|
229
|
-
main: '#2E68AA'
|
|
230
|
-
},
|
|
231
|
-
secondary: {
|
|
232
|
-
contrastText: '#fff',
|
|
233
|
-
dark: '#ac28c1',
|
|
234
|
-
light: '#e5a5f0',
|
|
235
|
-
main: '#C772D6'
|
|
236
|
-
},
|
|
237
|
-
statusBackground: {
|
|
238
|
-
error: '#FF6666',
|
|
239
|
-
none: alpha('#2E68AA', 0.1),
|
|
240
|
-
pending: '#1EBEB3',
|
|
241
|
-
success: '#88B922',
|
|
242
|
-
unknown: '#E3E3E3',
|
|
243
|
-
warning: '#FD9B27'
|
|
244
|
-
},
|
|
245
|
-
success: {
|
|
246
|
-
contrastText: '#000',
|
|
247
|
-
main: '#88B922'
|
|
248
|
-
},
|
|
249
|
-
text: {
|
|
250
|
-
disabled: '#999999',
|
|
251
|
-
primary: '#000000',
|
|
252
|
-
secondary: '#666666'
|
|
253
|
-
},
|
|
254
|
-
warning: {
|
|
255
|
-
contrastText: '#000',
|
|
256
|
-
main: '#FD9B27'
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
export const darkPalette: PaletteOptions = {
|
|
261
|
-
action: {
|
|
262
|
-
acknowledged: '#67532C',
|
|
263
|
-
acknowledgedBackground: '#67532C',
|
|
264
|
-
activatedOpacity: 0.3,
|
|
265
|
-
active: '#B5B5B5',
|
|
266
|
-
disabled: '#999999',
|
|
267
|
-
disabledBackground: '#555555',
|
|
268
|
-
focus: 'rgba(255, 255, 255, 0.30)',
|
|
269
|
-
focusOpacity: 0.3,
|
|
270
|
-
hover: 'rgba(255, 255, 255, 0.16)',
|
|
271
|
-
hoverOpacity: 0.16,
|
|
272
|
-
inDowntime: '#4B2352',
|
|
273
|
-
inDowntimeBackground: '#4B2352',
|
|
274
|
-
selected: 'rgba(255, 255, 255, 0.5)',
|
|
275
|
-
selectedOpacity: 0.5
|
|
276
|
-
},
|
|
277
|
-
background: {
|
|
278
|
-
default: '#4a4a4a',
|
|
279
|
-
listingHeader: '#666666',
|
|
280
|
-
panel: '#4a4a4a',
|
|
281
|
-
panelGroups: '#252525',
|
|
282
|
-
paper: '#212121',
|
|
283
|
-
tooltip: '#AAB4C0'
|
|
284
|
-
},
|
|
285
|
-
divider: '#666666',
|
|
286
|
-
error: {
|
|
287
|
-
contrastText: '#fff',
|
|
288
|
-
main: '#D60101'
|
|
289
|
-
},
|
|
290
|
-
header: {
|
|
291
|
-
page: {
|
|
292
|
-
action: {
|
|
293
|
-
background: {
|
|
294
|
-
active: '#1975D10F',
|
|
295
|
-
default: '#FFFFFF00'
|
|
296
|
-
},
|
|
297
|
-
color: {
|
|
298
|
-
active: '#1976D2',
|
|
299
|
-
default: '#696969'
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
border: '#bdbdbd',
|
|
303
|
-
description: '#bdbdbd',
|
|
304
|
-
title: '#fff'
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
info: {
|
|
308
|
-
contrastText: '#fff',
|
|
309
|
-
main: '#1CA9F4'
|
|
310
|
-
},
|
|
311
|
-
layout: {
|
|
312
|
-
body: {
|
|
313
|
-
background: '#F6F6F6'
|
|
314
|
-
},
|
|
315
|
-
header: {
|
|
316
|
-
background: '#FFFFFF',
|
|
317
|
-
border: '#E3E3E3'
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
menu: {
|
|
321
|
-
background: BaseTokens.colorGrey950,
|
|
322
|
-
button: {
|
|
323
|
-
background: {
|
|
324
|
-
active: BaseTokens.colorBlue950,
|
|
325
|
-
default: 'transparent',
|
|
326
|
-
hover: BaseTokens.colorGrey950
|
|
327
|
-
},
|
|
328
|
-
color: {
|
|
329
|
-
active: BaseTokens.colorBlue600,
|
|
330
|
-
default: BaseTokens.colorGrey600,
|
|
331
|
-
hover: BaseTokens.colorGrey500
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
divider: {
|
|
335
|
-
border: BaseTokens.colorGrey800
|
|
336
|
-
},
|
|
337
|
-
item: {
|
|
338
|
-
background: {
|
|
339
|
-
active: BaseTokens.colorBlue950,
|
|
340
|
-
default: 'transparent',
|
|
341
|
-
hover: BaseTokens.colorGrey950
|
|
342
|
-
},
|
|
343
|
-
color: {
|
|
344
|
-
active: BaseTokens.colorBlue400,
|
|
345
|
-
default: BaseTokens.colorGrey50,
|
|
346
|
-
hover: '#fff'
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
mode: ThemeMode.dark,
|
|
351
|
-
pending: {
|
|
352
|
-
contrastText: '#fff',
|
|
353
|
-
main: '#118077'
|
|
354
|
-
},
|
|
355
|
-
primary: {
|
|
356
|
-
contrastText: '#000',
|
|
357
|
-
dark: '#4974A5',
|
|
358
|
-
light: '#8bbff9',
|
|
359
|
-
main: '#6eaff8'
|
|
360
|
-
},
|
|
361
|
-
secondary: {
|
|
362
|
-
contrastText: '#fff',
|
|
363
|
-
main: '#7C1FA2'
|
|
364
|
-
},
|
|
365
|
-
statusBackground: {
|
|
366
|
-
error: '#D60101',
|
|
367
|
-
none: alpha('#2E68AA', 0.1),
|
|
368
|
-
pending: '#118077',
|
|
369
|
-
success: '#5F8118',
|
|
370
|
-
unknown: '#666666',
|
|
371
|
-
warning: '#C55400'
|
|
372
|
-
},
|
|
373
|
-
success: {
|
|
374
|
-
contrastText: '#fff',
|
|
375
|
-
main: '#5F8118'
|
|
376
|
-
},
|
|
377
|
-
text: {
|
|
378
|
-
disabled: '#666666',
|
|
379
|
-
primary: '#FFFFFF',
|
|
380
|
-
secondary: '#CCCCCC'
|
|
381
|
-
},
|
|
382
|
-
warning: {
|
|
383
|
-
contrastText: '#fff',
|
|
384
|
-
main: '#C55400'
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
export const getPalette = (mode: ThemeMode): PaletteOptions =>
|
|
389
|
-
equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
|
|
1
|
+
import { equals } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { alpha, PaletteOptions } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
import { ThemeMode } from '@centreon/ui-context';
|
|
6
|
+
|
|
7
|
+
declare module '@mui/material/styles/createPalette' {
|
|
8
|
+
interface TypeAction {
|
|
9
|
+
acknowledged: string;
|
|
10
|
+
acknowledgedBackground: string;
|
|
11
|
+
inDowntime: string;
|
|
12
|
+
inDowntimeBackground: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '@mui/material/styles' {
|
|
17
|
+
interface Palette {
|
|
18
|
+
background: {
|
|
19
|
+
default: string;
|
|
20
|
+
listingHeader: string;
|
|
21
|
+
panel: string;
|
|
22
|
+
panelGroups: string;
|
|
23
|
+
paper: string;
|
|
24
|
+
tooltip: string;
|
|
25
|
+
};
|
|
26
|
+
pending: {
|
|
27
|
+
contrastText: string;
|
|
28
|
+
main: string;
|
|
29
|
+
};
|
|
30
|
+
statusBackground: StatusBackground;
|
|
31
|
+
}
|
|
32
|
+
interface StatusBackground {
|
|
33
|
+
error: string;
|
|
34
|
+
none: string;
|
|
35
|
+
pending: string;
|
|
36
|
+
success: string;
|
|
37
|
+
unknown: string;
|
|
38
|
+
warning: string;
|
|
39
|
+
}
|
|
40
|
+
interface PaletteOptions {
|
|
41
|
+
pending: {
|
|
42
|
+
contrastText: string;
|
|
43
|
+
main: string;
|
|
44
|
+
};
|
|
45
|
+
statusBackground: StatusBackground;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface TypeBackground {
|
|
49
|
+
default: string;
|
|
50
|
+
listingHeader: string;
|
|
51
|
+
panel: string;
|
|
52
|
+
panelGroups: string;
|
|
53
|
+
paper: string;
|
|
54
|
+
tooltip: string;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare module '@mui/material/Button' {
|
|
59
|
+
interface ButtonPropsColorOverrides {
|
|
60
|
+
pending: true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare module '@mui/material/Badge' {
|
|
65
|
+
interface BadgePropsColorOverrides {
|
|
66
|
+
pending: true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const lightPalette: PaletteOptions = {
|
|
71
|
+
action: {
|
|
72
|
+
acknowledged: '#67532C',
|
|
73
|
+
acknowledgedBackground: '#F5F1E9',
|
|
74
|
+
activatedOpacity: 0.12,
|
|
75
|
+
active: '#666666',
|
|
76
|
+
disabled: '#999999',
|
|
77
|
+
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
78
|
+
focus: 'rgba(0, 0, 0, 0.12)',
|
|
79
|
+
focusOpacity: 0.12,
|
|
80
|
+
hover: 'rgba(0, 0, 0, 0.06)',
|
|
81
|
+
hoverOpacity: 0.06,
|
|
82
|
+
inDowntime: '#4B2352',
|
|
83
|
+
inDowntimeBackground: '#F0E9F8',
|
|
84
|
+
selected: 'rgba(102, 102, 102, 0.3)',
|
|
85
|
+
selectedOpacity: 0.3
|
|
86
|
+
},
|
|
87
|
+
background: {
|
|
88
|
+
default: '#F4F4F4',
|
|
89
|
+
listingHeader: '#666666',
|
|
90
|
+
panel: '#EDEDED',
|
|
91
|
+
panelGroups: '#F5F5F5',
|
|
92
|
+
paper: '#FFFFFF',
|
|
93
|
+
tooltip: '#434E5B'
|
|
94
|
+
},
|
|
95
|
+
divider: '#E3E3E3',
|
|
96
|
+
error: {
|
|
97
|
+
contrastText: '#000',
|
|
98
|
+
main: '#FF4A4A'
|
|
99
|
+
},
|
|
100
|
+
info: {
|
|
101
|
+
contrastText: '#000',
|
|
102
|
+
main: '#1588D1'
|
|
103
|
+
},
|
|
104
|
+
mode: ThemeMode.light,
|
|
105
|
+
pending: {
|
|
106
|
+
contrastText: '#000',
|
|
107
|
+
main: '#1EBEB3'
|
|
108
|
+
},
|
|
109
|
+
primary: {
|
|
110
|
+
contrastText: '#fff',
|
|
111
|
+
dark: '#255891',
|
|
112
|
+
light: '#cde7fc',
|
|
113
|
+
main: '#2E68AA'
|
|
114
|
+
},
|
|
115
|
+
secondary: {
|
|
116
|
+
contrastText: '#fff',
|
|
117
|
+
main: '#C772D6'
|
|
118
|
+
},
|
|
119
|
+
statusBackground: {
|
|
120
|
+
error: '#FF6666',
|
|
121
|
+
none: alpha('#2E68AA', 0.1),
|
|
122
|
+
pending: '#1EBEB3',
|
|
123
|
+
success: '#88B922',
|
|
124
|
+
unknown: '#E3E3E3',
|
|
125
|
+
warning: '#FD9B27'
|
|
126
|
+
},
|
|
127
|
+
success: {
|
|
128
|
+
contrastText: '#000',
|
|
129
|
+
main: '#88B922'
|
|
130
|
+
},
|
|
131
|
+
text: {
|
|
132
|
+
disabled: '#999999',
|
|
133
|
+
primary: '#000000',
|
|
134
|
+
secondary: '#666666'
|
|
135
|
+
},
|
|
136
|
+
warning: {
|
|
137
|
+
contrastText: '#000',
|
|
138
|
+
main: '#FD9B27'
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const darkPalette: PaletteOptions = {
|
|
143
|
+
action: {
|
|
144
|
+
acknowledged: '#67532C',
|
|
145
|
+
acknowledgedBackground: '#67532C',
|
|
146
|
+
activatedOpacity: 0.3,
|
|
147
|
+
active: '#B5B5B5',
|
|
148
|
+
disabled: '#999999',
|
|
149
|
+
disabledBackground: '#555555',
|
|
150
|
+
focus: 'rgba(255, 255, 255, 0.30)',
|
|
151
|
+
focusOpacity: 0.3,
|
|
152
|
+
hover: 'rgba(255, 255, 255, 0.16)',
|
|
153
|
+
hoverOpacity: 0.16,
|
|
154
|
+
inDowntime: '#4B2352',
|
|
155
|
+
inDowntimeBackground: '#4B2352',
|
|
156
|
+
selected: 'rgba(255, 255, 255, 0.5)',
|
|
157
|
+
selectedOpacity: 0.5
|
|
158
|
+
},
|
|
159
|
+
background: {
|
|
160
|
+
default: '#4a4a4a',
|
|
161
|
+
listingHeader: '#666666',
|
|
162
|
+
panel: '#4a4a4a',
|
|
163
|
+
panelGroups: '#252525',
|
|
164
|
+
paper: '#212121',
|
|
165
|
+
tooltip: '#AAB4C0'
|
|
166
|
+
},
|
|
167
|
+
divider: '#666666',
|
|
168
|
+
error: {
|
|
169
|
+
contrastText: '#fff',
|
|
170
|
+
main: '#D60101'
|
|
171
|
+
},
|
|
172
|
+
info: {
|
|
173
|
+
contrastText: '#fff',
|
|
174
|
+
main: '#1CA9F4'
|
|
175
|
+
},
|
|
176
|
+
mode: ThemeMode.dark,
|
|
177
|
+
pending: {
|
|
178
|
+
contrastText: '#fff',
|
|
179
|
+
main: '#118077'
|
|
180
|
+
},
|
|
181
|
+
primary: {
|
|
182
|
+
contrastText: '#000',
|
|
183
|
+
dark: '#4974A5',
|
|
184
|
+
light: '#8bbff9',
|
|
185
|
+
main: '#6eaff8'
|
|
186
|
+
},
|
|
187
|
+
secondary: {
|
|
188
|
+
contrastText: '#fff',
|
|
189
|
+
main: '#7C1FA2'
|
|
190
|
+
},
|
|
191
|
+
statusBackground: {
|
|
192
|
+
error: '#D60101',
|
|
193
|
+
none: alpha('#2E68AA', 0.1),
|
|
194
|
+
pending: '#118077',
|
|
195
|
+
success: '#5F8118',
|
|
196
|
+
unknown: '#666666',
|
|
197
|
+
warning: '#C55400'
|
|
198
|
+
},
|
|
199
|
+
success: {
|
|
200
|
+
contrastText: '#fff',
|
|
201
|
+
main: '#5F8118'
|
|
202
|
+
},
|
|
203
|
+
text: {
|
|
204
|
+
disabled: '#666666',
|
|
205
|
+
primary: '#FFFFFF',
|
|
206
|
+
secondary: '#CCCCCC'
|
|
207
|
+
},
|
|
208
|
+
warning: {
|
|
209
|
+
contrastText: '#fff',
|
|
210
|
+
main: '#C55400'
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const getPalette = (mode: ThemeMode): PaletteOptions =>
|
|
215
|
+
equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
import 'ulog';
|
|
4
4
|
import {
|
|
@@ -30,13 +30,14 @@ export interface UseFetchQueryProps<T> {
|
|
|
30
30
|
>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export
|
|
33
|
+
export interface UseFetchQueryState<T>
|
|
34
|
+
extends Omit<QueryObserverBaseResult, 'data'> {
|
|
34
35
|
data?: T;
|
|
35
36
|
fetchQuery: () => Promise<T | ResponseError>;
|
|
36
37
|
prefetchNextPage: ({ page, getPrefetchQueryKey }) => void;
|
|
37
38
|
prefetchPreviousPage: ({ page, getPrefetchQueryKey }) => void;
|
|
38
39
|
prefetchQuery: ({ endpointParams, queryKey }) => void;
|
|
39
|
-
}
|
|
40
|
+
}
|
|
40
41
|
|
|
41
42
|
export interface PrefetchEndpointParams {
|
|
42
43
|
page: number;
|
|
@@ -154,11 +155,9 @@ const useFetchQuery = <T extends object>({
|
|
|
154
155
|
);
|
|
155
156
|
};
|
|
156
157
|
|
|
157
|
-
const data =
|
|
158
|
-
()
|
|
159
|
-
|
|
160
|
-
[queryData.data]
|
|
161
|
-
);
|
|
158
|
+
const data = not(has('isError', queryData.data))
|
|
159
|
+
? (queryData.data as T)
|
|
160
|
+
: undefined;
|
|
162
161
|
|
|
163
162
|
const errorData = queryData.data as ResponseError | undefined;
|
|
164
163
|
|