@dative-gpi/foundation-core-components 1.0.70 → 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.
Files changed (84) hide show
  1. package/components/autocompletes/FSAutocompleteChart.vue +15 -8
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
  6. package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
  7. package/components/autocompletes/FSAutocompleteGrouping.vue +105 -0
  8. package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
  9. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
  10. package/components/autocompletes/FSAutocompleteModel.vue +9 -1
  11. package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
  12. package/components/autocompletes/FSAutocompleteRole.vue +14 -6
  13. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
  14. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
  15. package/components/customProperties/FSMetaField.vue +35 -40
  16. package/components/customProperties/FSMetaFormContent.vue +4 -3
  17. package/components/customProperties/FSMetaHistory.vue +2 -2
  18. package/components/customProperties/helpers.ts +57 -165
  19. package/components/entities/FSBaseEntitiesList.vue +12 -2
  20. package/components/entities/FSDialogSelectEntities.vue +19 -2
  21. package/components/entities/FSEntityField.vue +68 -13
  22. package/components/entities/FSSelectEntitiesList.vue +40 -7
  23. package/components/explorers/FSBaseDevicesExplorer.vue +322 -0
  24. package/components/explorers/FSBaseFoldersExplorer.vue +99 -20
  25. package/components/fields/FSMagicConfigField.vue +171 -0
  26. package/components/fields/FSMagicField.vue +214 -0
  27. package/components/lists/FSDataTable.vue +22 -16
  28. package/components/lists/alerts/FSBaseAlertsList.vue +96 -106
  29. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
  30. package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
  31. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +97 -34
  32. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +98 -34
  33. package/components/lists/charts/FSBaseChartsList.vue +153 -64
  34. package/components/lists/comments/FSBaseCommentsList.vue +39 -23
  35. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  36. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +41 -8
  37. package/components/lists/dashboards/FSBaseDashboardsList.vue +76 -16
  38. package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
  39. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -6
  40. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +8 -5
  41. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +70 -44
  42. package/components/lists/folders/FSBaseFoldersList.vue +27 -15
  43. package/components/lists/groupings/FSBaseGroupingsList.vue +125 -0
  44. package/components/lists/groups/FSBaseGroupsList.vue +13 -9
  45. package/components/lists/locations/FSBaseLocationsList.vue +17 -13
  46. package/components/lists/models/FSBaseModelsList.vue +10 -5
  47. package/components/lists/playlists/FSSimplePlaylistsList.vue +44 -0
  48. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +6 -5
  49. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +6 -5
  50. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +45 -8
  51. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +45 -7
  52. package/components/lists/scenarios/FSBaseScenariosList.vue +121 -86
  53. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +10 -7
  54. package/components/lists/serviceAccountRoleOrganisations/{FSBaseServiceAccountRoleOrganisations.vue → FSBaseServiceAccountRoleOrganisationsList.vue} +6 -5
  55. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +10 -7
  56. package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
  57. package/components/selects/FSPlotPerSelector.vue +94 -16
  58. package/components/tiles/FSChartTile.vue +71 -0
  59. package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
  60. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
  61. package/components/tiles/FSDashboardShallowTile.vue +3 -3
  62. package/components/tiles/FSDeviceOrganisationTile.vue +3 -3
  63. package/components/tiles/FSFolderTile.vue +7 -5
  64. package/components/tiles/FSGroupTile.vue +3 -3
  65. package/components/tiles/FSLocationTile.vue +5 -3
  66. package/components/tiles/FSModelTile.vue +64 -0
  67. package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
  68. package/components/tiles/FSUserOrganisationTile.vue +3 -3
  69. package/components/treeviews/FSTreeViewGroup.vue +7 -1
  70. package/package.json +9 -9
  71. package/utils/dashboards.ts +4 -4
  72. package/utils/index.ts +0 -1
  73. package/utils/roles.ts +3 -3
  74. package/utils/users.ts +3 -3
  75. package/components/selects/FSAggregationSelector.vue +0 -51
  76. package/components/selects/FSAxisTypeSelector.vue +0 -48
  77. package/components/selects/FSDisplayAsSelector.vue +0 -52
  78. package/components/selects/FSFilterTypeSelector.vue +0 -53
  79. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  80. package/components/selects/FSOperationOnSelector.vue +0 -51
  81. package/components/selects/FSPlanningTypeSelector.vue +0 -51
  82. package/components/selects/FSSelectEntityType.vue +0 -59
  83. package/components/selects/FSSerieTypeSelector.vue +0 -51
  84. package/utils/charts.ts +0 -137
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingConnectivityScenarios"
4
+ :modelValue="$props.modelValue"
5
+ :items="connectivityScenarios"
6
+ :tableCode="$props.tableCode"
7
+ @update:modelValue="$emit('update:modelValue', $event)"
8
+ v-bind="$attrs"
9
+ >
10
+ <template
11
+ v-for="(_, name) in $slots"
12
+ v-slot:[name]="slotData"
13
+ >
14
+ <slot
15
+ :name="name"
16
+ v-bind="slotData"
17
+ />
18
+ </template>
19
+
20
+ <template
21
+ #item.time="{ item }"
22
+ >
23
+ {{ getTimeBestString(item.time) }}
24
+ </template>
25
+
26
+ <template
27
+ #item.deviceOrganisationImageId="{ item }"
28
+ >
29
+ <FSImage
30
+ v-if="item.deviceOrganisationImageId"
31
+ height="32px"
32
+ width="32px"
33
+ :imageId="item.deviceOrganisationImageId"
34
+ :thumbnail="true"
35
+ />
36
+ </template>
37
+ <template
38
+ #item.deviceOrganisationConnectivity="{ item }"
39
+ >
40
+ <FSIcon
41
+ v-if="item.deviceOrganisationConnectivity"
42
+ :icon="item.deviceOrganisationConnectivity.icon"
43
+ :color="item.deviceOrganisationConnectivity.color"
44
+ />
45
+ </template>
46
+ <template
47
+ #item.warnDeviceManager="{ item }"
48
+ >
49
+ <FSIconCheck
50
+ :value="item.warnDeviceManager"
51
+ />
52
+ </template>
53
+ <template
54
+ #item.warnOnReconnection="{ item }"
55
+ >
56
+ <FSIconCheck
57
+ :value="item.warnOnReconnection"
58
+ />
59
+ </template>
60
+ </FSDataTable>
61
+ </template>
62
+
63
+ <script lang="ts">
64
+ import { defineComponent, type PropType, watch } from "vue";
65
+ import _ from "lodash";
66
+
67
+ import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/enums";
68
+ import {ColorEnum } from "@dative-gpi/foundation-shared-components/models";
69
+ import { getTimeBestString } from "@dative-gpi/foundation-shared-components/utils"
70
+
71
+ import type { ConnectivityScenarioFilters } from "@dative-gpi/foundation-core-domain/models";
72
+ import { useConnectivityScenarios } from "@dative-gpi/foundation-core-services/composables";
73
+
74
+ import FSDataTable from "../FSDataTable.vue";
75
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
76
+ import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
77
+ import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
78
+
79
+ export default defineComponent({
80
+ name: "FSBaseConnectivityScenariosList",
81
+ components: {
82
+ FSDataTable,
83
+ FSIconCheck,
84
+ FSImage,
85
+ FSIcon
86
+ },
87
+ props: {
88
+ tableCode: {
89
+ type: String as PropType<string | null>,
90
+ required: false,
91
+ default: null
92
+ },
93
+ modelValue: {
94
+ type: Array as PropType<string[]>,
95
+ default: () => [],
96
+ required: false
97
+ },
98
+ connectivityScenarioFilters: {
99
+ type: Object as PropType<ConnectivityScenarioFilters>,
100
+ required: false,
101
+ default: null
102
+ }
103
+ },
104
+ emits: ["update:modelValue"],
105
+ setup(props) {
106
+ const { entities: connectivityScenarios, fetching: fetchingConnectivityScenarios, getMany: getManyConnectivityScenarios } = useConnectivityScenarios();
107
+
108
+ const fetch = () =>{
109
+ getManyConnectivityScenarios(props.connectivityScenarioFilters);
110
+ }
111
+
112
+ watch(() => [props.connectivityScenarioFilters], (next, previous) => {
113
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
114
+ fetch();
115
+ }
116
+ }, { immediate: true });
117
+
118
+
119
+ return {
120
+ fetchingConnectivityScenarios,
121
+ connectivityScenarios,
122
+ ConnectivityStatus,
123
+ ColorEnum,
124
+ getTimeBestString
125
+ };
126
+ }
127
+ });
128
+ </script>
@@ -1,9 +1,13 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
4
+ :loading="fetchingDashboardOrganisationTypes"
3
5
  :items="dashboardOrganisationTypes"
4
6
  :itemTo="$props.itemTo"
5
7
  :tableCode="$props.tableCode"
6
8
  :modelValue="$props.modelValue"
9
+ :selectable="$props.selectable"
10
+ :singleSelect="$props.singleSelect"
7
11
  @update:modelValue="$emit('update:modelValue', $event)"
8
12
  v-bind="$attrs"
9
13
  >
@@ -53,10 +57,22 @@
53
57
  />
54
58
  </template>
55
59
  <template
56
- #item.tile="{ item, toggleSelect }"
60
+ #item.tags="{ item }"
61
+ >
62
+ <FSTagGroup
63
+ variant="slide"
64
+ :showRemove="false"
65
+ :tags="item.tags"
66
+ />
67
+ </template>
68
+ <template
69
+ #item.tile="{ index, item, toggleSelect }"
57
70
  >
58
71
  <FSDashboardOrganisationTypeTileUI
72
+ :key="index"
59
73
  :bottomColor="item.colors"
74
+ :selectable="$props.selectable"
75
+ :singleSelect="$props.singleSelect"
60
76
  :to="$props.itemTo && $props.itemTo(item)"
61
77
  :modelValue="isSelected(item.id)"
62
78
  @update:modelValue="toggleSelect(item)"
@@ -67,26 +83,28 @@
67
83
  </template>
68
84
 
69
85
  <script lang="ts">
70
- import type { PropType} from "vue";
86
+ import { computed, defineComponent, onMounted, type PropType, watch } from "vue";
71
87
  import type { RouteLocation } from "vue-router";
72
- import { computed, defineComponent, onMounted, watch } from "vue";
73
88
  import _ from "lodash";
74
89
 
75
90
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
76
91
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
77
92
  import { useOrganisation } from "@dative-gpi/foundation-shared-services/composables";
78
93
 
79
- import FSDataTable from "../FSDataTable.vue";
94
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
80
95
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
81
96
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
82
97
  import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
83
98
  import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
84
99
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
85
100
 
101
+ import FSDataTable from "../FSDataTable.vue";
102
+
86
103
  export default defineComponent({
87
104
  name: "FSBaseDashboardOrganisationTypesList",
88
105
  components: {
89
106
  FSDataTable,
107
+ FSTagGroup,
90
108
  FSIcon,
91
109
  FSRow,
92
110
  FSText,
@@ -94,6 +112,11 @@ export default defineComponent({
94
112
  FSDashboardOrganisationTypeTileUI
95
113
  },
96
114
  props: {
115
+ tableCode: {
116
+ type: String as PropType<string | null>,
117
+ required: false,
118
+ default: null
119
+ },
97
120
  dashboardOrganisationTypeFilters: {
98
121
  type: Object as PropType<DashboardOrganisationTypeFilters>,
99
122
  default: undefined,
@@ -108,13 +131,22 @@ export default defineComponent({
108
131
  required: false,
109
132
  default: () => []
110
133
  },
111
- tableCode: {
112
- type: String,
113
- required: true
134
+ selectable: {
135
+ type: Boolean,
136
+ required: false,
137
+ default: true
114
138
  },
139
+ singleSelect: {
140
+ type: Boolean,
141
+ required: false,
142
+ default: false
143
+ }
115
144
  },
145
+ emits: [
146
+ "update:modelValue"
147
+ ],
116
148
  setup(props) {
117
- const { getMany: getDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
149
+ const { getMany: getDashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
118
150
  const { fetch: fetchUserOrganisation, entity: userOrganisation } = useCurrentUserOrganisation();
119
151
  const { get: fetchOrganisation, entity: organisation } = useOrganisation();
120
152
  const { organisationId } = useAppOrganisationId();
@@ -154,6 +186,7 @@ export default defineComponent({
154
186
  }, { immediate: true });
155
187
 
156
188
  return {
189
+ fetchingDashboardOrganisationTypes,
157
190
  userOrganisationMainDashboardId,
158
191
  organisationMainDashboardId,
159
192
  dashboardOrganisationTypes,
@@ -1,9 +1,13 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="items"
4
5
  :itemTo="$props.itemTo"
6
+ :headersOptions="headersOptions"
5
7
  :loading="fetchingDashboardOrganisationTypes || fetchingDashboardOrganisations || fetchingDashboardShallows"
6
8
  :tableCode="$props.tableCode"
9
+ :selectable="$props.selectable"
10
+ :singleSelect="$props.singleSelect"
7
11
  :modelValue="selecteds"
8
12
  @update:modelValue="onSelect"
9
13
  v-bind="$attrs"
@@ -17,7 +21,6 @@
17
21
  v-bind="slotData"
18
22
  />
19
23
  </template>
20
-
21
24
  <template
22
25
  #item.icon="{ item }"
23
26
  >
@@ -25,7 +28,14 @@
25
28
  {{ item.icon }}
26
29
  </FSIcon>
27
30
  </template>
28
-
31
+ <template
32
+ #item.dashboardType="{ item }"
33
+ >
34
+ <FSChip
35
+ :color="ColorEnum.Light"
36
+ :label="dashboardTypeLabel(item.dashboardType)"
37
+ />
38
+ </template>
29
39
  <template
30
40
  #item.main="{ item }"
31
41
  >
@@ -40,13 +50,24 @@
40
50
  mdi-home
41
51
  </FSIcon>
42
52
  </template>
43
-
44
53
  <template
45
- #item.tile="{ item, toggleSelect }"
54
+ #item.tags="{ item }"
55
+ >
56
+ <FSTagGroup
57
+ variant="slide"
58
+ :showRemove="false"
59
+ :tags="item.tags"
60
+ />
61
+ </template>
62
+ <template
63
+ #item.tile="{ index, item, toggleSelect }"
46
64
  >
47
65
  <FSDashboardOrganisationTypeTileUI
48
66
  v-if="item.dashboardType == DashboardType.OrganisationType"
67
+ :key="index"
49
68
  :bottomColor="item.colors"
69
+ :selectable="$props.selectable"
70
+ :singleSelect="$props.singleSelect"
50
71
  :to="$props.itemTo && $props.itemTo(item)"
51
72
  :modelValue="isSelected(item.id)"
52
73
  @update:modelValue="toggleSelect(item)"
@@ -54,7 +75,10 @@
54
75
  />
55
76
  <FSDashboardOrganisationTileUI
56
77
  v-if="item.dashboardType == DashboardType.Organisation"
78
+ :key="index"
57
79
  :bottomColor="item.colors"
80
+ :selectable="$props.selectable"
81
+ :singleSelect="$props.singleSelect"
58
82
  :to="$props.itemTo && $props.itemTo(item)"
59
83
  :modelValue="isSelected(item.id)"
60
84
  @update:modelValue="toggleSelect(item)"
@@ -62,7 +86,10 @@
62
86
  />
63
87
  <FSDashboardShallowTileUI
64
88
  v-if="item.dashboardType == DashboardType.Shallow"
89
+ :key="index"
65
90
  :bottomColor="item.colors"
91
+ :selectable="$props.selectable"
92
+ :singleSelect="$props.singleSelect"
66
93
  :modelValue="isSelected(item.id)"
67
94
  @update:modelValue="toggleSelect(item)"
68
95
  :to="$props.itemTo && $props.itemTo(item)"
@@ -74,33 +101,44 @@
74
101
 
75
102
  <script lang="ts">
76
103
  import _ from "lodash";
77
- import type { PropType} from "vue";
78
104
  import type { RouteLocation } from "vue-router";
79
- import { computed, defineComponent, onMounted, ref, watch } from "vue";
105
+ import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
80
106
 
81
107
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
82
108
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationFilters, DashboardShallowFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
83
109
  import { useOrganisation } from "@dative-gpi/foundation-shared-services/composables";
84
110
 
85
- import type { DashboardsListItem } from "@/core/foundation-core-components/utils";
111
+ import { dashboardTypeLabel, type DashboardsListItem } from "@dative-gpi/foundation-core-components/utils";
112
+ import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
86
113
  import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
114
+ import { getEnumEntries } from '@dative-gpi/foundation-shared-domain';
87
115
 
88
- import FSDataTable from "../FSDataTable.vue";
116
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
89
117
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
90
118
  import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
91
119
  import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
92
120
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
93
121
 
122
+ import FSDataTable from "../FSDataTable.vue";
123
+ import FSChip from '@dative-gpi/foundation-shared-components/components/FSChip.vue';
124
+
94
125
  export default defineComponent({
95
126
  name: "FSBaseDashboardsList",
96
127
  components: {
97
128
  FSDataTable,
129
+ FSTagGroup,
130
+ FSChip,
98
131
  FSIcon,
99
132
  FSDashboardOrganisationTileUI,
100
133
  FSDashboardOrganisationTypeTileUI,
101
134
  FSDashboardShallowTileUI
102
135
  },
103
136
  props: {
137
+ tableCode: {
138
+ type: String as PropType<string | null>,
139
+ required: false,
140
+ default: null
141
+ },
104
142
  dashboardOrganisationTypeFetchFilter: {
105
143
  type: Object as PropType<DashboardOrganisationTypeFilters>,
106
144
  default: undefined,
@@ -120,17 +158,23 @@ export default defineComponent({
120
158
  type: Function as PropType<(item: DashboardInfos) => Partial<RouteLocation>>,
121
159
  required: false
122
160
  },
123
- tableCode: {
124
- type: String,
125
- required: true
126
- },
127
161
  modelValue: {
128
162
  type: Array as PropType<string[]>,
129
163
  default: () => [],
130
164
  required: false
131
165
  },
166
+ selectable: {
167
+ type: Boolean,
168
+ required: false,
169
+ default: true
170
+ },
171
+ singleSelect: {
172
+ type: Boolean,
173
+ required: false,
174
+ default: false
175
+ },
132
176
  },
133
- emits: ["update:modelValue", "update:type"],
177
+ emits: ["update", "update:modelValue", "update:type"],
134
178
  setup(props, { emit }) {
135
179
  const { entities: dashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, getMany: getManyDashboardOrganisationTypes } = useDashboardOrganisationTypes();
136
180
  const { entities: dashboardOrganisations, fetching: fetchingDashboardOrganisations, getMany: getManyDashboardOrganisations } = useDashboardOrganisations();
@@ -158,6 +202,16 @@ export default defineComponent({
158
202
  ], d => d.label);
159
203
  });
160
204
 
205
+ const headersOptions = computed(() => ({
206
+ dashboardType: {
207
+ fixedFilters: getEnumEntries(DashboardType).filter(e => e.value != DashboardType.None).map(e => ({
208
+ value: e.value,
209
+ text: dashboardTypeLabel(e.value)
210
+ })),
211
+ methodFilter: (value: DashboardType, item: DashboardType) => value == item
212
+ }
213
+ }));
214
+
161
215
  const mainUserDashboardId = computed(() => {
162
216
  return userOrganisation.value?.mainDashboardId;
163
217
  });
@@ -169,8 +223,11 @@ export default defineComponent({
169
223
  const onSelect = (values: string[]) => {
170
224
  selecteds.value = values;
171
225
  const selectedItems = items.value.filter(i => selecteds.value!.includes(i.id));
172
- emit("update:modelValue", selectedItems.map(i => i.id));
173
- emit("update:type", selectedItems.map(i => i.dashboardType));
226
+ const newModelValue = selectedItems.map(i => i.id);
227
+ const newType = selectedItems.map(i => i.dashboardType);
228
+ emit("update:modelValue", newModelValue);
229
+ emit("update:type", newType);
230
+ emit("update", { modelValue: newModelValue, type: newType });
174
231
  };
175
232
 
176
233
  const isSelected = (id: string) => {
@@ -209,13 +266,16 @@ export default defineComponent({
209
266
  fetchingDashboardOrganisationTypes,
210
267
  fetchingDashboardOrganisations,
211
268
  fetchingDashboardShallows,
269
+ headersOptions,
212
270
  selecteds,
271
+ ColorEnum,
213
272
  items,
214
273
  mainUserDashboardId,
215
274
  mainOrganisationDashboardId,
216
275
  onSelect,
217
276
  isSelected,
218
- DashboardType
277
+ DashboardType,
278
+ dashboardTypeLabel
219
279
  };
220
280
  }
221
281
  });
@@ -8,10 +8,13 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import { defineComponent, type PropType, watch, computed } from "vue";
11
+ import _ from "lodash";
11
12
 
12
- import type { DashboardOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
13
- import { useDashboardOrganisations } from "@dative-gpi/foundation-core-services/composables";
14
- import { useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
13
+ import type { DashboardOrganisationFilters, DashboardOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
14
+ import { useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
15
+
16
+ import { DashboardType } from '@dative-gpi/foundation-shared-domain/enums';
17
+ import type { DashboardsListItem } from '@dative-gpi/foundation-core-components/utils';
15
18
 
16
19
  import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
17
20
 
@@ -27,7 +30,12 @@ export default defineComponent({
27
30
  default: () => ({})
28
31
  },
29
32
  dashboardOrganisationTypeFilters: {
30
- type: Object as PropType<DashboardOrganisationFilters>,
33
+ type: Object as PropType<DashboardOrganisationTypeFilters>,
34
+ required: false,
35
+ default: () => ({})
36
+ },
37
+ dashboardShallowFilters: {
38
+ type: Object as PropType<DashboardShallowFilters>,
31
39
  required: false,
32
40
  default: () => ({})
33
41
  }
@@ -39,17 +47,35 @@ export default defineComponent({
39
47
  const { entities: dashboardOrganisationTypes,
40
48
  getMany: getManyDashboardOrganisationTypes,
41
49
  fetching: fetchingDashboardOrganisationTypes } = useDashboardOrganisationTypes();
50
+ const { entities: dashboardShallows,
51
+ getMany: getManyDashboardShallows,
52
+ fetching: fetchingDashboardShallows } = useDashboardShallows();
42
53
 
43
54
  const fetching = computed(() => fetchingDashboardOrganisations.value
44
- || fetchingDashboardOrganisationTypes.value);
55
+ || fetchingDashboardOrganisationTypes.value
56
+ || fetchingDashboardShallows.value);
45
57
 
46
- const dashboards = computed(() => {
47
- return [...dashboardOrganisations.value, ...dashboardOrganisationTypes.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);
48
73
  });
49
74
 
50
75
  const fetch = () => {
51
76
  getManyDashboardOrganisations(props.dashboardOrganisationFilters);
52
77
  getManyDashboardOrganisationTypes(props.dashboardOrganisationTypeFilters);
78
+ getManyDashboardShallows(props.dashboardShallowFilters);
53
79
  }
54
80
 
55
81
  watch(() => [props.dashboardOrganisationFilters, props.dashboardOrganisationTypeFilters], fetch, { immediate: true });
@@ -19,8 +19,8 @@
19
19
  maskHeight="0px"
20
20
  >
21
21
  <FSDataTable
22
+ defaultMode="iterator"
22
23
  :loading="fetchingDataCategories"
23
- :disableIterator="true"
24
24
  :items="dataCategories"
25
25
  :modelValue="$props.modelValue"
26
26
  :showSearch="false"
@@ -39,9 +39,10 @@
39
39
  />
40
40
  </template>
41
41
  <template
42
- #item.tile="{ item }"
42
+ #item.tile="{ index, item }"
43
43
  >
44
44
  <FSClickable
45
+ :key="index"
45
46
  padding="12px"
46
47
  height="60px"
47
48
  width="233px"
@@ -109,6 +110,11 @@ export default defineComponent({
109
110
  FSIcon
110
111
  },
111
112
  props: {
113
+ tableCode: {
114
+ type: String as PropType<string | null>,
115
+ required: false,
116
+ default: null
117
+ },
112
118
  dataCategoryFilters: {
113
119
  type: Object as PropType<DataCategoryFilters>,
114
120
  required: false,
@@ -118,10 +124,6 @@ export default defineComponent({
118
124
  type: Array as PropType<string[]>,
119
125
  default: () => [],
120
126
  required: false
121
- },
122
- tableCode: {
123
- type: String,
124
- required: true
125
127
  }
126
128
  },
127
129
  emits: ["update: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"
@@ -25,9 +26,10 @@
25
26
  />
26
27
  </template>
27
28
  <template
28
- #item.tile="{ item }"
29
+ #item.tile="{ index, item }"
29
30
  >
30
31
  <FSClickable
32
+ :key="index"
31
33
  padding="12px"
32
34
  height="60px"
33
35
  width="233px"
@@ -88,6 +90,11 @@ export default defineComponent({
88
90
  FSRow,
89
91
  },
90
92
  props: {
93
+ tableCode: {
94
+ type: String as PropType<string | null>,
95
+ required: false,
96
+ default: null
97
+ },
91
98
  dataDefinitionFilters: {
92
99
  type: Object as PropType<DataDefinitionFilters>,
93
100
  required: false,
@@ -97,10 +104,6 @@ export default defineComponent({
97
104
  type: Array as PropType<string[]>,
98
105
  default: () => [],
99
106
  required: false
100
- },
101
- tableCode: {
102
- type: String,
103
- required: true
104
107
  }
105
108
  },
106
109
  emits: ["update:modelValue"],