@dative-gpi/foundation-core-components 1.0.127 → 1.0.128-dvh

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,7 +19,8 @@
19
19
  :entity-type="$props.entityType"
20
20
  :filters="simpleListFilters"
21
21
  :showEdit="false"
22
- :showRemove="false"
22
+ :showRemove="showRemove"
23
+ @click:remove="onRemove"
23
24
  direction="row"
24
25
  />
25
26
  </FSSlideGroup>
@@ -96,9 +97,14 @@ export default defineComponent({
96
97
  type: Object,
97
98
  required: false,
98
99
  default: null
100
+ },
101
+ showRemove: {
102
+ type: Boolean,
103
+ required: false,
104
+ default: false
99
105
  }
100
106
  },
101
- setup(props, { attrs }){
107
+ setup(props, { emit, attrs }){
102
108
  const simpleListFilters = computed(() => {
103
109
  switch(props.entityType) {
104
110
  case EntityType.Device:
@@ -188,10 +194,15 @@ export default defineComponent({
188
194
  };
189
195
  });
190
196
 
197
+ const onRemove = (id: string) => {
198
+ emit("update:modelValue", props.modelValue.filter((i) => i !== id));
199
+ }
200
+
191
201
  return {
192
202
  simpleListFilters,
193
203
  baseTableAttrs,
194
- tableCode
204
+ tableCode,
205
+ onRemove
195
206
  }
196
207
  }
197
208
  });
@@ -211,9 +211,8 @@
211
211
  </template>
212
212
 
213
213
  <script lang="ts">
214
- import type { PropType} from "vue";
214
+ import { computed, defineComponent, type PropType, watch } from "vue";
215
215
  import type { RouteLocation } from "vue-router";
216
- import { computed, defineComponent, watch } from "vue";
217
216
  import _ from "lodash";
218
217
 
219
218
  import type { AlertFilters, AlertInfos } from "@dative-gpi/foundation-core-domain/models";
@@ -285,7 +284,6 @@ export default defineComponent({
285
284
  const { getMany: getManyAlerts, entities: alerts, fetching : fetchingAlerts } = useAlerts();
286
285
  const { epochToShortTimeFormat } = useDateFormat();
287
286
 
288
-
289
287
  const criticityColor = (row: any) => {
290
288
  return AlertTools.criticityColor(row.criticity);
291
289
  };
@@ -304,14 +302,14 @@ export default defineComponent({
304
302
 
305
303
  watch(() => [props.alertFilters, props.notAcknowledged, props.hidePending], (next, previous) => {
306
304
  if (!_.isEqual(next, previous)) {
307
- if(props.notAcknowledged){
305
+ if (props.notAcknowledged) {
308
306
  getManyAlerts({
309
307
  ...props.alertFilters,
310
308
  acknowledged: false,
311
309
  statuses: [AlertStatus.Unresolved, AlertStatus.Triggered],
312
310
  });
313
311
  }
314
- else{
312
+ else {
315
313
  getManyAlerts({
316
314
  ...props.alertFilters,
317
315
  statuses: props.hidePending ?
@@ -322,7 +320,6 @@ export default defineComponent({
322
320
  }
323
321
  }, { immediate: true });
324
322
 
325
-
326
323
  return {
327
324
  fetchingAlerts,
328
325
  alertsOrdered,
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <FSChartTileUI
3
+ v-if="chart"
4
+ :label="chart.label"
5
+ :icon="chart.icon"
6
+ :type="chart.chartType"
7
+ :imageId="chart.imageId"
8
+ v-bind="$attrs"
9
+ />
10
+ </template>
11
+
12
+ <script lang="ts">
13
+ import { computed, defineComponent, type PropType, watch } from "vue";
14
+
15
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
16
+ import { chartIcon } from "@dative-gpi/foundation-shared-components/tools";
17
+
18
+ import { useChartOrganisation, useChartOrganisationType } from "@dative-gpi/foundation-core-services/composables";
19
+ import { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
20
+
21
+ import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
22
+
23
+ export default defineComponent({
24
+ name: "FSChartTile",
25
+ components: {
26
+ FSChartTileUI
27
+ },
28
+ props: {
29
+ chartId: {
30
+ type: String,
31
+ required: true
32
+ },
33
+ scope: {
34
+ type: Object as PropType<ApplicationScope | number>,
35
+ required : true
36
+ }
37
+ },
38
+ setup(props) {
39
+ const { get : fetchChartOrganisationType, entity : chartOrganisationType } = useChartOrganisationType();
40
+ const { get : fetchChartOrganisation, entity : chartOrganisation } = useChartOrganisation();
41
+
42
+ const chart = computed(() => {
43
+ if (props.scope == ApplicationScope.Organisation) {
44
+ return chartOrganisation.value;
45
+ }
46
+ else if (props.scope == ApplicationScope.OrganisationType) {
47
+ return chartOrganisationType.value;
48
+ }
49
+ else {
50
+ return null
51
+ }
52
+ });
53
+
54
+ watch(() => [props.chartId, props.scope], () => {
55
+ if (props.scope == ApplicationScope.Organisation) {
56
+ fetchChartOrganisation(props.chartId);
57
+ }
58
+ else if (props.scope == ApplicationScope.OrganisationType) {
59
+ fetchChartOrganisationType(props.chartId)
60
+ }
61
+ }, {immediate : true})
62
+
63
+ return {
64
+ ColorEnum,
65
+ chart,
66
+ chartIcon
67
+ };
68
+ }
69
+ });
70
+ </script>
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.127",
4
+ "version": "1.0.128-dvh",
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.127",
14
- "@dative-gpi/foundation-core-services": "1.0.127",
15
- "@dative-gpi/foundation-shared-components": "1.0.127",
16
- "@dative-gpi/foundation-shared-domain": "1.0.127",
17
- "@dative-gpi/foundation-shared-services": "1.0.127"
13
+ "@dative-gpi/foundation-core-domain": "1.0.128-dvh",
14
+ "@dative-gpi/foundation-core-services": "1.0.128-dvh",
15
+ "@dative-gpi/foundation-shared-components": "1.0.128-dvh",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.128-dvh",
17
+ "@dative-gpi/foundation-shared-services": "1.0.128-dvh"
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": "b0ad78457ad86632d841709d3fc3951a8e44c667"
29
+ "gitHead": "02186299b1e99ef0040b5f09892143f046fe119d"
30
30
  }