@dative-gpi/foundation-core-components 1.1.23 → 1.1.24-unit-formatter

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.
Files changed (39) hide show
  1. package/components/autocompletes/FSAutocompleteDataCategory.vue +2 -11
  2. package/components/entities/FSBaseEntitiesList.vue +0 -4
  3. package/components/entities/FSEntityField.vue +5 -11
  4. package/components/entities/FSSelectEntitiesList.vue +8 -35
  5. package/components/entities/FSSimpleEntitiesList.vue +2 -15
  6. package/components/entities/FSTileEntitiesList.vue +3 -1
  7. package/components/explorers/FSBaseFoldersExplorer.vue +337 -0
  8. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +6 -7
  9. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +6 -7
  10. package/components/lists/charts/FSBaseChartsList.vue +14 -7
  11. package/components/lists/dashboards/FSBaseDashboardsList.vue +224 -40
  12. package/components/lists/dashboards/FSSimpleDashboardsList.vue +53 -27
  13. package/components/lists/dashboards/FSTileDashboardsList.vue +62 -30
  14. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -10
  15. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +7 -10
  16. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +1 -66
  17. package/components/lists/folders/FSBaseFoldersList.vue +5 -1
  18. package/components/lists/groupings/FSBaseGroupingsList.vue +17 -5
  19. package/components/lists/groups/FSSimpleGroupsList.vue +0 -1
  20. package/components/lists/locations/FSBaseLocationsList.vue +3 -3
  21. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +1 -21
  22. package/components/lists/userOrganisations/{FSUserOrganisationsChipGroup.vue → FSChipUserOrganisationsList.vue} +2 -2
  23. package/components/tiles/FSLocationTile.vue +1 -2
  24. package/package.json +8 -8
  25. package/utils/dashboards.ts +30 -12
  26. package/utils/tables.ts +7 -13
  27. package/utils/users.ts +1 -1
  28. package/components/explorers/FSBaseDashboardsExplorer.vue +0 -312
  29. package/components/explorers/FSDashboardExplorerElementTypeChip.vue +0 -37
  30. package/components/lists/groupings/FSSimpleGroupingsList.vue +0 -44
  31. package/components/lists/groupings/FSTileGroupingsList.vue +0 -79
  32. package/components/lists/playlists/FSTilePlaylistsList.vue +0 -93
  33. package/components/lists/subgroupings/FSBaseSubgroupingsList.vue +0 -197
  34. package/components/lists/subgroupings/FSSimpleSubgroupingsList.vue +0 -45
  35. package/components/lists/subgroupings/FSSubgroupingsChipGroup.vue +0 -61
  36. package/components/lists/subgroupings/FSTileSubgroupingsList.vue +0 -81
  37. package/components/tiles/FSGroupingTile.vue +0 -67
  38. package/components/tiles/FSPlaylistTile.vue +0 -78
  39. package/components/tiles/FSSubgroupingTile.vue +0 -69
@@ -41,18 +41,17 @@
41
41
  <template
42
42
  #item.tile="{ index, item }"
43
43
  >
44
- <FSCard
44
+ <FSClickable
45
45
  :key="index"
46
46
  padding="12px"
47
47
  height="60px"
48
48
  width="233px"
49
- :variant="isSelected(item.id) ? CardVariants.Standard : CardVariants.Background"
50
- :color="ColorEnum.Primary"
49
+ :color="isSelected(item.id) ? ColorEnum.Primary : ColorEnum.Dark"
51
50
  @click="$emit('update:modelValue', [item.id])"
52
51
  v-bind="$attrs"
53
52
  >
54
53
  <template
55
- #default="{ contentVariant }"
54
+ #default
56
55
  >
57
56
  <FSRow
58
57
  align="center-center"
@@ -67,11 +66,11 @@
67
66
  <FSIcon
68
67
  :color="item.correlated ? ColorEnum.Primary : ColorEnum.Light"
69
68
  :icon="item.correlated ? 'mdi-link' : 'mdi-link-off'"
70
- :variant="contentVariant"
69
+ variant="dark"
71
70
  />
72
71
  </FSRow>
73
72
  </template>
74
- </FSCard>
73
+ </FSClickable>
75
74
  </template>
76
75
  </FSDataTable>
77
76
  </FSFadeOut>
@@ -82,7 +81,7 @@
82
81
  import { defineComponent, type PropType, ref, watch } from "vue";
83
82
  import _ from "lodash";
84
83
 
85
- import {CardVariants, ColorEnum} from "@dative-gpi/foundation-shared-components/models";
84
+ import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
86
85
 
87
86
  import { useDataCategories } from "@dative-gpi/foundation-core-services/composables";
88
87
  import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/models";
@@ -90,10 +89,10 @@ import type { DataCategoryFilters } from "@dative-gpi/foundation-core-domain/mod
90
89
  import FSDataTable from "../FSDataTable.vue";
91
90
  import FSCol from "@dative-gpi/foundation-shared-components/components/FSCol.vue";
92
91
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
93
- import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
94
92
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
95
93
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
96
94
  import FSFadeOut from "@dative-gpi/foundation-shared-components/components/FSFadeOut.vue";
95
+ import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue";
97
96
  import FSSearchField from "@dative-gpi/foundation-shared-components/components/fields/FSSearchField.vue";
98
97
  import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
99
98
 
@@ -103,7 +102,7 @@ export default defineComponent({
103
102
  FSDataTable,
104
103
  FSCol,
105
104
  FSFadeOut,
106
- FSCard,
105
+ FSClickable,
107
106
  FSRow,
108
107
  FSSpan,
109
108
  FSSearchField,
@@ -147,7 +146,6 @@ export default defineComponent({
147
146
  return {
148
147
  fetchingDataCategories,
149
148
  dataCategories,
150
- CardVariants,
151
149
  ColorEnum,
152
150
  search,
153
151
  correlated,
@@ -28,18 +28,17 @@
28
28
  <template
29
29
  #item.tile="{ index, item }"
30
30
  >
31
- <FSCard
31
+ <FSClickable
32
32
  :key="index"
33
33
  padding="12px"
34
34
  height="60px"
35
35
  width="233px"
36
- :color="ColorEnum.Primary"
37
- :variant="isSelected(item.id) ? CardVariants.Standard : CardVariants.Background"
36
+ :color="isSelected(item.id) ? ColorEnum.Primary : ColorEnum.Light"
38
37
  @click="$emit('update:modelValue', [item.id])"
39
38
  v-bind="$attrs"
40
39
  >
41
40
  <template
42
- #default="{ contentVariant }"
41
+ #default
43
42
  >
44
43
  <FSRow
45
44
  align="center-center"
@@ -55,12 +54,11 @@
55
54
  <v-spacer/>
56
55
  <FSIcon
57
56
  :color="ColorEnum.Primary"
58
- :variant="contentVariant"
59
57
  icon="mdi-link"
60
58
  />
61
59
  </FSRow>
62
60
  </template>
63
- </FSCard>
61
+ </FSClickable>
64
62
  </template>
65
63
  </FSDataTable>
66
64
  </template>
@@ -69,7 +67,7 @@
69
67
  import { defineComponent, type PropType, watch } from "vue";
70
68
  import _ from "lodash";
71
69
 
72
- import { CardVariants, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
70
+ import {ColorEnum} from "@dative-gpi/foundation-shared-components/models";
73
71
 
74
72
  import { useDataDefinitions } from "@dative-gpi/foundation-core-services/composables";
75
73
  import type { DataDefinitionFilters } from "@dative-gpi/foundation-core-domain/models";
@@ -78,7 +76,7 @@ import FSDataTable from "../FSDataTable.vue";
78
76
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
79
77
  import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
80
78
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
81
- import FSCard from "@dative-gpi/foundation-shared-components/components/FSCard.vue";
79
+ import FSClickable from "@dative-gpi/foundation-shared-components/components/FSClickable.vue";
82
80
  import FSButtonCheckbox from "@dative-gpi/foundation-shared-components/components/buttons/FSButtonCheckbox.vue";
83
81
 
84
82
  export default defineComponent({
@@ -86,7 +84,7 @@ export default defineComponent({
86
84
  components: {
87
85
  FSButtonCheckbox,
88
86
  FSDataTable,
89
- FSCard,
87
+ FSClickable,
90
88
  FSSpan,
91
89
  FSIcon,
92
90
  FSRow,
@@ -125,7 +123,6 @@ export default defineComponent({
125
123
  return {
126
124
  fetchingDataDefinitions,
127
125
  dataDefinitions,
128
- CardVariants,
129
126
  ColorEnum,
130
127
  isSelected
131
128
  };
@@ -115,29 +115,6 @@
115
115
  {{ item.ownerAddress ? item.ownerAddress.formattedAddress : '' }}
116
116
  </FSSpan>
117
117
  </template>
118
- <template
119
- #item.subgroupings="{ item }"
120
- >
121
- <FSSubgroupingsChipGroup
122
- :subgroupings="item.subgroupings"
123
- />
124
- </template>
125
- <template
126
- #filter.subgroupings-custom="{ filter, toggle, variant }"
127
- >
128
- <FSSubgroupingChip
129
- v-if="filter.value && subgroupingMap[filter.value]"
130
- width="100%"
131
- :groupingLabel="subgroupingMap[filter.value].groupingLabel"
132
- :groupingIcon="subgroupingMap[filter.value].groupingIcon"
133
- :groupingColor="subgroupingMap[filter.value].groupingColor"
134
- :label="subgroupingMap[filter.value].label"
135
- :icon="subgroupingMap[filter.value].icon"
136
- :color="'primary'"
137
- :variant="variant"
138
- @click="toggle()"
139
- />
140
- </template>
141
118
  <template
142
119
  #item.actions="{ item }"
143
120
  >
@@ -211,19 +188,15 @@ import FSDeviceOrganisationTileUI from "@dative-gpi/foundation-shared-components
211
188
  import FSStatusesCarousel from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSStatusesCarousel.vue";
212
189
  import FSConnectivity from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSConnectivity.vue";
213
190
  import FSWorstAlert from "@dative-gpi/foundation-shared-components/components/deviceOrganisations/FSWorstAlert.vue";
214
- import FSSubgroupingChip from "@dative-gpi/foundation-shared-components/components/FSSubgroupingChip.vue";
215
191
  import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
216
192
  import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
217
193
  import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
218
194
  import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
219
- import FSSubgroupingsChipGroup from "../subgroupings/FSSubgroupingsChipGroup.vue";
220
195
 
221
196
  export default defineComponent({
222
197
  name: "FSBaseDeviceOrganisationsList",
223
198
  components: {
224
199
  FSDeviceOrganisationTileUI,
225
- FSSubgroupingsChipGroup,
226
- FSSubgroupingChip,
227
200
  FSStatusesCarousel,
228
201
  FSConnectivity,
229
202
  FSWorstAlert,
@@ -288,33 +261,7 @@ export default defineComponent({
288
261
  return entities.value;
289
262
  });
290
263
 
291
- const subgroupingFilters = computed(() => {
292
- const filters: { value: string | null, text: string }[] = [{
293
- value: null,
294
- text: "—"
295
- }];
296
-
297
- const uniqueSubgroupings = _.uniqBy(
298
- entities.value.flatMap(device => device.subgroupings),
299
- 'id'
300
- );
301
-
302
- filters.push(...uniqueSubgroupings.map(subgrouping => ({
303
- value: subgrouping.id,
304
- text: `${subgrouping.groupingLabel} - ${subgrouping.label}`
305
- })));
306
-
307
- return filters.sort((a, b) => a.text.localeCompare(b.text));
308
- });
309
-
310
- const subgroupingMap = computed(() => {
311
- return _.chain(entities.value)
312
- .flatMap(device => device.subgroupings)
313
- .keyBy('id')
314
- .value();
315
- });
316
-
317
- const headersOptions = computed((): Record<string, any> => ({
264
+ const headersOptions = computed(() => ({
318
265
  status: {
319
266
  fixedFilters: [{
320
267
  value: true,
@@ -392,17 +339,6 @@ export default defineComponent({
392
339
  },
393
340
  sort: (a: DeviceOrganisationAlert, b: DeviceOrganisationAlert) => alphanumericSort(a?.criticity, b?.criticity)
394
341
  },
395
- subgroupings: {
396
-
397
- fixedFilters: subgroupingFilters.value,
398
- methodFilterRaw: (value: string | null, item: DeviceOrganisationInfos) => {
399
- if (!value) {
400
- return item.subgroupings.length === 0;
401
- }
402
- return item.subgroupings.some(s => s.id === value);
403
- },
404
- sort: (a: any[], b: any[]) => a.length - b.length
405
- },
406
342
  ...customProperties.value.reduce((acc, cp) => ({
407
343
  ...acc,
408
344
  [`meta.${cp.code}`]: {
@@ -446,7 +382,6 @@ export default defineComponent({
446
382
  deviceOrganisations,
447
383
  ConnectivityStatus,
448
384
  customProperties,
449
- subgroupingMap,
450
385
  headersOptions,
451
386
  isSelected
452
387
  };
@@ -58,6 +58,8 @@ import { defineComponent, type PropType, watch } from "vue";
58
58
 
59
59
  import { useFolders } from "@dative-gpi/foundation-core-services/composables";
60
60
 
61
+ import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
62
+ import { FoldersListType } from "@dative-gpi/foundation-core-components/utils";
61
63
  import type { FolderFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
62
64
 
63
65
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
@@ -117,7 +119,9 @@ export default defineComponent({
117
119
  fetchingFolders,
118
120
  folders,
119
121
  onSelect,
120
- isSelected
122
+ isSelected,
123
+ FoldersListType,
124
+ DashboardType
121
125
  };
122
126
  }
123
127
  });
@@ -2,10 +2,12 @@
2
2
  <FSDataTable
3
3
  defaultMode="iterator"
4
4
  :loading="fetchingGroupings"
5
- :singleSelect="$props.singleSelect"
6
- :selectable="$props.selectable"
7
5
  :items="groupings"
8
6
  :itemTo="$props.itemTo"
7
+ :selectable="$props.selectable"
8
+ :showSearch="$props.showSearch"
9
+ :singleSelect="$props.singleSelect"
10
+ :disableTable="$props.disableTable"
9
11
  :modelValue="$props.modelValue"
10
12
  @update:modelValue="$emit('update:modelValue', $event)"
11
13
  v-bind="$attrs"
@@ -72,7 +74,7 @@ export default defineComponent({
72
74
  type: Function as PropType<(item: GroupingInfos) => Partial<RouteLocation>>,
73
75
  required: false
74
76
  },
75
- groupingFilters: {
77
+ groupingsFilters: {
76
78
  type: Object as PropType<GroupingFilters>,
77
79
  required: false,
78
80
  default: null
@@ -92,6 +94,16 @@ export default defineComponent({
92
94
  required: false,
93
95
  default: () => []
94
96
  },
97
+ showSearch: {
98
+ type: Boolean,
99
+ required: false,
100
+ default: false
101
+ },
102
+ disableTable: {
103
+ type: Boolean,
104
+ required: false,
105
+ default: true
106
+ }
95
107
  },
96
108
  emits: ["update:modelValue"],
97
109
  setup(props) {
@@ -101,9 +113,9 @@ export default defineComponent({
101
113
  return props.modelValue.includes(id);
102
114
  };
103
115
 
104
- watch(() => props.groupingFilters, (next, previous) => {
116
+ watch(() => props.groupingsFilters, (next, previous) => {
105
117
  if ((!next && !previous) || !_.isEqual(next, previous)) {
106
- fetchGroupings(props.groupingFilters);
118
+ fetchGroupings(props.groupingsFilters);
107
119
  }
108
120
  }, { immediate: true });
109
121
 
@@ -26,7 +26,6 @@ export default defineComponent({
26
26
  default: () => ({})
27
27
  }
28
28
  },
29
- innheritAttrs: false,
30
29
  setup(props){
31
30
  const { entities: groups, getMany, fetching } = useGroups();
32
31
 
@@ -31,14 +31,14 @@
31
31
  >
32
32
  <FSLocationTileUI
33
33
  :key="index"
34
- v-bind="item"
35
34
  :bottomColor="item.colors"
35
+ :address="item.address.placeLabel"
36
36
  :selectable="$props.selectable"
37
- :singleSelect="$props.singleSelect"
37
+ :singleSelect="singleSelect"
38
38
  :modelValue="isSelected(item.id)"
39
39
  :to="$props.itemTo && $props.itemTo(item)"
40
40
  @update:modelValue="toggleSelect(item)"
41
- :address="item.address.formattedAddress"
41
+ v-bind="item"
42
42
  />
43
43
  </template>
44
44
  </FSDataTable>
@@ -50,13 +50,6 @@
50
50
  :value="item.allowSms"
51
51
  />
52
52
  </template>
53
- <template
54
- #item.allowNotifications="{ item }"
55
- >
56
- <FSIconCheck
57
- :value="item.allowNotifications"
58
- />
59
- </template>
60
53
  <template
61
54
  #item.tags="{ item }"
62
55
  >
@@ -84,15 +77,6 @@
84
77
  {{ userTypeLabel(item.userType) }}
85
78
  </FSSpan>
86
79
  </template>
87
- <template
88
- #item.lastActivity="{ item }"
89
- >
90
- <FSSpan
91
- font="text-overline"
92
- >
93
- {{ epochToLongTimeFormat(item.lastActivity) }}
94
- </FSSpan>
95
- </template>
96
80
  <template
97
81
  #item.tile="{ index, item, toggleSelect }"
98
82
  >
@@ -113,8 +97,6 @@ import { defineComponent, type PropType, watch } from "vue";
113
97
  import { type RouteLocation } from "vue-router";
114
98
  import _ from "lodash";
115
99
 
116
- import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
117
-
118
100
  import type { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
119
101
  import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
120
102
  import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
@@ -167,7 +149,6 @@ export default defineComponent({
167
149
  emits: ["update:modelValue"],
168
150
  setup(props) {
169
151
  const { getMany: fetchUserOrganisations, entities: userOrganisations, fetching: fetchingUserOrganisations } = useUserOrganisations();
170
- const { epochToLongTimeFormat } = useDateFormat();
171
152
 
172
153
  const isSelected = (id: string): boolean => {
173
154
  return props.modelValue.includes(id);
@@ -184,8 +165,7 @@ export default defineComponent({
184
165
  userOrganisations,
185
166
  userValidityLabel,
186
167
  userTypeLabel,
187
- isSelected,
188
- epochToLongTimeFormat,
168
+ isSelected
189
169
  };
190
170
  }
191
171
  });
@@ -12,7 +12,7 @@
12
12
  <FSChipGroup
13
13
  v-else
14
14
  :color="ColorEnum.Light"
15
- :items="userOrganisations?.map(u => u.name)"
15
+ :labels="userOrganisations?.map(u => u.name)"
16
16
  v-bind="$attrs"
17
17
  />
18
18
  </template>
@@ -28,7 +28,7 @@ import FSLoader from "@dative-gpi/foundation-shared-components/components/FSLoad
28
28
  import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
29
29
 
30
30
  export default defineComponent({
31
- name: "FSUserOrganisationsChipGroup",
31
+ name: "FSChipUserOrganisationsList",
32
32
  components: {
33
33
  FSChipGroup,
34
34
  FSLoader,
@@ -11,7 +11,7 @@
11
11
  :label="entity.label"
12
12
  :code="entity.code"
13
13
  :color="entity.color"
14
- :address="entity.address.formattedAddress"
14
+ :address="entity.address.placeLabel"
15
15
  :deviceCount="entity.deviceOrganisationsCount"
16
16
  :selectable="$props.selectable"
17
17
  :modelValue="modelValue"
@@ -51,7 +51,6 @@ export default defineComponent({
51
51
  }
52
52
  },
53
53
  emits: ['update:modelValue'],
54
- inheritAttrs: false,
55
54
  setup(props) {
56
55
  const { get, getting, entity } = useLocation();
57
56
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.1.23",
7
+ "version": "1.1.24-unit-formatter",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,21 +13,21 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-core-domain": "1.1.23",
17
- "@dative-gpi/foundation-core-services": "1.1.23",
18
- "@dative-gpi/foundation-shared-components": "1.1.23",
19
- "@dative-gpi/foundation-shared-domain": "1.1.23",
20
- "@dative-gpi/foundation-shared-services": "1.1.23"
16
+ "@dative-gpi/foundation-core-domain": "1.1.24-unit-formatter",
17
+ "@dative-gpi/foundation-core-services": "1.1.24-unit-formatter",
18
+ "@dative-gpi/foundation-shared-components": "1.1.24-unit-formatter",
19
+ "@dative-gpi/foundation-shared-domain": "1.1.24-unit-formatter",
20
+ "@dative-gpi/foundation-shared-services": "1.1.24-unit-formatter"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@dative-gpi/bones-ui": "^1.0.0",
24
24
  "color": "^4.2.3",
25
- "vue": "^3.5.26"
25
+ "vue": "^3.4.38"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/color": "3.0.6",
29
29
  "sass": "1.71.1",
30
30
  "sass-loader": "13.3.2"
31
31
  },
32
- "gitHead": "b89c8c5be537d450306310fa9dbec12a4477eed6"
32
+ "gitHead": "ac04fd5da2ebd73bfb31ff6ffc4f5ff54a872e9e"
33
33
  }
@@ -1,14 +1,15 @@
1
+ import type { DashboardOrganisationInfos, DashboardOrganisationTypeInfos, DashboardShallowInfos, FolderInfos } from "@dative-gpi/foundation-core-domain/models";
1
2
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
3
  import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
3
- import { DashboardExplorerElementType, DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
4
+ import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
4
5
 
5
6
  const { $tr } = useTranslationsProvider();
6
7
 
7
8
  export const dashboardTypeLabel = (type: DashboardType): string => {
8
9
  switch (type) {
9
10
  case DashboardType.None: return $tr("ui.common.none", "None");
10
- case DashboardType.Organisation: return $tr("ui.common.custom", "Custom");
11
- case DashboardType.Shallow: return $tr('ui.dashboard-type.shallow', 'Shallow copy');
11
+ case DashboardType.Organisation: return $tr('ui.dashboard-type.shallow', 'Shallow copy');
12
+ case DashboardType.Shallow: return $tr("ui.common.custom", "Custom");
12
13
  case DashboardType.OrganisationType: return $tr("ui.common.shared", "Shared");
13
14
  }
14
15
  };
@@ -22,12 +23,29 @@ export const dashboardTypeColor = (type: DashboardType): ColorBase => {
22
23
  }
23
24
  };
24
25
 
25
- export const dashboardExplorerElementTypeLabel = (type: DashboardExplorerElementType): string => {
26
- switch (type) {
27
- case DashboardExplorerElementType.Folder: return $tr("ui.common.folder", "Folder");
28
- case DashboardExplorerElementType.DashboardOrganisation: return $tr("ui.common.custom", "Custom");
29
- case DashboardExplorerElementType.DashboardShallow: return $tr("ui.dashboard-type.shallow", "Shallow copy");
30
- case DashboardExplorerElementType.DashboardOrganisationType: return $tr("ui.common.shared", "Shared");
31
- default: return $tr("ui.common.none", "None");
32
- }
33
- };
26
+ export interface DashboardShallowListItem extends DashboardShallowInfos {
27
+ dashboardType: DashboardType.Shallow
28
+ type: FoldersListType.Dashboard
29
+ }
30
+
31
+ export interface DashboardOrganisationListItem extends DashboardOrganisationInfos {
32
+ dashboardType: DashboardType.Organisation
33
+ type: FoldersListType.Dashboard
34
+ }
35
+
36
+ export interface OrganisationTypeDashboardListItem extends DashboardOrganisationTypeInfos {
37
+ dashboardType: DashboardType.OrganisationType
38
+ }
39
+
40
+ export interface FolderListItem extends FolderInfos {
41
+ dashboardType: DashboardType.None
42
+ type: FoldersListType.Folder
43
+ }
44
+
45
+ export enum FoldersListType {
46
+ Dashboard = "dashboard",
47
+ Folder = "folder"
48
+ }
49
+
50
+ export type DashboardsListItem = DashboardShallowListItem | DashboardOrganisationListItem | OrganisationTypeDashboardListItem;
51
+ export type FoldersListItem = DashboardShallowListItem | DashboardOrganisationListItem | FolderListItem;
package/utils/tables.ts CHANGED
@@ -1,35 +1,29 @@
1
1
 
2
- export const DASHBOARDS_EXPLORER_MAIN = "ui.tables.dashboard-explorer-element.main";
3
- export const DASHBOARDS_ORGANISATION_TYPE_MAIN = "ui.tables.dashboard-organisation-type.main";
4
-
5
- export const DEVICES_EXPLORER_MAIN = "ui.tables.device-explorer-element.main";
2
+ export const DASHBOARDS_EXPLORER_MAIN = "ui.tables.folder-mock.explorer-main";
3
+ export const DASHBOARDS_EXPLORER_SHARED = "ui.tables.dashboard-mock.explorer-shared";
4
+ export const DEVICES_EXPLORER_MAIN = "ui.tables.group-mock.explorer-main";
6
5
 
7
6
  export const DEVICES_LIST_MAIN = "ui.tables.device.main";
8
7
  export const DEVICES_MAINTENANCE = "ui.tables.device.maintenance";
9
8
  export const LOCATIONS_LIST_MAIN = "ui.tables.location.main";
10
9
 
11
- export const CHARTS_LIST_ORGANISATION = "ui.tables.chart.organisation";
10
+ export const CHARTS_LIST_MAIN = "ui.tables.chart.main";
12
11
  export const CHARTS_LIST_SHARED = "ui.tables.chart.shared";
13
12
 
14
13
  export const SCENARIOS_LIST_MAIN = "ui.tables.scenario.main";
15
- export const SCENARIOS_LIST_ORGANISATION = "ui.tables.scenario.organisation";
16
14
  export const SCENARIOS_LIST_SHARED = "ui.tables.scenario.shared";
17
15
  export const CONNECTIVITY_SCENARIOS_LIST_MAIN = "ui.tables.connectivity-scenario.main";
18
16
 
19
17
  export const ALERTS_LIST_MAIN = "ui.tables.alert.main";
20
18
  export const CONNECTIVITY_ALERTS_LIST_MAIN = "ui.tables.connectivity-alert.main";
21
19
 
22
- export const GROUPINGS_LIST_MAIN = "ui.tables.grouping.main";
23
-
24
- export const CHARTS_LIST_SELECT = "ui.tables.chart.select";
25
- export const DATA_CATEGORIES_SELECT = "ui.tables.data-category.select";
26
20
  export const DEVICES_SELECT = "ui.tables.device.select";
27
21
  export const GROUPS_SELECT = "ui.tables.group.select";
28
22
  export const LOCATIONS_SELECT = "ui.tables.location.select";
29
23
  export const MODELS_SELECT = "ui.tables.model.select";
30
- export const DASHBOARDS_SELECT = "ui.tables.dashboard-explorer-element.select";
31
- export const GROUPINGS_SELECT = "ui.tables.grouping.select";
32
- export const SUBGROUPINGS_SELECT = "ui.tables.subgrouping.select";
24
+ export const DASHBOARDS_SELECT = "ui.tables.dashboard-mock.select";
25
+
26
+ export const WIDGET_DASHBOARDS_EXPLORER = "ui.tables.folder-mock.widget";
33
27
 
34
28
  export const LOCATION_DEVICES = "ui.tables.device.location-devices";
35
29
  export const DEVICE_ALERTS = "ui.tables.alert.device-alerts";
package/utils/users.ts CHANGED
@@ -29,4 +29,4 @@ export const userValidityLabel = (validity: UserValidityState): string => {
29
29
  case UserValidityState.AccountValidated: return $tr("ui.user-validity.account-validated", "Validated");
30
30
  default: return "";
31
31
  }
32
- }
32
+ }