@dative-gpi/foundation-core-components 1.0.56 → 1.0.58-groupings

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 (82) 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/FSAutocompleteLocation.vue +6 -0
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
  9. package/components/autocompletes/FSAutocompleteModel.vue +9 -1
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
  11. package/components/autocompletes/FSAutocompleteRole.vue +14 -6
  12. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
  13. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
  14. package/components/customProperties/FSMetaField.vue +35 -40
  15. package/components/customProperties/FSMetaFormContent.vue +4 -3
  16. package/components/customProperties/FSMetaHistory.vue +2 -2
  17. package/components/customProperties/FSMetaValue.vue +63 -31
  18. package/components/customProperties/helpers.ts +57 -165
  19. package/components/entities/FSBaseEntitiesList.vue +14 -4
  20. package/components/entities/FSDialogSelectEntities.vue +28 -106
  21. package/components/entities/FSEntityField.vue +75 -14
  22. package/components/entities/FSSelectEntitiesList.vue +225 -0
  23. package/components/explorers/FSBaseDevicesExplorer.vue +312 -0
  24. package/components/explorers/FSBaseFoldersExplorer.vue +286 -0
  25. package/components/lists/FSDataTable.vue +23 -21
  26. package/components/lists/alerts/FSBaseAlertsList.vue +95 -97
  27. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
  28. package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
  29. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +103 -38
  30. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +104 -39
  31. package/components/lists/charts/FSBaseChartsList.vue +147 -66
  32. package/components/lists/comments/FSBaseCommentsList.vue +39 -23
  33. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  34. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +39 -7
  35. package/components/lists/dashboards/FSBaseDashboardsList.vue +44 -13
  36. package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
  37. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +6 -5
  38. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +6 -4
  39. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +179 -61
  40. package/components/lists/folders/FSBaseFoldersList.vue +37 -146
  41. package/components/lists/groupings/FSBaseGroupingsList.vue +117 -0
  42. package/components/lists/groups/FSBaseGroupsList.vue +24 -7
  43. package/components/lists/locations/FSBaseLocationsList.vue +52 -13
  44. package/components/lists/models/FSBaseModelsList.vue +45 -15
  45. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +17 -10
  46. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +28 -21
  47. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +56 -13
  48. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +56 -12
  49. package/components/lists/scenarios/FSBaseScenariosList.vue +122 -81
  50. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +31 -18
  51. package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
  52. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +30 -19
  53. package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
  54. package/components/tiles/FSChartTile.vue +71 -0
  55. package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
  56. package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
  57. package/components/tiles/FSDashboardShallowTile.vue +3 -3
  58. package/components/tiles/FSDeviceOrganisationTile.vue +12 -5
  59. package/components/tiles/FSFolderTile.vue +3 -3
  60. package/components/tiles/FSGroupTile.vue +3 -3
  61. package/components/tiles/FSLocationTile.vue +5 -3
  62. package/components/tiles/FSModelTile.vue +64 -0
  63. package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
  64. package/components/tiles/FSUserOrganisationTile.vue +3 -3
  65. package/components/treeviews/FSTreeViewFolder.vue +15 -3
  66. package/components/treeviews/FSTreeViewGroup.vue +22 -4
  67. package/package.json +9 -9
  68. package/utils/dashboards.ts +3 -3
  69. package/utils/index.ts +0 -1
  70. package/utils/roles.ts +3 -3
  71. package/utils/users.ts +3 -3
  72. package/components/selects/FSAggregationSelector.vue +0 -51
  73. package/components/selects/FSAxisTypeSelector.vue +0 -48
  74. package/components/selects/FSDisplayAsSelector.vue +0 -52
  75. package/components/selects/FSFilterTypeSelector.vue +0 -53
  76. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  77. package/components/selects/FSOperationOnSelector.vue +0 -51
  78. package/components/selects/FSPlanningTypeSelector.vue +0 -51
  79. package/components/selects/FSPlotPerSelector.vue +0 -51
  80. package/components/selects/FSSelectEntityType.vue +0 -59
  81. package/components/selects/FSSerieTypeSelector.vue +0 -51
  82. 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
  >
@@ -52,11 +56,22 @@
52
56
  :label="$tr('ui.common.all', 'All')"
53
57
  />
54
58
  </template>
59
+ <template
60
+ #item.tags="{ item }"
61
+ >
62
+ <FSTagGroup
63
+ variant="slide"
64
+ :showRemove="false"
65
+ :tags="item.tags"
66
+ />
67
+ </template>
55
68
  <template
56
69
  #item.tile="{ item, toggleSelect }"
57
70
  >
58
71
  <FSDashboardOrganisationTypeTileUI
59
72
  :bottomColor="item.colors"
73
+ :selectable="$props.selectable"
74
+ :singleSelect="$props.singleSelect"
60
75
  :to="$props.itemTo && $props.itemTo(item)"
61
76
  :modelValue="isSelected(item.id)"
62
77
  @update:modelValue="toggleSelect(item)"
@@ -67,26 +82,28 @@
67
82
  </template>
68
83
 
69
84
  <script lang="ts">
70
- import type { PropType} from "vue";
85
+ import { computed, defineComponent, onMounted, type PropType, watch } from "vue";
71
86
  import type { RouteLocation } from "vue-router";
72
- import { computed, defineComponent, onMounted, watch } from "vue";
73
87
  import _ from "lodash";
74
88
 
75
89
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
76
90
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
77
91
  import { useOrganisation } from "@dative-gpi/foundation-shared-services/composables";
78
92
 
79
- import FSDataTable from "../FSDataTable.vue";
93
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
80
94
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
81
95
  import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
82
96
  import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
83
97
  import FSChip from "@dative-gpi/foundation-shared-components/components/FSChip.vue";
84
98
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
85
99
 
100
+ import FSDataTable from "../FSDataTable.vue";
101
+
86
102
  export default defineComponent({
87
103
  name: "FSBaseDashboardOrganisationTypesList",
88
104
  components: {
89
105
  FSDataTable,
106
+ FSTagGroup,
90
107
  FSIcon,
91
108
  FSRow,
92
109
  FSText,
@@ -94,6 +111,11 @@ export default defineComponent({
94
111
  FSDashboardOrganisationTypeTileUI
95
112
  },
96
113
  props: {
114
+ tableCode: {
115
+ type: String as PropType<string | null>,
116
+ required: false,
117
+ default: null
118
+ },
97
119
  dashboardOrganisationTypeFilters: {
98
120
  type: Object as PropType<DashboardOrganisationTypeFilters>,
99
121
  default: undefined,
@@ -108,13 +130,22 @@ export default defineComponent({
108
130
  required: false,
109
131
  default: () => []
110
132
  },
111
- tableCode: {
112
- type: String,
113
- required: true
133
+ selectable: {
134
+ type: Boolean,
135
+ required: false,
136
+ default: true
114
137
  },
138
+ singleSelect: {
139
+ type: Boolean,
140
+ required: false,
141
+ default: false
142
+ }
115
143
  },
144
+ emits: [
145
+ "update:modelValue"
146
+ ],
116
147
  setup(props) {
117
- const { getMany: getDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
148
+ const { getMany: getDashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
118
149
  const { fetch: fetchUserOrganisation, entity: userOrganisation } = useCurrentUserOrganisation();
119
150
  const { get: fetchOrganisation, entity: organisation } = useOrganisation();
120
151
  const { organisationId } = useAppOrganisationId();
@@ -154,6 +185,7 @@ export default defineComponent({
154
185
  }, { immediate: true });
155
186
 
156
187
  return {
188
+ fetchingDashboardOrganisationTypes,
157
189
  userOrganisationMainDashboardId,
158
190
  organisationMainDashboardId,
159
191
  dashboardOrganisationTypes,
@@ -1,9 +1,12 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="items"
4
5
  :itemTo="$props.itemTo"
5
6
  :loading="fetchingDashboardOrganisationTypes || fetchingDashboardOrganisations || fetchingDashboardShallows"
6
7
  :tableCode="$props.tableCode"
8
+ :selectable="$props.selectable"
9
+ :singleSelect="$props.singleSelect"
7
10
  :modelValue="selecteds"
8
11
  @update:modelValue="onSelect"
9
12
  v-bind="$attrs"
@@ -17,7 +20,6 @@
17
20
  v-bind="slotData"
18
21
  />
19
22
  </template>
20
-
21
23
  <template
22
24
  #item.icon="{ item }"
23
25
  >
@@ -25,7 +27,6 @@
25
27
  {{ item.icon }}
26
28
  </FSIcon>
27
29
  </template>
28
-
29
30
  <template
30
31
  #item.main="{ item }"
31
32
  >
@@ -40,13 +41,23 @@
40
41
  mdi-home
41
42
  </FSIcon>
42
43
  </template>
43
-
44
+ <template
45
+ #item.tags="{ item }"
46
+ >
47
+ <FSTagGroup
48
+ variant="slide"
49
+ :showRemove="false"
50
+ :tags="item.tags"
51
+ />
52
+ </template>
44
53
  <template
45
54
  #item.tile="{ item, toggleSelect }"
46
55
  >
47
56
  <FSDashboardOrganisationTypeTileUI
48
57
  v-if="item.dashboardType == DashboardType.OrganisationType"
49
58
  :bottomColor="item.colors"
59
+ :selectable="$props.selectable"
60
+ :singleSelect="$props.singleSelect"
50
61
  :to="$props.itemTo && $props.itemTo(item)"
51
62
  :modelValue="isSelected(item.id)"
52
63
  @update:modelValue="toggleSelect(item)"
@@ -55,6 +66,8 @@
55
66
  <FSDashboardOrganisationTileUI
56
67
  v-if="item.dashboardType == DashboardType.Organisation"
57
68
  :bottomColor="item.colors"
69
+ :selectable="$props.selectable"
70
+ :singleSelect="$props.singleSelect"
58
71
  :to="$props.itemTo && $props.itemTo(item)"
59
72
  :modelValue="isSelected(item.id)"
60
73
  @update:modelValue="toggleSelect(item)"
@@ -63,6 +76,8 @@
63
76
  <FSDashboardShallowTileUI
64
77
  v-if="item.dashboardType == DashboardType.Shallow"
65
78
  :bottomColor="item.colors"
79
+ :selectable="$props.selectable"
80
+ :singleSelect="$props.singleSelect"
66
81
  :modelValue="isSelected(item.id)"
67
82
  @update:modelValue="toggleSelect(item)"
68
83
  :to="$props.itemTo && $props.itemTo(item)"
@@ -74,9 +89,8 @@
74
89
 
75
90
  <script lang="ts">
76
91
  import _ from "lodash";
77
- import type { PropType} from "vue";
78
92
  import type { RouteLocation } from "vue-router";
79
- import { computed, defineComponent, onMounted, ref, watch } from "vue";
93
+ import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
80
94
 
81
95
  import { useAppOrganisationId, useCurrentUserOrganisation, useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
82
96
  import type { DashboardOrganisationTypeFilters, DashboardOrganisationFilters, DashboardShallowFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
@@ -85,22 +99,30 @@ import { useOrganisation } from "@dative-gpi/foundation-shared-services/composab
85
99
  import type { DashboardsListItem } from "@/core/foundation-core-components/utils";
86
100
  import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
87
101
 
88
- import FSDataTable from "../FSDataTable.vue";
102
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
89
103
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
90
104
  import FSDashboardShallowTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardShallowTileUI.vue";
91
105
  import FSDashboardOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTileUI.vue";
92
106
  import FSDashboardOrganisationTypeTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSDashboardOrganisationTypeTileUI.vue";
93
107
 
108
+ import FSDataTable from "../FSDataTable.vue";
109
+
94
110
  export default defineComponent({
95
111
  name: "FSBaseDashboardsList",
96
112
  components: {
97
113
  FSDataTable,
114
+ FSTagGroup,
98
115
  FSIcon,
99
116
  FSDashboardOrganisationTileUI,
100
117
  FSDashboardOrganisationTypeTileUI,
101
118
  FSDashboardShallowTileUI
102
119
  },
103
120
  props: {
121
+ tableCode: {
122
+ type: String as PropType<string | null>,
123
+ required: false,
124
+ default: null
125
+ },
104
126
  dashboardOrganisationTypeFetchFilter: {
105
127
  type: Object as PropType<DashboardOrganisationTypeFilters>,
106
128
  default: undefined,
@@ -120,17 +142,23 @@ export default defineComponent({
120
142
  type: Function as PropType<(item: DashboardInfos) => Partial<RouteLocation>>,
121
143
  required: false
122
144
  },
123
- tableCode: {
124
- type: String,
125
- required: true
126
- },
127
145
  modelValue: {
128
146
  type: Array as PropType<string[]>,
129
147
  default: () => [],
130
148
  required: false
131
149
  },
150
+ selectable: {
151
+ type: Boolean,
152
+ required: false,
153
+ default: true
154
+ },
155
+ singleSelect: {
156
+ type: Boolean,
157
+ required: false,
158
+ default: false
159
+ },
132
160
  },
133
- emits: ["update:modelValue", "update:type"],
161
+ emits: ["update", "update:modelValue", "update:type"],
134
162
  setup(props, { emit }) {
135
163
  const { entities: dashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, getMany: getManyDashboardOrganisationTypes } = useDashboardOrganisationTypes();
136
164
  const { entities: dashboardOrganisations, fetching: fetchingDashboardOrganisations, getMany: getManyDashboardOrganisations } = useDashboardOrganisations();
@@ -169,8 +197,11 @@ export default defineComponent({
169
197
  const onSelect = (values: string[]) => {
170
198
  selecteds.value = values;
171
199
  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));
200
+ const newModelValue = selectedItems.map(i => i.id);
201
+ const newType = selectedItems.map(i => i.dashboardType);
202
+ emit("update:modelValue", newModelValue);
203
+ emit("update:type", newType);
204
+ emit("update", { modelValue: newModelValue, type: newType });
174
205
  };
175
206
 
176
207
  const isSelected = (id: string) => {
@@ -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"
@@ -109,6 +109,11 @@ export default defineComponent({
109
109
  FSIcon
110
110
  },
111
111
  props: {
112
+ tableCode: {
113
+ type: String as PropType<string | null>,
114
+ required: false,
115
+ default: null
116
+ },
112
117
  dataCategoryFilters: {
113
118
  type: Object as PropType<DataCategoryFilters>,
114
119
  required: false,
@@ -118,10 +123,6 @@ export default defineComponent({
118
123
  type: Array as PropType<string[]>,
119
124
  default: () => [],
120
125
  required: false
121
- },
122
- tableCode: {
123
- type: String,
124
- required: true
125
126
  }
126
127
  },
127
128
  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"
@@ -88,6 +89,11 @@ export default defineComponent({
88
89
  FSRow,
89
90
  },
90
91
  props: {
92
+ tableCode: {
93
+ type: String as PropType<string | null>,
94
+ required: false,
95
+ default: null
96
+ },
91
97
  dataDefinitionFilters: {
92
98
  type: Object as PropType<DataDefinitionFilters>,
93
99
  required: false,
@@ -97,10 +103,6 @@ export default defineComponent({
97
103
  type: Array as PropType<string[]>,
98
104
  default: () => [],
99
105
  required: false
100
- },
101
- tableCode: {
102
- type: String,
103
- required: true
104
106
  }
105
107
  },
106
108
  emits: ["update:modelValue"],