@dative-gpi/foundation-core-components 1.0.112 → 1.0.114-refacto-alert-list
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.
|
@@ -19,36 +19,7 @@
|
|
|
19
19
|
v-bind="slotData"
|
|
20
20
|
/>
|
|
21
21
|
</template>
|
|
22
|
-
|
|
23
|
-
#toolbar
|
|
24
|
-
>
|
|
25
|
-
<FSButtonCheckbox
|
|
26
|
-
:label="$tr('ui.alert.not-acknowledged-only', 'Not acknowledged only')"
|
|
27
|
-
:color="ColorEnum.Warning"
|
|
28
|
-
v-model="innerNotTreatedOnly"
|
|
29
|
-
/>
|
|
30
|
-
<FSButtonCheckbox
|
|
31
|
-
:label="$tr('ui.alert.hide-pending', 'Hide pending')"
|
|
32
|
-
:color="ColorEnum.Light"
|
|
33
|
-
variant="full"
|
|
34
|
-
v-model="innerHidePending"
|
|
35
|
-
/>
|
|
36
|
-
<FSRow
|
|
37
|
-
align="center-right"
|
|
38
|
-
>
|
|
39
|
-
<FSRow
|
|
40
|
-
width="hug"
|
|
41
|
-
>
|
|
42
|
-
<FSTermField
|
|
43
|
-
variant="default"
|
|
44
|
-
:editable="!innerNotTreatedOnly"
|
|
45
|
-
:hideHeader="true"
|
|
46
|
-
v-model:startDate="startDate"
|
|
47
|
-
v-model:endDate="endDate"
|
|
48
|
-
/>
|
|
49
|
-
</FSRow>
|
|
50
|
-
</FSRow>
|
|
51
|
-
</template>
|
|
22
|
+
|
|
52
23
|
<template
|
|
53
24
|
#item.criticity="{ item }"
|
|
54
25
|
>
|
|
@@ -223,19 +194,33 @@
|
|
|
223
194
|
{{ epochToShortTimeFormat(item.currentProcessedTimestamp) }}
|
|
224
195
|
</FSSpan>
|
|
225
196
|
</template>
|
|
197
|
+
<template
|
|
198
|
+
#item.tile="{ item }"
|
|
199
|
+
>
|
|
200
|
+
<FSAlertTileUI
|
|
201
|
+
variant="standard"
|
|
202
|
+
:label="item.label"
|
|
203
|
+
:deviceOrganisationLabel="item.deviceOrganisationLabel"
|
|
204
|
+
:icon="item.icon"
|
|
205
|
+
:triggerProcessedTimestamp="item.triggerProcessedTimestamp"
|
|
206
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
207
|
+
:color="alertColorByCriticity(item.criticity)"
|
|
208
|
+
/>
|
|
209
|
+
</template>
|
|
226
210
|
</FSDataTable>
|
|
227
211
|
</template>
|
|
228
212
|
|
|
229
213
|
<script lang="ts">
|
|
230
214
|
import type { PropType} from "vue";
|
|
231
215
|
import type { RouteLocation } from "vue-router";
|
|
232
|
-
import { computed, defineComponent,
|
|
216
|
+
import { computed, defineComponent, watch } from "vue";
|
|
233
217
|
import _ from "lodash";
|
|
234
218
|
|
|
235
219
|
import type { AlertFilters, AlertInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
236
220
|
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
237
221
|
import { useAlerts } from "@dative-gpi/foundation-core-services/composables";
|
|
238
222
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
223
|
+
import type { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
239
224
|
import { AlertStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
240
225
|
|
|
241
226
|
import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
|
|
@@ -247,21 +232,19 @@ import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.v
|
|
|
247
232
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
248
233
|
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
249
234
|
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
250
|
-
import
|
|
251
|
-
import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
|
|
235
|
+
import FSAlertTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSAlertTileUI.vue";
|
|
252
236
|
|
|
253
237
|
export default defineComponent({
|
|
254
238
|
name: "FSBaseAlertsList",
|
|
255
239
|
components: {
|
|
256
240
|
FSButtonAcknowledgeAlert,
|
|
257
|
-
|
|
241
|
+
FSAlertTileUI,
|
|
258
242
|
FSDataTable,
|
|
259
|
-
|
|
243
|
+
FSTagGroup,
|
|
260
244
|
FSImage,
|
|
261
|
-
|
|
245
|
+
FSIcon,
|
|
262
246
|
FSSpan,
|
|
263
|
-
|
|
264
|
-
FSTermField,
|
|
247
|
+
FSRow
|
|
265
248
|
},
|
|
266
249
|
props: {
|
|
267
250
|
tableCode: {
|
|
@@ -295,23 +278,22 @@ export default defineComponent({
|
|
|
295
278
|
itemTo: {
|
|
296
279
|
type: Function as PropType<(item: AlertInfos) => Partial<RouteLocation>>,
|
|
297
280
|
required: false
|
|
298
|
-
}
|
|
281
|
+
},
|
|
299
282
|
},
|
|
300
283
|
emits: ["update:modelValue"],
|
|
301
284
|
setup(props) {
|
|
302
285
|
const { getMany: getManyAlerts, entities: alerts, fetching : fetchingAlerts } = useAlerts();
|
|
303
286
|
const { epochToShortTimeFormat } = useDateFormat();
|
|
304
287
|
|
|
305
|
-
const innerNotTreatedOnly = ref<boolean | undefined>(props.notAcknowledged);
|
|
306
|
-
const innerHidePending = ref<boolean | undefined>(props.hidePending);
|
|
307
|
-
const startDate = ref<string>("now - 1w");
|
|
308
|
-
const endDate = ref<string>("now");
|
|
309
|
-
|
|
310
288
|
|
|
311
289
|
const criticityColor = (row: any) => {
|
|
312
290
|
return AlertTools.criticityColor(row.criticity);
|
|
313
291
|
};
|
|
314
292
|
|
|
293
|
+
const alertColorByCriticity = (criticity: Criticity | number) => {
|
|
294
|
+
return AlertTools.criticityColor(criticity);
|
|
295
|
+
};
|
|
296
|
+
|
|
315
297
|
const alertsOrdered = computed(() => {
|
|
316
298
|
const als = [...alerts.value]
|
|
317
299
|
return als.sort((a: AlertInfos, b: AlertInfos) => {
|
|
@@ -320,9 +302,9 @@ export default defineComponent({
|
|
|
320
302
|
});
|
|
321
303
|
});
|
|
322
304
|
|
|
323
|
-
watch(() => [props.alertFilters,
|
|
305
|
+
watch(() => [props.alertFilters, props.notAcknowledged, props.hidePending], (next, previous) => {
|
|
324
306
|
if (!_.isEqual(next, previous)) {
|
|
325
|
-
if(
|
|
307
|
+
if(props.notAcknowledged){
|
|
326
308
|
getManyAlerts({
|
|
327
309
|
...props.alertFilters,
|
|
328
310
|
acknowledged: false,
|
|
@@ -332,28 +314,22 @@ export default defineComponent({
|
|
|
332
314
|
else{
|
|
333
315
|
getManyAlerts({
|
|
334
316
|
...props.alertFilters,
|
|
335
|
-
statuses:
|
|
336
|
-
[AlertStatus.Unresolved, AlertStatus.Resolved, AlertStatus.Triggered] :
|
|
337
|
-
startDate: startDate.value,
|
|
338
|
-
endDate: endDate.value
|
|
317
|
+
statuses: props.hidePending ?
|
|
318
|
+
[AlertStatus.Unresolved, AlertStatus.Resolved, AlertStatus.Triggered] : props.alertFilters.statuses
|
|
339
319
|
}); // TODO, gérer les conditions pour que les alertes s'affichent ici notamment lorsqu'elles sont acquittées
|
|
340
320
|
// la FilterFactory gère pas ces conditions correctement
|
|
341
321
|
}
|
|
342
|
-
|
|
343
322
|
}
|
|
344
323
|
}, { immediate: true });
|
|
345
324
|
|
|
346
325
|
|
|
347
326
|
return {
|
|
348
|
-
|
|
327
|
+
fetchingAlerts,
|
|
328
|
+
alertsOrdered,
|
|
349
329
|
AlertTools,
|
|
350
330
|
ColorEnum,
|
|
351
|
-
alertsOrdered,
|
|
352
|
-
fetchingAlerts,
|
|
353
|
-
startDate,
|
|
354
|
-
endDate,
|
|
355
|
-
innerHidePending,
|
|
356
331
|
epochToShortTimeFormat,
|
|
332
|
+
alertColorByCriticity,
|
|
357
333
|
criticityColor
|
|
358
334
|
};
|
|
359
335
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.114-refacto-alert-list",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-core-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "1.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "1.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.114-refacto-alert-list",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "1.0.114-refacto-alert-list",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "1.0.114-refacto-alert-list",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "1.0.114-refacto-alert-list",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "1.0.114-refacto-alert-list"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"sass": "1.71.1",
|
|
27
27
|
"sass-loader": "13.3.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "dcf94cfab6e91a096957f8d9396872d495ef6fa4"
|
|
30
30
|
}
|