@dative-gpi/foundation-core-components 1.0.69 → 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
@@ -1,9 +1,10 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :loading="fetchingDeviceOrganisations"
4
5
  :singleSelect="$props.singleSelect"
5
6
  :headersOptions="headersOptions"
6
- :showSelect="$props.editable"
7
+ :selectable="$props.selectable"
7
8
  :tableCode="$props.tableCode"
8
9
  :items="deviceOrganisations"
9
10
  :itemTo="$props.itemTo"
@@ -27,13 +28,6 @@
27
28
  mdi-panorama-variant-outline
28
29
  </FSIcon>
29
30
  </template>
30
- <template
31
- #header.connectable-title
32
- >
33
- <FSIcon>
34
- mdi-wifi
35
- </FSIcon>
36
- </template>
37
31
  <template
38
32
  #header.connectivity-title
39
33
  >
@@ -49,18 +43,9 @@
49
43
  height="32px"
50
44
  width="32px"
51
45
  :imageId="item.imageId"
46
+ :thumbnail="true"
52
47
  />
53
48
  </template>
54
- <template
55
- #item.connectable="{ item }"
56
- >
57
- <FSCol>
58
- <FSConnectivity
59
- v-if="item.connectivity.status != ConnectivityStatus.None"
60
- :deviceConnectivity="item.connectivity"
61
- />
62
- </FSCol>
63
- </template>
64
49
  <template
65
50
  #item.connectivity="{ item }"
66
51
  >
@@ -83,7 +68,7 @@
83
68
  >
84
69
  <FSTagGroup
85
70
  variant="slide"
86
- :editable="false"
71
+ :showRemove="false"
87
72
  :tags="item.tags"
88
73
  />
89
74
  </template>
@@ -153,10 +138,12 @@
153
138
  />
154
139
  </template>
155
140
  <template
156
- #item.tile="{ item, toggleSelect }"
141
+ #item.tile="{ index, item, toggleSelect }"
157
142
  >
158
143
  <FSDeviceOrganisationTileUI
144
+ :key="index"
159
145
  :to="$props.itemTo && $props.itemTo(item)"
146
+ :selectable="$props.selectable"
160
147
  :deviceConnectivity="item.connectivity"
161
148
  :deviceStatuses="item.status.statuses"
162
149
  :deviceWorstAlert="item.worstAlert"
@@ -175,11 +162,14 @@
175
162
  import { computed, defineComponent, onMounted, type PropType, watch } from "vue";
176
163
  import { type RouteLocation } from "vue-router";
177
164
  import _ from "lodash";
165
+
166
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
178
167
 
168
+ import { ConnectivityStatus, Criticity, PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
179
169
  import { alphanumericSort, connectivityLabel } from "@dative-gpi/foundation-shared-components/utils";
180
- import { ConnectivityStatus, PropertyEntity } from "@dative-gpi/foundation-shared-domain/enums";
170
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
181
171
 
182
- import type { DeviceConnectivityDetails, DeviceOrganisationAlert, DeviceOrganisationFilters, DeviceOrganisationInfos} from "@dative-gpi/foundation-core-domain/models";
172
+ import type { DeviceConnectivityDetails, DeviceOrganisationAlert, DeviceOrganisationFilters, DeviceOrganisationInfos, DeviceStatusDetails} from "@dative-gpi/foundation-core-domain/models";
183
173
  import { useCustomProperties, useDeviceOrganisations } from "@dative-gpi/foundation-core-services/composables";
184
174
 
185
175
  import FSMetaValue from "../../customProperties/FSMetaValue.vue";
@@ -208,8 +198,9 @@ export default defineComponent({
208
198
  },
209
199
  props: {
210
200
  tableCode: {
211
- type: String,
212
- required: true
201
+ type: String as PropType<string | null>,
202
+ required: false,
203
+ default: null
213
204
  },
214
205
  deviceOrganisationFilters: {
215
206
  type: Object as PropType<DeviceOrganisationFilters>,
@@ -230,7 +221,7 @@ export default defineComponent({
230
221
  required: false,
231
222
  default: null
232
223
  },
233
- editable: {
224
+ selectable: {
234
225
  type: Boolean,
235
226
  required: false,
236
227
  default: true
@@ -250,6 +241,7 @@ export default defineComponent({
250
241
  setup(props) {
251
242
  const { fetching: fecthingCustomProperties, entities: customProperties, getMany: getManyCustomProperties } = useCustomProperties();
252
243
  const { entities, fetching: fetchingDeviceOrganisations, getMany: getManyDeviceOrganisations } = useDeviceOrganisations();
244
+ const { $tr } = useTranslationsProvider();
253
245
 
254
246
  const deviceOrganisations = computed((): DeviceOrganisationInfos[] => {
255
247
  if (props.connectedOnly) {
@@ -259,25 +251,18 @@ export default defineComponent({
259
251
  });
260
252
 
261
253
  const headersOptions = computed(() => ({
262
- connectable: {
254
+ status: {
263
255
  fixedFilters: [{
264
- value: ConnectivityStatus.None,
265
- text: ""
266
- }, {
267
- value: ConnectivityStatus.Offline,
268
- text: connectivityLabel(ConnectivityStatus.Offline)
269
- }, {
270
- value: ConnectivityStatus.AlmostOffline,
271
- text: connectivityLabel(ConnectivityStatus.AlmostOffline)
256
+ value: true,
257
+ text: $tr("ui.device-organisation.has-statuses", "Has statuses")
272
258
  }, {
273
- value: ConnectivityStatus.PartiallyConnected,
274
- text: connectivityLabel(ConnectivityStatus.PartiallyConnected)
275
- }, {
276
- value: ConnectivityStatus.Connected,
277
- text: connectivityLabel(ConnectivityStatus.Connected)
259
+ value: false,
260
+ text: $tr("ui.device-organisation.has-no-statuses", "Has no statuses")
278
261
  }],
279
- methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => !item.status && !value || item.status == value,
280
- sort: (a: DeviceConnectivityDetails, b: DeviceConnectivityDetails) => alphanumericSort(a?.status, b?.status)
262
+ methodFilter: (value: boolean, item: DeviceStatusDetails) => {
263
+ return value ? item.statuses.length > 0 : item.statuses.length === 0;
264
+ },
265
+ sort: (a: DeviceStatusDetails, b: DeviceStatusDetails) => a.statuses.length - b.statuses.length
281
266
  },
282
267
  connectivity: {
283
268
  fixedFilters: [{
@@ -296,10 +281,51 @@ export default defineComponent({
296
281
  value: ConnectivityStatus.Connected,
297
282
  text: connectivityLabel(ConnectivityStatus.Connected)
298
283
  }],
299
- methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => !item.status && !value || item.status == value,
284
+ methodFilter: (value: ConnectivityStatus, item: DeviceConnectivityDetails) => {
285
+ switch(value) {
286
+ case ConnectivityStatus.None:
287
+ return !item.status;
288
+ default:
289
+ return item.status == value;
290
+ }
291
+ },
300
292
  sort: (a: DeviceConnectivityDetails, b: DeviceConnectivityDetails) => alphanumericSort(a?.status, b?.status)
301
293
  },
294
+ alerts: {
295
+ fixedFilters: [{
296
+ value: true,
297
+ text: $tr("ui.device-organisation.has-alerts", "Has alerts")
298
+ }, {
299
+ value: false,
300
+ text: $tr("ui.device-organisation.has-no-alerts", "Has no alerts")
301
+ }],
302
+ methodFilter: (value: boolean, item: DeviceOrganisationAlert[]) => {
303
+ return value ? item.length > 0 : item.length === 0;
304
+ },
305
+ sort: (a: DeviceOrganisationAlert[], b: DeviceOrganisationAlert[]) => a.length - b.length
306
+ },
302
307
  worstAlert: {
308
+ fixedFilters: [{
309
+ value: Criticity.None,
310
+ text: "—"
311
+ }, {
312
+ value: Criticity.Information,
313
+ text: AlertTools.criticityLabel(Criticity.Information)
314
+ }, {
315
+ value: Criticity.Warning,
316
+ text: AlertTools.criticityLabel(Criticity.Warning)
317
+ }, {
318
+ value: Criticity.Error,
319
+ text: AlertTools.criticityLabel(Criticity.Error)
320
+ }],
321
+ methodFilter: (value: Criticity, item: DeviceOrganisationAlert | null) => {
322
+ switch(value) {
323
+ case Criticity.None:
324
+ return !item;
325
+ default:
326
+ return item != null && item.criticity === value;
327
+ }
328
+ },
303
329
  sort: (a: DeviceOrganisationAlert, b: DeviceOrganisationAlert) => alphanumericSort(a?.criticity, b?.criticity)
304
330
  },
305
331
  ...customProperties.value.reduce((acc, cp) => ({
@@ -314,9 +340,9 @@ export default defineComponent({
314
340
  }))): undefined,
315
341
  methodFilterRaw: (value: any, item: DeviceOrganisationInfos) => {
316
342
  if (cp.useOnlyAllowedValues) {
317
- return (!Object.keys(cp.allowedValues).includes(item.meta[cp.code])) && !value || item.meta[cp.code] === value;
343
+ return (!Object.keys(cp.allowedValues).includes(item.meta[cp.code])) && !value || item.meta[cp.code] == value
318
344
  }
319
- return !item.meta[cp.code] && !value || item.meta[cp.code] === value;
345
+ return item.meta[cp.code] == value
320
346
  },
321
347
  sort: (a: string, b: string) => alphanumericSort(a, b)
322
348
  }
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :items="folders"
4
- :item-to="$props.itemTo"
5
+ :itemTo="$props.itemTo"
5
6
  :loading="fetchingFolders"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
@@ -25,11 +26,21 @@
25
26
  {{ item.icon }}
26
27
  </FSIcon>
27
28
  </template>
29
+ <template
30
+ #item.tags="{ item }"
31
+ >
32
+ <FSTagGroup
33
+ variant="slide"
34
+ :showRemove="false"
35
+ :tags="item.tags"
36
+ />
37
+ </template>
28
38
 
29
39
  <template
30
- #item.tile="{ item, toggleSelect }"
40
+ #item.tile="{ index, item, toggleSelect }"
31
41
  >
32
42
  <FSFolderTileUI
43
+ :key="index"
33
44
  :bottomColor="item.colors"
34
45
  v-bind="item"
35
46
  :modelValue="isSelected(item.id)"
@@ -42,9 +53,8 @@
42
53
 
43
54
  <script lang="ts">
44
55
  import _ from "lodash";
45
- import type { PropType} from "vue";
46
56
  import type { RouteLocation } from "vue-router";
47
- import { defineComponent, watch } from "vue";
57
+ import { defineComponent, type PropType, watch } from "vue";
48
58
 
49
59
  import { useFolders } from "@dative-gpi/foundation-core-services/composables";
50
60
 
@@ -53,6 +63,7 @@ import { FoldersListType } from "@dative-gpi/foundation-core-components/utils";
53
63
  import type { FolderFilters, DashboardInfos } from "@dative-gpi/foundation-core-domain/models";
54
64
 
55
65
  import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
66
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
56
67
  import FSFolderTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSFolderTileUI.vue";
57
68
 
58
69
  import FSDataTable from "../FSDataTable.vue";
@@ -60,33 +71,34 @@ import FSDataTable from "../FSDataTable.vue";
60
71
  export default defineComponent({
61
72
  name: "FSBaseFoldersList",
62
73
  components: {
74
+ FSFolderTileUI,
63
75
  FSDataTable,
64
- FSIcon,
65
- FSFolderTileUI
76
+ FSTagGroup,
77
+ FSIcon
66
78
  },
67
79
  props: {
80
+ tableCode: {
81
+ type: String as PropType<string | null>,
82
+ required: false,
83
+ default: null
84
+ },
68
85
  foldersFilters: {
69
86
  type: Object as PropType<FolderFilters>,
70
87
  default: undefined,
71
88
  required: false
72
89
  },
73
- modelValue: {
74
- type: Array as PropType<string[]>,
75
- required: false,
76
- default: () => []
77
- },
78
90
  itemTo: {
79
91
  type: Function as PropType<(item: DashboardInfos) => Partial<RouteLocation>>,
80
92
  required: false
81
93
  },
82
- tableCode: {
83
- type: String,
84
- required: true
94
+ modelValue: {
95
+ type: Array as PropType<string[]>,
96
+ required: false,
97
+ default: () => []
85
98
  }
86
99
  },
87
100
  emits: ["update:modelValue"],
88
101
  setup(props, { emit }) {
89
-
90
102
  const { entities: folders, fetching: fetchingFolders, getMany: getManyFolders } = useFolders();
91
103
 
92
104
  const onSelect = (values: string[]) => {
@@ -0,0 +1,125 @@
1
+ <template>
2
+ <FSDataTable
3
+ defaultMode="iterator"
4
+ :loading="fetchingGroupings"
5
+ :items="groupings"
6
+ :itemTo="$props.itemTo"
7
+ :selectable="$props.selectable"
8
+ :showSearch="$props.showSearch"
9
+ :singleSelect="$props.singleSelect"
10
+ :disableTable="$props.disableTable"
11
+ :modelValue="$props.modelValue"
12
+ @update:modelValue="$emit('update:modelValue', $event)"
13
+ v-bind="$attrs"
14
+ >
15
+ <template
16
+ v-for="(_, name) in $slots"
17
+ v-slot:[name]="slotData"
18
+ >
19
+ <slot
20
+ :name="name"
21
+ v-bind="slotData"
22
+ />
23
+ </template>
24
+ <template
25
+ #item.icon="{ item }"
26
+ >
27
+ <FSIcon>
28
+ {{ item.icon }}
29
+ </FSIcon>
30
+ </template>
31
+ <template
32
+ #item.tile="{ item, toggleSelect }"
33
+ >
34
+ <FSGroupingTileUI
35
+ :selectable="$props.selectable"
36
+ :modelValue="isSelected(item.id)"
37
+ :singleSelect="$props.singleSelect"
38
+ :to="$props.itemTo && $props.itemTo(item)"
39
+ @update:modelValue="toggleSelect(item)"
40
+ v-bind="item"
41
+ />
42
+ </template>
43
+ </FSDataTable>
44
+ </template>
45
+
46
+ <script lang="ts">
47
+ import { defineComponent, watch } from "vue";
48
+ import { type RouteLocation } from "vue-router";
49
+ import type { PropType} from "vue";
50
+ import _ from "lodash";
51
+
52
+ import type { GroupingFilters, GroupingInfos } from "@dative-gpi/foundation-core-domain/models";
53
+ import { useGroupings } from "@dative-gpi/foundation-core-services/composables";
54
+
55
+ import FSDataTable from "../FSDataTable.vue";
56
+
57
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
58
+ import FSGroupingTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSGroupingTileUI.vue";
59
+
60
+
61
+ export default defineComponent({
62
+ name: "FSBaseGroupingsList",
63
+ components: {
64
+ FSDataTable,
65
+ FSIcon,
66
+ FSGroupingTileUI
67
+ },
68
+ props: {
69
+ itemTo: {
70
+ type: Function as PropType<(item: GroupingInfos) => Partial<RouteLocation>>,
71
+ required: false
72
+ },
73
+ groupingsFilters: {
74
+ type: Object as PropType<GroupingFilters>,
75
+ required: false,
76
+ default: null
77
+ },
78
+ selectable: {
79
+ type: Boolean,
80
+ required: false,
81
+ default: false
82
+ },
83
+ singleSelect: {
84
+ type: Boolean,
85
+ required: false,
86
+ default: false
87
+ },
88
+ modelValue: {
89
+ type: Array as PropType<string[]>,
90
+ required: false,
91
+ default: () => []
92
+ },
93
+ showSearch: {
94
+ type: Boolean,
95
+ required: false,
96
+ default: false
97
+ },
98
+ disableTable: {
99
+ type: Boolean,
100
+ required: false,
101
+ default: true
102
+ }
103
+ },
104
+ emits: ["update:modelValue"],
105
+ setup(props) {
106
+ const { getMany: fetchGroupings, fetching: fetchingGroupings, entities: groupings } = useGroupings();
107
+
108
+ const isSelected = (id: string) => {
109
+ return props.modelValue.includes(id);
110
+ };
111
+
112
+ watch(() => props.groupingsFilters, (next, previous) => {
113
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
114
+ fetchGroupings(props.groupingsFilters);
115
+ }
116
+ }, { immediate: true });
117
+
118
+ return {
119
+ fetchingGroupings,
120
+ groupings,
121
+ isSelected
122
+ };
123
+ }
124
+ });
125
+ </script>
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :loading="fetchingGroups"
4
5
  :items="groups"
5
- :showSelect="$props.editable"
6
+ :selectable="$props.selectable"
6
7
  :tableCode="$props.tableCode"
7
8
  :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -29,9 +30,10 @@
29
30
  >
30
31
  <FSImage
31
32
  v-if="item.imageId"
32
- height="38px"
33
- width="38px"
33
+ height="32px"
34
+ width="32px"
34
35
  :imageId="item.imageId"
36
+ :thumbnail="true"
35
37
  />
36
38
  </template>
37
39
  <template
@@ -46,15 +48,16 @@
46
48
  >
47
49
  <FSTagGroup
48
50
  variant="slide"
49
- :editable="false"
51
+ :showRemove="false"
50
52
  :tags="item.tags"
51
53
  />
52
54
  </template>
53
55
  <template
54
- #item.tile="{ item, toggleSelect }"
56
+ #item.tile="{ index, item, toggleSelect }"
55
57
  >
56
58
  <FSGroupTileUI
57
- :editable="$props.editable"
59
+ :key="index"
60
+ :selectable="$props.selectable"
58
61
  :modelValue="isSelected(item.id)"
59
62
  @update:modelValue="toggleSelect(item)"
60
63
  v-bind="item"
@@ -90,15 +93,16 @@ export default defineComponent({
90
93
  },
91
94
  props: {
92
95
  tableCode: {
93
- type: String,
94
- required: true
96
+ type: String as PropType<string | null>,
97
+ required: false,
98
+ default: null
95
99
  },
96
100
  groupsFilters: {
97
101
  type: Object as PropType<GroupFilters>,
98
102
  required: false,
99
103
  default: null
100
104
  },
101
- editable: {
105
+ selectable: {
102
106
  type: Boolean,
103
107
  required: false,
104
108
  default: true
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :loading="fetchingLocations"
4
5
  :items="locations"
5
- :showSelect="$props.editable"
6
+ :selectable="$props.selectable"
6
7
  :tableCode="tableCode"
7
8
  :modelValue="$props.modelValue"
8
9
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -26,16 +27,18 @@
26
27
  </template>
27
28
 
28
29
  <template
29
- #item.tile="{ item, toggleSelect }"
30
+ #item.tile="{ index, item, toggleSelect }"
30
31
  >
31
32
  <FSLocationTileUI
32
- v-bind="item"
33
+ :key="index"
33
34
  :bottomColor="item.colors"
34
- :editable="true"
35
+ :address="item.address.placeLabel"
36
+ :selectable="$props.selectable"
35
37
  :singleSelect="singleSelect"
36
38
  :modelValue="isSelected(item.id)"
37
39
  :to="$props.itemTo && $props.itemTo(item)"
38
40
  @update:modelValue="toggleSelect(item)"
41
+ v-bind="item"
39
42
  />
40
43
  </template>
41
44
  </FSDataTable>
@@ -62,21 +65,21 @@ export default defineComponent({
62
65
  FSIcon
63
66
  },
64
67
  props: {
68
+ tableCode: {
69
+ type: String as PropType<string | null>,
70
+ required: false,
71
+ default: null
72
+ },
65
73
  locationsFilters: {
66
74
  type: Object as PropType<LocationFilters>,
67
75
  required: false,
68
76
  default: null
69
77
  },
70
- editable: {
78
+ selectable: {
71
79
  type: Boolean,
72
80
  required: false,
73
81
  default: true
74
82
  },
75
- modelValue: {
76
- type: Array as PropType<string[]>,
77
- default: () => [],
78
- required: false
79
- },
80
83
  itemTo: {
81
84
  type: Function as PropType<(item: LocationInfos) => Partial<RouteLocation>>,
82
85
  required: false
@@ -86,9 +89,10 @@ export default defineComponent({
86
89
  required: false,
87
90
  default: false
88
91
  },
89
- tableCode: {
90
- type: String,
91
- required: true
92
+ modelValue: {
93
+ type: Array as PropType<string[]>,
94
+ default: () => [],
95
+ required: false
92
96
  }
93
97
  },
94
98
  emits: ["update:modelValue"],
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <FSDataTable
3
+ defaultMode="iterator"
3
4
  :singleSelect="$props.singleSelect"
4
- :showSelect="$props.editable"
5
+ :selectable="$props.selectable"
5
6
  :tableCode="$props.tableCode"
6
7
  :loading="fetchingModels"
7
8
  :items="models"
@@ -40,6 +41,7 @@
40
41
  height="32px"
41
42
  width="32px"
42
43
  :imageId="item.imageId"
44
+ :thumbnail="true"
43
45
  />
44
46
  </template>
45
47
  <template
@@ -57,10 +59,12 @@
57
59
  />
58
60
  </template>
59
61
  <template
60
- #item.tile="{ item, toggleSelect }"
62
+ #item.tile="{ index, item, toggleSelect }"
61
63
  >
62
64
  <FSModelTileUI
65
+ :key="index"
63
66
  :to="$props.itemTo && $props.itemTo(item)"
67
+ :selectable="$props.selectable"
64
68
  :singleSelect="$props.singleSelect"
65
69
  :imageId="item.imageId"
66
70
  :label="item.label"
@@ -99,8 +103,9 @@ export default defineComponent({
99
103
  },
100
104
  props: {
101
105
  tableCode: {
102
- type: String,
103
- required: true
106
+ type: String as PropType<string | null>,
107
+ required: false,
108
+ default: null
104
109
  },
105
110
  modelsFilters: {
106
111
  type: Object as PropType<ModelFilters>,
@@ -111,7 +116,7 @@ export default defineComponent({
111
116
  type: Function as PropType<(item: ModelInfos) => Partial<RouteLocation>>,
112
117
  required: false
113
118
  },
114
- editable: {
119
+ selectable: {
115
120
  type: Boolean,
116
121
  required: false,
117
122
  default: true
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <FSSimpleList
3
+ :items="playlists"
4
+ :loading="fetching"
5
+ v-bind="$attrs"
6
+ />
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent, type PropType, watch } from "vue";
11
+
12
+ import type { PlaylistFilters } from "@dative-gpi/foundation-core-domain/models";
13
+ import { usePlaylists } from "@dative-gpi/foundation-core-services/composables";
14
+
15
+ import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
16
+
17
+ export default defineComponent({
18
+ name: "FSSimplePlaylistsList",
19
+ components: {
20
+ FSSimpleList,
21
+ },
22
+ props: {
23
+ playlistFilters: {
24
+ type: Object as PropType<PlaylistFilters>,
25
+ required: false,
26
+ default: () => ({})
27
+ }
28
+ },
29
+ setup(props) {
30
+ const { entities: playlists, getMany, fetching } = usePlaylists();
31
+
32
+ const fetch = () => {
33
+ getMany(props.playlistFilters);
34
+ }
35
+
36
+ watch(() => props.playlistFilters, fetch, { immediate: true });
37
+
38
+ return {
39
+ playlists,
40
+ fetching
41
+ }
42
+ }
43
+ });
44
+ </script>