@dative-gpi/foundation-core-components 1.0.69 → 1.0.71-groupings-2
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/components/autocompletes/FSAutocompleteChart.vue +15 -8
- package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
- package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
- package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
- package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
- package/components/autocompletes/FSAutocompleteGrouping.vue +105 -0
- package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
- package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
- package/components/autocompletes/FSAutocompleteModel.vue +9 -1
- package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
- package/components/autocompletes/FSAutocompleteRole.vue +14 -6
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
- package/components/customProperties/FSMetaField.vue +35 -40
- package/components/customProperties/FSMetaFormContent.vue +4 -3
- package/components/customProperties/FSMetaHistory.vue +2 -2
- package/components/customProperties/helpers.ts +57 -165
- package/components/entities/FSBaseEntitiesList.vue +12 -2
- package/components/entities/FSDialogSelectEntities.vue +19 -2
- package/components/entities/FSEntityField.vue +68 -13
- package/components/entities/FSSelectEntitiesList.vue +40 -7
- package/components/explorers/FSBaseDevicesExplorer.vue +322 -0
- package/components/explorers/FSBaseFoldersExplorer.vue +99 -20
- package/components/fields/FSMagicConfigField.vue +171 -0
- package/components/fields/FSMagicField.vue +214 -0
- package/components/lists/FSDataTable.vue +22 -16
- package/components/lists/alerts/FSBaseAlertsList.vue +96 -106
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +97 -34
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +98 -34
- package/components/lists/charts/FSBaseChartsList.vue +153 -64
- package/components/lists/comments/FSBaseCommentsList.vue +39 -23
- package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +41 -8
- package/components/lists/dashboards/FSBaseDashboardsList.vue +76 -16
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -6
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +8 -5
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +70 -44
- package/components/lists/folders/FSBaseFoldersList.vue +27 -15
- package/components/lists/groupings/FSBaseGroupingsList.vue +125 -0
- package/components/lists/groups/FSBaseGroupsList.vue +13 -9
- package/components/lists/locations/FSBaseLocationsList.vue +17 -13
- package/components/lists/models/FSBaseModelsList.vue +10 -5
- package/components/lists/playlists/FSSimplePlaylistsList.vue +44 -0
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +6 -5
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +6 -5
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +45 -8
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +45 -7
- package/components/lists/scenarios/FSBaseScenariosList.vue +121 -86
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +10 -7
- package/components/lists/serviceAccountRoleOrganisations/{FSBaseServiceAccountRoleOrganisations.vue → FSBaseServiceAccountRoleOrganisationsList.vue} +6 -5
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +10 -7
- package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
- package/components/selects/FSPlotPerSelector.vue +94 -16
- package/components/tiles/FSChartTile.vue +71 -0
- package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
- package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
- package/components/tiles/FSDashboardShallowTile.vue +3 -3
- package/components/tiles/FSDeviceOrganisationTile.vue +3 -3
- package/components/tiles/FSFolderTile.vue +7 -5
- package/components/tiles/FSGroupTile.vue +3 -3
- package/components/tiles/FSLocationTile.vue +5 -3
- package/components/tiles/FSModelTile.vue +64 -0
- package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
- package/components/tiles/FSUserOrganisationTile.vue +3 -3
- package/components/treeviews/FSTreeViewGroup.vue +7 -1
- package/package.json +9 -9
- package/utils/dashboards.ts +4 -4
- package/utils/index.ts +0 -1
- package/utils/roles.ts +3 -3
- package/utils/users.ts +3 -3
- package/components/selects/FSAggregationSelector.vue +0 -51
- package/components/selects/FSAxisTypeSelector.vue +0 -48
- package/components/selects/FSDisplayAsSelector.vue +0 -52
- package/components/selects/FSFilterTypeSelector.vue +0 -53
- package/components/selects/FSHeatmapRuleSelector.vue +0 -52
- package/components/selects/FSOperationOnSelector.vue +0 -51
- package/components/selects/FSPlanningTypeSelector.vue +0 -51
- package/components/selects/FSSelectEntityType.vue +0 -59
- package/components/selects/FSSerieTypeSelector.vue +0 -51
- package/utils/charts.ts +0 -137
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
:itemTo="$props.itemTo"
|
|
6
6
|
:items="alertsOrdered"
|
|
7
7
|
:loading="fetchingAlerts"
|
|
8
|
+
:headersOptions="headersOptions"
|
|
8
9
|
:tableCode="$props.tableCode"
|
|
9
10
|
:modelValue="$props.modelValue"
|
|
11
|
+
:selectable="$props.selectable"
|
|
10
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
11
13
|
v-bind="$attrs"
|
|
12
14
|
>
|
|
@@ -19,39 +21,12 @@
|
|
|
19
21
|
v-bind="slotData"
|
|
20
22
|
/>
|
|
21
23
|
</template>
|
|
22
|
-
|
|
23
|
-
#toolbar
|
|
24
|
-
>
|
|
25
|
-
<FSButtonCheckbox
|
|
26
|
-
:label="$tr('page.alerts.not-acknowledged-only', 'Not acknowledged only')"
|
|
27
|
-
:color="ColorEnum.Warning"
|
|
28
|
-
v-model="innerNotTreatedOnly"
|
|
29
|
-
/>
|
|
30
|
-
<FSButtonCheckbox
|
|
31
|
-
:label="$tr('page.alerts.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
|
-
v-model:startDate="startDate"
|
|
46
|
-
v-model:endDate="endDate"
|
|
47
|
-
/>
|
|
48
|
-
</FSRow>
|
|
49
|
-
</FSRow>
|
|
50
|
-
</template>
|
|
24
|
+
|
|
51
25
|
<template
|
|
52
26
|
#item.criticity="{ item }"
|
|
53
27
|
>
|
|
54
28
|
<FSRow
|
|
29
|
+
:wrap="false"
|
|
55
30
|
align="center-left"
|
|
56
31
|
gap="2px"
|
|
57
32
|
>
|
|
@@ -77,7 +52,7 @@
|
|
|
77
52
|
>
|
|
78
53
|
<FSTagGroup
|
|
79
54
|
variant="slide"
|
|
80
|
-
:
|
|
55
|
+
:showRemove="false"
|
|
81
56
|
:tags="item.tags"
|
|
82
57
|
/>
|
|
83
58
|
</template>
|
|
@@ -87,7 +62,7 @@
|
|
|
87
62
|
<FSTagGroup
|
|
88
63
|
variant="slide"
|
|
89
64
|
:tags="item.groupByValues.map((gbv: any) => `${gbv.label}: ${gbv.value}`)"
|
|
90
|
-
:
|
|
65
|
+
:showRemove="false"
|
|
91
66
|
/>
|
|
92
67
|
</template>
|
|
93
68
|
<template
|
|
@@ -98,6 +73,7 @@
|
|
|
98
73
|
width="32px"
|
|
99
74
|
height="32px"
|
|
100
75
|
:imageId="item.deviceOrganisationImageId"
|
|
76
|
+
:thumbnail="true"
|
|
101
77
|
/>
|
|
102
78
|
</template>
|
|
103
79
|
<template
|
|
@@ -117,7 +93,7 @@
|
|
|
117
93
|
v-else
|
|
118
94
|
font="text-overline"
|
|
119
95
|
>
|
|
120
|
-
{{ $tr('
|
|
96
|
+
{{ $tr('ui.alert.not-acknowledged', 'Not acknowledged') }}
|
|
121
97
|
</FSSpan>
|
|
122
98
|
</template>
|
|
123
99
|
<template
|
|
@@ -128,6 +104,7 @@
|
|
|
128
104
|
width="32px"
|
|
129
105
|
height="32px"
|
|
130
106
|
:imageId="item.acknowledgingUserImageId"
|
|
107
|
+
:thumbnail="true"
|
|
131
108
|
/>
|
|
132
109
|
</template>
|
|
133
110
|
<template
|
|
@@ -145,7 +122,7 @@
|
|
|
145
122
|
<FSTagGroup
|
|
146
123
|
variant="slide"
|
|
147
124
|
:tags="item.history.map((h: any) => AlertTools.statusLabel(h.status))"
|
|
148
|
-
:
|
|
125
|
+
:showRemove="false"
|
|
149
126
|
/>
|
|
150
127
|
</template>
|
|
151
128
|
<template
|
|
@@ -158,25 +135,7 @@
|
|
|
158
135
|
</FSSpan>
|
|
159
136
|
</template>
|
|
160
137
|
<template
|
|
161
|
-
#item.
|
|
162
|
-
>
|
|
163
|
-
<FSSpan
|
|
164
|
-
font="text-overline"
|
|
165
|
-
>
|
|
166
|
-
{{ epochToShortTimeFormat(item.triggerSourceTimestamp) }}
|
|
167
|
-
</FSSpan>
|
|
168
|
-
</template>
|
|
169
|
-
<template
|
|
170
|
-
#item.triggerEnqueuedTimestamp="{ item }"
|
|
171
|
-
>
|
|
172
|
-
<FSSpan
|
|
173
|
-
font="text-overline"
|
|
174
|
-
>
|
|
175
|
-
{{ epochToShortTimeFormat(item.triggerEnqueuedTimestamp) }}
|
|
176
|
-
</FSSpan>
|
|
177
|
-
</template>
|
|
178
|
-
<template
|
|
179
|
-
#item.triggerProcessedTimestamp="{ item }"
|
|
138
|
+
#item.triggerActualTimestamp="{ item }"
|
|
180
139
|
>
|
|
181
140
|
<FSSpan
|
|
182
141
|
font="text-overline"
|
|
@@ -194,31 +153,39 @@
|
|
|
194
153
|
</FSSpan>
|
|
195
154
|
</template>
|
|
196
155
|
<template
|
|
197
|
-
#item.
|
|
156
|
+
#item.currentActualTimestamp="{ item }"
|
|
198
157
|
>
|
|
199
158
|
<FSSpan
|
|
200
159
|
font="text-overline"
|
|
201
160
|
>
|
|
202
|
-
{{ epochToShortTimeFormat(item.
|
|
161
|
+
{{ epochToShortTimeFormat(item.currentActualTimestamp) }}
|
|
203
162
|
</FSSpan>
|
|
204
163
|
</template>
|
|
205
164
|
<template
|
|
206
|
-
#item.
|
|
165
|
+
#item.currentStatus="{ item }"
|
|
207
166
|
>
|
|
208
167
|
<FSSpan
|
|
209
168
|
font="text-overline"
|
|
210
169
|
>
|
|
211
|
-
{{
|
|
170
|
+
{{ AlertTools.statusLabel(item.currentStatus) }}
|
|
212
171
|
</FSSpan>
|
|
213
172
|
</template>
|
|
214
173
|
<template
|
|
215
|
-
#item.
|
|
174
|
+
#item.tile="{ index, item, toggleSelect }"
|
|
216
175
|
>
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
176
|
+
<FSAlertTileUI
|
|
177
|
+
:key="index"
|
|
178
|
+
variant="standard"
|
|
179
|
+
:label="item.label"
|
|
180
|
+
:deviceOrganisationLabel="item.deviceOrganisationLabel"
|
|
181
|
+
:icon="item.icon"
|
|
182
|
+
:selectable="$props.selectable"
|
|
183
|
+
:triggerProcessedTimestamp="item.triggerProcessedTimestamp"
|
|
184
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
185
|
+
:modelValue="isSelected(item.id)"
|
|
186
|
+
:color="alertColorByCriticity(item.criticity)"
|
|
187
|
+
@update:modelValue="toggleSelect(item)"
|
|
188
|
+
/>
|
|
222
189
|
</template>
|
|
223
190
|
</FSDataTable>
|
|
224
191
|
</template>
|
|
@@ -226,13 +193,17 @@
|
|
|
226
193
|
<script lang="ts">
|
|
227
194
|
import type { PropType} from "vue";
|
|
228
195
|
import type { RouteLocation } from "vue-router";
|
|
229
|
-
import { computed, defineComponent,
|
|
196
|
+
import { computed, defineComponent, watch } from "vue";
|
|
230
197
|
import _ from "lodash";
|
|
231
198
|
|
|
199
|
+
import { useTranslations } from "@dative-gpi/bones-ui";
|
|
200
|
+
|
|
232
201
|
import type { AlertFilters, AlertInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
233
202
|
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
203
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
234
204
|
import { useAlerts } from "@dative-gpi/foundation-core-services/composables";
|
|
235
205
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
206
|
+
import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
236
207
|
import { AlertStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
237
208
|
|
|
238
209
|
import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
|
|
@@ -244,23 +215,27 @@ import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.v
|
|
|
244
215
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
245
216
|
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
246
217
|
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
247
|
-
import
|
|
248
|
-
|
|
218
|
+
import FSAlertTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSAlertTileUI.vue";
|
|
219
|
+
|
|
249
220
|
|
|
250
221
|
export default defineComponent({
|
|
251
222
|
name: "FSBaseAlertsList",
|
|
252
223
|
components: {
|
|
253
224
|
FSButtonAcknowledgeAlert,
|
|
254
|
-
|
|
225
|
+
FSAlertTileUI,
|
|
255
226
|
FSDataTable,
|
|
256
|
-
|
|
227
|
+
FSTagGroup,
|
|
257
228
|
FSImage,
|
|
258
|
-
|
|
229
|
+
FSIcon,
|
|
259
230
|
FSSpan,
|
|
260
|
-
|
|
261
|
-
FSTermField,
|
|
231
|
+
FSRow
|
|
262
232
|
},
|
|
263
233
|
props: {
|
|
234
|
+
tableCode: {
|
|
235
|
+
type: String as PropType<string | null>,
|
|
236
|
+
required: false,
|
|
237
|
+
default: null
|
|
238
|
+
},
|
|
264
239
|
alertFilters: {
|
|
265
240
|
type: Object as PropType<AlertFilters>,
|
|
266
241
|
required: false,
|
|
@@ -284,73 +259,88 @@ export default defineComponent({
|
|
|
284
259
|
required: false,
|
|
285
260
|
default: false
|
|
286
261
|
},
|
|
287
|
-
tableCode: {
|
|
288
|
-
type: String,
|
|
289
|
-
required: true
|
|
290
|
-
},
|
|
291
262
|
itemTo: {
|
|
292
263
|
type: Function as PropType<(item: AlertInfos) => Partial<RouteLocation>>,
|
|
293
264
|
required: false
|
|
265
|
+
},
|
|
266
|
+
selectable: {
|
|
267
|
+
type: Boolean,
|
|
268
|
+
required: false,
|
|
269
|
+
default: true
|
|
294
270
|
}
|
|
295
271
|
},
|
|
296
272
|
emits: ["update:modelValue"],
|
|
297
273
|
setup(props) {
|
|
274
|
+
const { $tr } = useTranslations();
|
|
298
275
|
const { getMany: getManyAlerts, entities: alerts, fetching : fetchingAlerts } = useAlerts();
|
|
299
276
|
const { epochToShortTimeFormat } = useDateFormat();
|
|
300
277
|
|
|
301
|
-
const innerNotTreatedOnly = ref<boolean | undefined>(props.notAcknowledged);
|
|
302
|
-
const innerHidePending = ref<boolean | undefined>(props.hidePending);
|
|
303
|
-
const startDate = ref<string>("now - 1w");
|
|
304
|
-
const endDate = ref<string>("now");
|
|
305
|
-
|
|
306
278
|
|
|
307
279
|
const criticityColor = (row: any) => {
|
|
308
280
|
return AlertTools.criticityColor(row.criticity);
|
|
309
281
|
};
|
|
310
282
|
|
|
283
|
+
const alertColorByCriticity = (criticity: Criticity | number) => {
|
|
284
|
+
return AlertTools.criticityColor(criticity);
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const isSelected = (id: string): boolean => {
|
|
288
|
+
return props.modelValue.includes(id);
|
|
289
|
+
};
|
|
290
|
+
|
|
311
291
|
const alertsOrdered = computed(() => {
|
|
312
292
|
const als = [...alerts.value]
|
|
313
293
|
return als.sort((a: AlertInfos, b: AlertInfos) => {
|
|
314
294
|
return (a.acknowledged === b.acknowledged) ?
|
|
315
|
-
+b.
|
|
295
|
+
+b.currentActualTimestamp! - +a.currentActualTimestamp! : a.acknowledged ? 1 : -1
|
|
316
296
|
});
|
|
317
297
|
});
|
|
318
298
|
|
|
319
|
-
|
|
299
|
+
const headersOptions = computed(() => ({
|
|
300
|
+
currentStatus: {
|
|
301
|
+
fixedFilters: getEnumEntries(AlertStatus).map(e => ({
|
|
302
|
+
value: e.value,
|
|
303
|
+
text: AlertTools.statusLabel(e.value)
|
|
304
|
+
})),
|
|
305
|
+
methodFilter: (value: AlertStatus, item: AlertStatus) => value == item
|
|
306
|
+
},
|
|
307
|
+
criticity: {
|
|
308
|
+
fixedFilters: getEnumEntries(Criticity).map(e => ({
|
|
309
|
+
value: e.value,
|
|
310
|
+
text: AlertTools.criticityLabel(e.value)
|
|
311
|
+
})),
|
|
312
|
+
methodFilter: (value: Criticity, item: Criticity) => value == item
|
|
313
|
+
},
|
|
314
|
+
acknowledged: {
|
|
315
|
+
fixedFilters: [
|
|
316
|
+
{ value: true, text: $tr('entity.alert.acknowledged', 'Acknowledged') },
|
|
317
|
+
{ value: false, text: $tr('ui.alert.not-acknowledged', 'Not acknowledged') }
|
|
318
|
+
],
|
|
319
|
+
methodFilter: (value: boolean, item: boolean) => value === item
|
|
320
|
+
},
|
|
321
|
+
}));
|
|
322
|
+
|
|
323
|
+
watch([() => props.alertFilters, () => props.notAcknowledged, () => props.hidePending], (next, previous) => {
|
|
320
324
|
if (!_.isEqual(next, previous)) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
else{
|
|
329
|
-
getManyAlerts({
|
|
330
|
-
...props.alertFilters,
|
|
331
|
-
statuses: innerHidePending.value ?
|
|
332
|
-
[AlertStatus.Unresolved, AlertStatus.Resolved, AlertStatus.Triggered] : undefined,
|
|
333
|
-
startDate: startDate.value,
|
|
334
|
-
endDate: endDate.value
|
|
335
|
-
}); // TODO, gérer les conditions pour que les alertes s'affichent ici notamment lorsqu'elles sont acquittées
|
|
336
|
-
// la FilterFactory gère pas ces conditions correctement
|
|
337
|
-
}
|
|
338
|
-
|
|
325
|
+
getManyAlerts({
|
|
326
|
+
...props.alertFilters,
|
|
327
|
+
acknowledged: props.notAcknowledged ? false : undefined,
|
|
328
|
+
statuses: props.hidePending ? [AlertStatus.Unresolved, AlertStatus.Triggered, AlertStatus.Resolved, AlertStatus.Abandoned] : undefined
|
|
329
|
+
});
|
|
339
330
|
}
|
|
340
331
|
}, { immediate: true });
|
|
341
332
|
|
|
342
333
|
|
|
343
334
|
return {
|
|
344
|
-
|
|
335
|
+
fetchingAlerts,
|
|
336
|
+
headersOptions,
|
|
337
|
+
alertsOrdered,
|
|
345
338
|
AlertTools,
|
|
346
339
|
ColorEnum,
|
|
347
|
-
alertsOrdered,
|
|
348
|
-
fetchingAlerts,
|
|
349
|
-
startDate,
|
|
350
|
-
endDate,
|
|
351
|
-
innerHidePending,
|
|
352
340
|
epochToShortTimeFormat,
|
|
353
|
-
|
|
341
|
+
alertColorByCriticity,
|
|
342
|
+
criticityColor,
|
|
343
|
+
isSelected
|
|
354
344
|
};
|
|
355
345
|
}
|
|
356
346
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSButton
|
|
3
3
|
prependIcon="mdi-checkbox-blank-outline"
|
|
4
|
-
:label="$tr('
|
|
4
|
+
:label="$tr('ui.alert.acknowledge', 'Acknowledge')"
|
|
5
5
|
@click="dialog = true"
|
|
6
6
|
/>
|
|
7
7
|
<FSDialogSubmit
|
|
8
|
-
:title="$tr('
|
|
8
|
+
:title="$tr('ui.alert.acknowledge', 'Acknowledge')"
|
|
9
9
|
:load="acknowledgingAlert"
|
|
10
10
|
@click:submitButton="onAcknowledge"
|
|
11
11
|
v-model="dialog"
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
gap="2px"
|
|
27
27
|
>
|
|
28
28
|
<FSSpan>
|
|
29
|
-
{{ $tr("
|
|
29
|
+
{{ $tr("ui.alert.acknowledge-warning", "Do you want to acknowledge this alert?") }}
|
|
30
30
|
</FSSpan>
|
|
31
31
|
</FSRow>
|
|
32
32
|
</FSRow>
|
|
33
33
|
<FSSpan>
|
|
34
|
-
{{ $tr("
|
|
34
|
+
{{ $tr("ui.alert.acknowledge-final-warning", "This action is definitive") }}
|
|
35
35
|
</FSSpan>
|
|
36
36
|
<FSErrorToast
|
|
37
37
|
v-if="error"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
:items="authTokens"
|
|
4
4
|
:loading="fetchingAuthTokens"
|
|
5
5
|
:tableCode="$props.tableCode"
|
|
6
|
+
:selectable="false"
|
|
6
7
|
v-bind="$attrs"
|
|
7
8
|
>
|
|
8
9
|
<template
|
|
@@ -48,14 +49,15 @@ export default defineComponent({
|
|
|
48
49
|
FSText
|
|
49
50
|
},
|
|
50
51
|
props: {
|
|
52
|
+
tableCode: {
|
|
53
|
+
type: String as PropType<string | null>,
|
|
54
|
+
required: false,
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
51
57
|
authTokensFilters: {
|
|
52
58
|
type: Object as PropType<AuthTokenFilters | null>,
|
|
53
59
|
required: false,
|
|
54
60
|
default: null
|
|
55
|
-
},
|
|
56
|
-
tableCode: {
|
|
57
|
-
type: String,
|
|
58
|
-
required: true
|
|
59
61
|
}
|
|
60
62
|
},
|
|
61
63
|
setup(props) {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSDataTable
|
|
3
|
+
defaultMode="iterator"
|
|
3
4
|
:items="chartOrganisationTypes"
|
|
4
5
|
:itemTo="$props.itemTo"
|
|
5
6
|
:loading="fetchingChartOrganisationTypes"
|
|
7
|
+
:headersOptions="headersOptions"
|
|
6
8
|
:tableCode="$props.tableCode"
|
|
7
9
|
:modelValue="$props.modelValue"
|
|
10
|
+
:selectable="$props.selectable"
|
|
11
|
+
:singleSelect="$props.singleSelect"
|
|
8
12
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
9
13
|
v-bind="$attrs"
|
|
10
14
|
>
|
|
@@ -39,6 +43,7 @@
|
|
|
39
43
|
height="32px"
|
|
40
44
|
width="32px"
|
|
41
45
|
:imageId="item.imageId"
|
|
46
|
+
:thumbnail="true"
|
|
42
47
|
/>
|
|
43
48
|
</template>
|
|
44
49
|
<template
|
|
@@ -46,27 +51,48 @@
|
|
|
46
51
|
>
|
|
47
52
|
<FSTagGroup
|
|
48
53
|
variant="slide"
|
|
49
|
-
:editable="false"
|
|
50
54
|
:tags="item.tags"
|
|
55
|
+
:showRemove="false"
|
|
51
56
|
/>
|
|
52
57
|
</template>
|
|
58
|
+
<template
|
|
59
|
+
#item.chartType="{ item }"
|
|
60
|
+
>
|
|
61
|
+
<FSRow
|
|
62
|
+
:wrap="false"
|
|
63
|
+
>
|
|
64
|
+
<FSIcon
|
|
65
|
+
:icon="chartIcon(item.chartType)"
|
|
66
|
+
/>
|
|
67
|
+
<FSText>
|
|
68
|
+
{{ chartTypeLabel(item.chartType) }}
|
|
69
|
+
</FSText>
|
|
70
|
+
</FSRow>
|
|
71
|
+
</template>
|
|
53
72
|
<template
|
|
54
73
|
#item.modelsLabels="{ item }"
|
|
55
74
|
>
|
|
56
75
|
<FSTagGroup
|
|
57
|
-
|
|
76
|
+
variant="slide"
|
|
58
77
|
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
78
|
+
:showRemove="false"
|
|
59
79
|
/>
|
|
60
80
|
</template>
|
|
61
81
|
<template
|
|
62
|
-
#item.tile="{item}"
|
|
82
|
+
#item.tile="{ index, item, toggleSelect}"
|
|
63
83
|
>
|
|
64
84
|
<FSChartTileUI
|
|
85
|
+
:key="index"
|
|
65
86
|
:label="item.label"
|
|
66
87
|
:category-label="item.chartCategoryLabel"
|
|
88
|
+
:singleSelect="$props.singleSelect"
|
|
89
|
+
:selectable="$props.selectable"
|
|
67
90
|
:icon="item.icon"
|
|
91
|
+
:scope="item.scope"
|
|
68
92
|
:imageId="item.imageId"
|
|
69
93
|
:type="item.chartType"
|
|
94
|
+
:modelValue="isSelected(item.id)"
|
|
95
|
+
@update:modelValue="toggleSelect(item)"
|
|
70
96
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
71
97
|
/>
|
|
72
98
|
</template>
|
|
@@ -74,22 +100,26 @@
|
|
|
74
100
|
</template>
|
|
75
101
|
|
|
76
102
|
<script lang="ts">
|
|
77
|
-
import
|
|
78
|
-
import { defineComponent, type PropType, watch } from "vue";
|
|
103
|
+
import { computed, defineComponent, type PropType, watch } from "vue";
|
|
79
104
|
import type { RouteLocation } from "vue-router";
|
|
105
|
+
import _ from "lodash";
|
|
80
106
|
|
|
81
|
-
import {
|
|
82
|
-
|
|
83
|
-
import
|
|
84
|
-
import {
|
|
107
|
+
import { ChartType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
108
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
109
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
110
|
+
import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
|
|
85
111
|
|
|
112
|
+
import type { ChartModelLabel, ChartOrganisationTypeFilters, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
86
113
|
import { useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
87
114
|
|
|
88
115
|
import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
|
|
89
|
-
import FSDataTable from "../FSDataTable.vue";
|
|
90
116
|
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
91
117
|
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
118
|
+
import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
|
|
92
119
|
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
120
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
121
|
+
|
|
122
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
93
123
|
|
|
94
124
|
export default defineComponent({
|
|
95
125
|
name: "FSBaseChartOrganisationTypesList",
|
|
@@ -98,61 +128,94 @@ export default defineComponent({
|
|
|
98
128
|
FSDataTable,
|
|
99
129
|
FSTagGroup,
|
|
100
130
|
FSImage,
|
|
101
|
-
FSIcon
|
|
131
|
+
FSIcon,
|
|
132
|
+
FSText,
|
|
133
|
+
FSRow
|
|
102
134
|
},
|
|
103
135
|
props: {
|
|
104
|
-
|
|
105
|
-
type:
|
|
106
|
-
default: () => [],
|
|
107
|
-
required: false
|
|
108
|
-
},
|
|
109
|
-
chartOrganisationFilters: {
|
|
110
|
-
type: Object as PropType<ChartOrganisationFilters>,
|
|
136
|
+
tableCode: {
|
|
137
|
+
type: String as PropType<string | null>,
|
|
111
138
|
required: false,
|
|
112
139
|
default: null
|
|
113
140
|
},
|
|
114
|
-
|
|
115
|
-
type:
|
|
141
|
+
chartOrganisationTypeFilters: {
|
|
142
|
+
type: Object as PropType<ChartOrganisationTypeFilters>,
|
|
116
143
|
required: false,
|
|
117
|
-
default:
|
|
118
|
-
},
|
|
119
|
-
tableCode: {
|
|
120
|
-
type: String,
|
|
121
|
-
required: true
|
|
144
|
+
default: null
|
|
122
145
|
},
|
|
123
146
|
itemTo: {
|
|
124
147
|
type: Function as PropType<(item: ChartOrganisationTypeInfos) => Partial<RouteLocation>>,
|
|
125
148
|
required: false
|
|
149
|
+
},
|
|
150
|
+
modelValue: {
|
|
151
|
+
type: Array as PropType<string[]>,
|
|
152
|
+
default: () => [],
|
|
153
|
+
required: false
|
|
154
|
+
},
|
|
155
|
+
selectable: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
required: false,
|
|
158
|
+
default: true
|
|
159
|
+
},
|
|
160
|
+
singleSelect: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
required: false,
|
|
163
|
+
default: false
|
|
126
164
|
}
|
|
127
165
|
},
|
|
128
166
|
emits: ["update:modelValue"],
|
|
129
167
|
setup(props) {
|
|
130
|
-
|
|
131
168
|
const { entities: chartOrganisationTypes, fetching: fetchingChartOrganisationTypes, getMany: getManyChartOrganisationTypes } = useChartOrganisationTypes();
|
|
132
169
|
|
|
170
|
+
const headersOptions = computed(() => ({
|
|
171
|
+
modelsLabels: {
|
|
172
|
+
fixedFilters: chartOrganisationTypes.value.map(c => c.modelsLabels).reduce((acc, models) => {
|
|
173
|
+
for (const m of models) {
|
|
174
|
+
if (!acc.map((m) => m.id).includes(m.id)) {
|
|
175
|
+
acc.push(m);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return acc;
|
|
179
|
+
}, []).map((m) => ({
|
|
180
|
+
value: m.id,
|
|
181
|
+
text: m.label
|
|
182
|
+
})).concat({
|
|
183
|
+
value: '',
|
|
184
|
+
text: '--'
|
|
185
|
+
}),
|
|
186
|
+
methodFilter: (value: string, items: ChartModelLabel[]) => (items.length == 0 && value == '') || (items.length > 0 && items.some(ml => ml.id == value))
|
|
187
|
+
},
|
|
188
|
+
chartType: {
|
|
189
|
+
fixedFilters: getEnumEntries(ChartType).map(e => ({
|
|
190
|
+
value: e.value,
|
|
191
|
+
text: chartTypeLabel(e.value)
|
|
192
|
+
})),
|
|
193
|
+
methodFilter: (value: ChartType, item: ChartType) => value == item
|
|
194
|
+
}
|
|
195
|
+
}));
|
|
196
|
+
|
|
133
197
|
const isSelected = (id: string): boolean => {
|
|
134
198
|
return props.modelValue.includes(id);
|
|
135
199
|
};
|
|
136
200
|
|
|
137
201
|
const fetch = () =>{
|
|
138
|
-
|
|
139
|
-
getManyChartOrganisationTypes(props.chartOrganisationFilters);
|
|
140
|
-
} else {
|
|
141
|
-
getManyChartOrganisationTypes({ ...props.chartOrganisationFilters, plotPer: props.plotPer });
|
|
142
|
-
}
|
|
202
|
+
getManyChartOrganisationTypes(props.chartOrganisationTypeFilters);
|
|
143
203
|
};
|
|
144
204
|
|
|
145
|
-
watch(() => [props.
|
|
205
|
+
watch(() => [props.chartOrganisationTypeFilters], (next, previous) => {
|
|
146
206
|
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
147
207
|
fetch();
|
|
148
208
|
}
|
|
149
209
|
}, { immediate: true });
|
|
150
210
|
|
|
151
211
|
return {
|
|
152
|
-
ColorEnum,
|
|
153
212
|
fetchingChartOrganisationTypes,
|
|
154
213
|
chartOrganisationTypes,
|
|
155
|
-
|
|
214
|
+
headersOptions,
|
|
215
|
+
ColorEnum,
|
|
216
|
+
chartTypeLabel,
|
|
217
|
+
isSelected,
|
|
218
|
+
chartIcon
|
|
156
219
|
};
|
|
157
220
|
}
|
|
158
221
|
});
|