@dative-gpi/foundation-core-components 1.0.142-alert-filter → 1.0.142-role

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.
@@ -139,7 +139,8 @@ export default defineComponent({
139
139
  case EntityType.Dashboard:
140
140
  return {
141
141
  dashboardOrganisationsIds: props.modelValue,
142
- dashboardOrganisationTypesIds: props.modelValue
142
+ dashboardOrganisationTypesIds: props.modelValue,
143
+ dashboardShallowsIds: props.modelValue
143
144
  } satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters;
144
145
  case EntityType.Group:
145
146
  return {
@@ -114,7 +114,8 @@ export default defineComponent({
114
114
  case EntityType.Dashboard:
115
115
  return {
116
116
  dashboardOrganisationsIds: props.modelValue,
117
- dashboardOrganisationTypesIds: props.modelValue
117
+ dashboardOrganisationTypesIds: props.modelValue,
118
+ dashboardShallowsIds: props.modelValue
118
119
  } satisfies DashboardOrganisationFilters & DashboardOrganisationTypeFilters;
119
120
  case EntityType.Group:
120
121
  return {
@@ -318,11 +318,21 @@ export default defineComponent({
318
318
 
319
319
  watch(() => [props.alertFilters, props.notAcknowledged, props.hidePending], (next, previous) => {
320
320
  if (!_.isEqual(next, previous)) {
321
- getManyAlerts({
322
- ...props.alertFilters,
323
- acknowledged: props.notAcknowledged ? false : undefined,
324
- statuses: props.hidePending ? [AlertStatus.Unresolved, AlertStatus.Triggered, AlertStatus.Resolved, AlertStatus.Untriggered, AlertStatus.Abandoned] : undefined
325
- });
321
+ if(props.notAcknowledged){
322
+ getManyAlerts({
323
+ ...props.alertFilters,
324
+ acknowledged: false,
325
+ statuses: [AlertStatus.Unresolved, AlertStatus.Triggered],
326
+ });
327
+ }
328
+ else{
329
+ getManyAlerts({
330
+ ...props.alertFilters,
331
+ statuses: props.hidePending ?
332
+ [AlertStatus.Unresolved, AlertStatus.Resolved, AlertStatus.Triggered] : props.alertFilters?.statuses
333
+ }); // TODO, gérer les conditions pour que les alertes s'affichent ici notamment lorsqu'elles sont acquittées
334
+ // la FilterFactory gère pas ces conditions correctement
335
+ }
326
336
  }
327
337
  }, { immediate: true });
328
338
 
@@ -8,10 +8,14 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import { defineComponent, type PropType, watch, computed } from "vue";
11
+ import _ from "lodash";
11
12
 
12
13
  import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
13
14
  import { useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
14
15
 
16
+ import { DashboardType } from '@dative-gpi/foundation-shared-domain/enums';
17
+ import type { DashboardsListItem } from '@dative-gpi/foundation-core-components/utils';
18
+
15
19
  import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
16
20
 
17
21
  export default defineComponent({
@@ -31,7 +35,7 @@ export default defineComponent({
31
35
  default: () => ({})
32
36
  },
33
37
  dashboardShallowFilters: {
34
- type: Object as PropType<DashboardOrganisationTypeFilters>,
38
+ type: Object as PropType<DashboardShallowFilters>,
35
39
  required: false,
36
40
  default: () => ({})
37
41
  }
@@ -51,8 +55,21 @@ export default defineComponent({
51
55
  || fetchingDashboardOrganisationTypes.value
52
56
  || fetchingDashboardShallows.value);
53
57
 
54
- const dashboards = computed(() => {
55
- return [...dashboardOrganisations.value, ...dashboardOrganisationTypes.value, ...dashboardShallows.value];
58
+ const dashboards = computed((): DashboardsListItem[] => {
59
+ return _.sortBy([
60
+ ...dashboardOrganisationTypes.value.map(g => ({
61
+ ...g,
62
+ dashboardType: DashboardType.OrganisationType
63
+ })) satisfies DashboardsListItem[],
64
+ ...dashboardOrganisations.value.map(d => ({
65
+ ...d,
66
+ dashboardType: DashboardType.Organisation
67
+ })) as DashboardsListItem[],
68
+ ...dashboardShallows.value.map(d => ({
69
+ ...d,
70
+ dashboardType: DashboardType.Shallow
71
+ })) as DashboardsListItem[]
72
+ ], d => d.label);
56
73
  });
57
74
 
58
75
  const fetch = () => {
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.142-alert-filter",
4
+ "version": "1.0.142-role",
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.142-alert-filter",
14
- "@dative-gpi/foundation-core-services": "1.0.142-alert-filter",
15
- "@dative-gpi/foundation-shared-components": "1.0.142-alert-filter",
16
- "@dative-gpi/foundation-shared-domain": "1.0.142-alert-filter",
17
- "@dative-gpi/foundation-shared-services": "1.0.142-alert-filter"
13
+ "@dative-gpi/foundation-core-domain": "1.0.142-role",
14
+ "@dative-gpi/foundation-core-services": "1.0.142-role",
15
+ "@dative-gpi/foundation-shared-components": "1.0.142-role",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.142-role",
17
+ "@dative-gpi/foundation-shared-services": "1.0.142-role"
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": "fc7d2bb3d95be32c651fb346d41ab9c662558489"
29
+ "gitHead": "071352c70ea94f5fc39e1ad8d9c058b9e1da95b9"
30
30
  }