@dative-gpi/foundation-core-components 1.0.129 → 1.0.130-maps2

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.
@@ -282,7 +282,7 @@ export default defineComponent({
282
282
  }
283
283
 
284
284
  // Delay to wait before fetching after a search change
285
- const debounceFetch = (): void => debounce(fetch, 1500);
285
+ const debounceFetch = (): void => debounce(fetch, 1000);
286
286
 
287
287
  watch([() => props.parentId, () => props.root], (next, previous) => {
288
288
  if ((!next && !previous) || !_.isEqual(next, previous)) {
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="items"
4
5
  :item-to="$props.itemTo"
5
6
  :loading="fetchingFolders || fetchingDashboardOrganisations || fetchingDashboardShallows"
@@ -63,6 +64,15 @@
63
64
  :value="item.locked"
64
65
  />
65
66
  </template>
67
+ <template
68
+ #item.tags="{ item }"
69
+ >
70
+ <FSTagGroup
71
+ variant="slide"
72
+ :editable="false"
73
+ :tags="item.tags"
74
+ />
75
+ </template>
66
76
  <template
67
77
  #item.tile="{ item, toggleSelect }"
68
78
  >
@@ -108,6 +118,7 @@ import type { FolderFilters, DashboardOrganisationFilters, DashboardShallowFilte
108
118
 
109
119
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
110
120
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
121
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
111
122
  import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
112
123
  import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
113
124
  import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
@@ -118,13 +129,14 @@ import FSDataTable from "../lists/FSDataTable.vue";
118
129
  export default defineComponent({
119
130
  name: "FSBaseFoldersExplorer",
120
131
  components: {
121
- FSDataTable,
122
- FSIcon,
123
- FSFolderTileUI,
124
132
  FSDashboardOrganisationTileUI,
125
133
  FSDashboardShallowTileUI,
134
+ FSFolderTileUI,
135
+ FSDataTable,
126
136
  FSIconCheck,
127
- FSImage
137
+ FSTagGroup,
138
+ FSImage,
139
+ FSIcon
128
140
  },
129
141
  props: {
130
142
  foldersFilters: {
@@ -24,6 +24,7 @@
24
24
  #item.criticity="{ item }"
25
25
  >
26
26
  <FSRow
27
+ :wrap="false"
27
28
  align="center-left"
28
29
  gap="2px"
29
30
  >
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="chartOrganisationTypes"
4
5
  :itemTo="$props.itemTo"
5
6
  :loading="fetchingChartOrganisationTypes"
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="chartOrganisations"
4
5
  :itemTo="$props.itemTo"
5
6
  :loading="fetchingChartOrganisations"
@@ -54,6 +54,15 @@
54
54
  :label="$tr('ui.common.all', 'All')"
55
55
  />
56
56
  </template>
57
+ <template
58
+ #item.tags="{ item }"
59
+ >
60
+ <FSTagGroup
61
+ variant="slide"
62
+ :editable="false"
63
+ :tags="item.tags"
64
+ />
65
+ </template>
57
66
  <template
58
67
  #item.tile="{ item, toggleSelect }"
59
68
  >
@@ -69,26 +78,28 @@
69
78
  </template>
70
79
 
71
80
  <script lang="ts">
72
- import type { PropType} from "vue";
81
+ import { computed, defineComponent, onMounted, type PropType, watch } from "vue";
73
82
  import type { RouteLocation } from "vue-router";
74
- import { computed, defineComponent, onMounted, watch } from "vue";
75
83
  import _ from "lodash";
76
84
 
77
85
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
78
86
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
79
87
  import { useOrganisation } from "@dative-gpi/foundation-shared-services/composables";
80
88
 
81
- import FSDataTable from "../FSDataTable.vue";
89
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
82
90
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
83
91
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
84
92
  import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
85
93
  import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
86
94
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
87
95
 
96
+ import FSDataTable from "../FSDataTable.vue";
97
+
88
98
  export default defineComponent({
89
99
  name: "FSBaseDashboardOrganisationTypesList",
90
100
  components: {
91
101
  FSDataTable,
102
+ FSTagGroup,
92
103
  FSIcon,
93
104
  FSRow,
94
105
  FSText,
@@ -18,7 +18,6 @@
18
18
  v-bind="slotData"
19
19
  />
20
20
  </template>
21
-
22
21
  <template
23
22
  #item.icon="{ item }"
24
23
  >
@@ -26,7 +25,6 @@
26
25
  {{ item.icon }}
27
26
  </FSIcon>
28
27
  </template>
29
-
30
28
  <template
31
29
  #item.main="{ item }"
32
30
  >
@@ -41,7 +39,15 @@
41
39
  mdi-home
42
40
  </FSIcon>
43
41
  </template>
44
-
42
+ <template
43
+ #item.tags="{ item }"
44
+ >
45
+ <FSTagGroup
46
+ variant="slide"
47
+ :editable="false"
48
+ :tags="item.tags"
49
+ />
50
+ </template>
45
51
  <template
46
52
  #item.tile="{ item, toggleSelect }"
47
53
  >
@@ -75,9 +81,8 @@
75
81
 
76
82
  <script lang="ts">
77
83
  import _ from "lodash";
78
- import type { PropType} from "vue";
79
84
  import type { RouteLocation } from "vue-router";
80
- import { computed, defineComponent, onMounted, ref, watch } from "vue";
85
+ import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
81
86
 
82
87
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
83
88
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationFilters, DashboardShallowFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
@@ -86,16 +91,19 @@ import { useOrganisation } from "@dative-gpi/foundation-shared-services/composab
86
91
  import type { DashboardsListItem } from "@/core/foundation-core-components/utils";
87
92
  import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
88
93
 
89
- import FSDataTable from "../FSDataTable.vue";
94
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
90
95
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
91
96
  import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
92
97
  import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
93
98
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
94
99
 
100
+ import FSDataTable from "../FSDataTable.vue";
101
+
95
102
  export default defineComponent({
96
103
  name: "FSBaseDashboardsList",
97
104
  components: {
98
105
  FSDataTable,
106
+ FSTagGroup,
99
107
  FSIcon,
100
108
  FSDashboardOrganisationTileUI,
101
109
  FSDashboardOrganisationTypeTileUI,
@@ -19,6 +19,7 @@
19
19
  maskHeight="0px"
20
20
  >
21
21
  <FSDataTable
22
+ defaultMode="iterator"
22
23
  :loading="fetchingDataCategories"
23
24
  :items="dataCategories"
24
25
  :modelValue="$props.modelValue"
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :loading="fetchingDataDefinitions"
4
5
  :items="dataDefinitions"
5
6
  :tableCode="$props.tableCode"
@@ -160,11 +160,14 @@
160
160
  import { computed, defineComponent, onMounted, type PropType, watch } from "vue";
161
161
  import { type RouteLocation } from "vue-router";
162
162
  import _ from "lodash";
163
+
164
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
163
165
 
166
+ import { ConnectivityStatus, Criticity, PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
164
167
  import { alphanumericSort, connectivityLabel } from "@dative-gpi/foundation-shared-components/utils";
165
- import { ConnectivityStatus, PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
168
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
166
169
 
167
- import type { DeviceConnectivityDetails, DeviceOrganisationAlert, DeviceOrganisationFilters, DeviceOrganisationInfos} from "@dative-gpi/foundation-core-domain/models";
170
+ import type { DeviceConnectivityDetails, DeviceOrganisationAlert, DeviceOrganisationFilters, DeviceOrganisationInfos, DeviceStatusDetails} from "@dative-gpi/foundation-core-domain/models";
168
171
  import { useCustomProperties, useDeviceOrganisations } from "@dative-gpi/foundation-core-services/composables";
169
172
 
170
173
  import FSMetaValue from "../../customProperties/FSMetaValue.vue";
@@ -236,6 +239,7 @@ export default defineComponent({
236
239
  setup(props) {
237
240
  const { fetching: fecthingCustomProperties, entities: customProperties, getMany: getManyCustomProperties } = useCustomProperties();
238
241
  const { entities, fetching: fetchingDeviceOrganisations, getMany: getManyDeviceOrganisations } = useDeviceOrganisations();
242
+ const { $tr } = useTranslationsProvider();
239
243
 
240
244
  const deviceOrganisations = computed((): DeviceOrganisationInfos[] => {
241
245
  if (props.connectedOnly) {
@@ -245,6 +249,19 @@ export default defineComponent({
245
249
  });
246
250
 
247
251
  const headersOptions = computed(() => ({
252
+ status: {
253
+ fixedFilters: [{
254
+ value: true,
255
+ text: $tr("ui.device-organisation.has-statuses", "Has statuses")
256
+ }, {
257
+ value: false,
258
+ text: $tr("ui.device-organisation.has-no-statuses", "Has no statuses")
259
+ }],
260
+ methodFilter: (value: boolean, item: DeviceStatusDetails) => {
261
+ return value ? item.statuses.length > 0 : item.statuses.length === 0;
262
+ },
263
+ sort: (a: DeviceStatusDetails, b: DeviceStatusDetails) => a.statuses.length - b.statuses.length
264
+ },
248
265
  connectivity: {
249
266
  fixedFilters: [{
250
267
  value: ConnectivityStatus.None,
@@ -272,7 +289,41 @@ export default defineComponent({
272
289
  },
273
290
  sort: (a: DeviceConnectivityDetails, b: DeviceConnectivityDetails) => alphanumericSort(a?.status, b?.status)
274
291
  },
292
+ alerts: {
293
+ fixedFilters: [{
294
+ value: true,
295
+ text: $tr("ui.device-organisation.has-alerts", "Has alerts")
296
+ }, {
297
+ value: false,
298
+ text: $tr("ui.device-organisation.has-no-alerts", "Has no alerts")
299
+ }],
300
+ methodFilter: (value: boolean, item: DeviceOrganisationAlert[]) => {
301
+ return value ? item.length > 0 : item.length === 0;
302
+ },
303
+ sort: (a: DeviceOrganisationAlert[], b: DeviceOrganisationAlert[]) => a.length - b.length
304
+ },
275
305
  worstAlert: {
306
+ fixedFilters: [{
307
+ value: Criticity.None,
308
+ text: "—"
309
+ }, {
310
+ value: Criticity.Information,
311
+ text: AlertTools.criticityLabel(Criticity.Information)
312
+ }, {
313
+ value: Criticity.Warning,
314
+ text: AlertTools.criticityLabel(Criticity.Warning)
315
+ }, {
316
+ value: Criticity.Error,
317
+ text: AlertTools.criticityLabel(Criticity.Error)
318
+ }],
319
+ methodFilter: (value: Criticity, item: DeviceOrganisationAlert | null) => {
320
+ switch(value) {
321
+ case Criticity.None:
322
+ return !item;
323
+ default:
324
+ return item != null && item.criticity === value;
325
+ }
326
+ },
276
327
  sort: (a: DeviceOrganisationAlert, b: DeviceOrganisationAlert) => alphanumericSort(a?.criticity, b?.criticity)
277
328
  },
278
329
  ...customProperties.value.reduce((acc, cp) => ({
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <FSDataTable
3
- defaultMode="iterator"
4
3
  :items="serviceAccountOrganisations"
5
4
  :itemTo="$props.itemTo"
6
5
  :loading="fetchingServiceAccountOrganisations"
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <FSDataTable
3
- defaultMode="iterator"
4
3
  :items="userOrganisations"
5
4
  :itemTo="$props.itemTo"
6
5
  :loading="fetchingUserOrganisations"
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.129",
4
+ "version": "1.0.130-maps2",
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.129",
14
- "@dative-gpi/foundation-core-services": "1.0.129",
15
- "@dative-gpi/foundation-shared-components": "1.0.129",
16
- "@dative-gpi/foundation-shared-domain": "1.0.129",
17
- "@dative-gpi/foundation-shared-services": "1.0.129"
13
+ "@dative-gpi/foundation-core-domain": "1.0.130-maps2",
14
+ "@dative-gpi/foundation-core-services": "1.0.130-maps2",
15
+ "@dative-gpi/foundation-shared-components": "1.0.130-maps2",
16
+ "@dative-gpi/foundation-shared-domain": "1.0.130-maps2",
17
+ "@dative-gpi/foundation-shared-services": "1.0.130-maps2"
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": "73ebbdb8cfd158e2748933ec57315bc1b5fc4835"
29
+ "gitHead": "a0739b48282166f721cf6c2376a430e4690d92ef"
30
30
  }