@dative-gpi/foundation-core-components 1.0.36 → 1.0.37-report-v1

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 +18 -8
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +16 -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 +17 -6
  12. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
  13. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
  14. package/components/chips/FSChipGroupUserOrganisation.vue +61 -0
  15. package/components/chips/FSChipGroupUserOrganisationUI.vue +38 -0
  16. package/components/customProperties/FSMetaField.vue +31 -35
  17. package/components/customProperties/FSMetaHistory.vue +4 -4
  18. package/components/customProperties/FSMetaValue.vue +66 -33
  19. package/components/customProperties/helpers.ts +2 -1
  20. package/components/entities/FSBaseEntitiesList.vue +50 -0
  21. package/components/entities/FSDialogSelectEntities.vue +83 -0
  22. package/components/entities/FSEntityField.vue +203 -0
  23. package/components/entities/FSSelectEntitiesList.vue +209 -0
  24. package/components/entities/FSSimpleEntitiesList.vue +100 -0
  25. package/components/explorers/FSBaseDevicesExplorer.vue +310 -0
  26. package/components/explorers/FSBaseFoldersExplorer.vue +277 -0
  27. package/components/lists/FSDataTable.vue +23 -21
  28. package/components/lists/alerts/FSBaseAlertsList.vue +338 -0
  29. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +101 -0
  30. package/components/lists/authTokens/FSBaseAuthTokensList.vue +79 -0
  31. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +205 -0
  32. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +206 -0
  33. package/components/lists/charts/FSBaseChartsList.vue +268 -0
  34. package/components/lists/comments/FSBaseCommentsList.vue +143 -0
  35. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  36. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +179 -0
  37. package/components/lists/dashboards/FSBaseDashboardsList.vue +235 -0
  38. package/components/lists/dashboards/FSSimpleDashboardsList.vue +62 -0
  39. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +155 -0
  40. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +130 -0
  41. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +378 -0
  42. package/components/lists/deviceOrganisations/FSSimpleDeviceOrganisationsList.vue +44 -0
  43. package/components/lists/folders/FSBaseFoldersList.vue +127 -0
  44. package/components/lists/folders/FSSimpleFoldersList.vue +44 -0
  45. package/components/lists/groups/FSBaseGroupsList.vue +136 -0
  46. package/components/lists/groups/FSSimpleGroupsList.vue +44 -0
  47. package/components/lists/locations/FSBaseLocationsList.vue +118 -0
  48. package/components/lists/locations/FSSimpleLocationsList.vue +44 -0
  49. package/components/lists/models/FSBaseModelsList.vue +155 -0
  50. package/components/lists/models/FSSimpleModelsList.vue +44 -0
  51. package/components/lists/reports/FSBaseReportExecutionsList.vue +137 -0
  52. package/components/lists/reports/FSBaseReportsList.vue +140 -0
  53. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +128 -0
  54. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +128 -0
  55. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +157 -0
  56. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +145 -0
  57. package/components/lists/scenarios/FSBaseScenariosList.vue +241 -0
  58. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +155 -0
  59. package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
  60. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +171 -0
  61. package/components/lists/userOrganisations/FSSimpleUserOrganisationsList.vue +45 -0
  62. package/components/tiles/FSChartTile.vue +70 -0
  63. package/components/tiles/FSDeviceOrganisationTile.vue +9 -2
  64. package/components/tiles/FSLocationTile.vue +66 -0
  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 +33 -5
  69. package/utils/index.ts +2 -2
  70. package/utils/permissions.ts +80 -0
  71. package/utils/roles.ts +4 -4
  72. package/utils/tables.ts +41 -0
  73. package/utils/users.ts +7 -4
  74. package/components/selects/FSAggregationSelector.vue +0 -51
  75. package/components/selects/FSAxisTypeSelector.vue +0 -48
  76. package/components/selects/FSDisplayAsSelector.vue +0 -52
  77. package/components/selects/FSFilterTypeSelector.vue +0 -53
  78. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  79. package/components/selects/FSOperationOnSelector.vue +0 -51
  80. package/components/selects/FSPlanningTypeSelector.vue +0 -51
  81. package/components/selects/FSPlotPerSelector.vue +0 -51
  82. package/components/selects/FSSelectSelectedEntities.vue +0 -59
  83. package/components/selects/FSSerieTypeSelector.vue +0 -51
  84. package/utils/charts.ts +0 -136
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <FSDataTable
3
+ :items="scenarioOrganisations"
4
+ :itemTo="$props.itemTo"
5
+ :loading="fetchingScenarioOrganisations"
6
+ :showSelect="$props.editable"
7
+ :tableCode="$props.tableCode"
8
+ :modelValue="$props.modelValue"
9
+ :headersOptions="headersOptions"
10
+ @update:modelValue="$emit('update:modelValue', $event)"
11
+ v-bind="$attrs"
12
+ >
13
+ <template
14
+ v-for="(_, name) in $slots"
15
+ v-slot:[name]="slotData"
16
+ >
17
+ <slot
18
+ :name="name"
19
+ v-bind="slotData"
20
+ />
21
+ </template>
22
+
23
+ <template
24
+ #item.icon="{ item }"
25
+ >
26
+ <FSIcon>
27
+ {{ item.icon }}
28
+ </FSIcon>
29
+ </template>
30
+
31
+ <template
32
+ #item.criticity="{ item }"
33
+ >
34
+ <FSRow
35
+ align="center-left"
36
+ >
37
+ <FSIcon
38
+ :color="AlertTools.criticityColor(item.criticity)"
39
+ >
40
+ {{ AlertTools.criticityIcon(item.criticity) }}
41
+ </FSIcon>
42
+ <FSSpan>
43
+ {{ AlertTools.criticityLabel(item.criticity) }}
44
+ </FSSpan>
45
+ </FSRow>
46
+ </template>
47
+
48
+ <template
49
+ #item.tags="{ item }"
50
+ >
51
+ <FSTagGroup
52
+ variant="slide"
53
+ :editable="false"
54
+ :tags="item.tags"
55
+ />
56
+ </template>
57
+ </FSDataTable>
58
+ </template>
59
+
60
+ <script lang="ts">
61
+ import { computed, defineComponent, type PropType, watch } from "vue";
62
+ import type { RouteLocation } from "vue-router";
63
+ import _ from "lodash";
64
+
65
+ import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
66
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
67
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
68
+
69
+ import type { ScenarioOrganisationFilters, ScenarioOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
70
+ import { useScenarioOrganisations } from "@dative-gpi/foundation-core-services/composables";
71
+
72
+ import FSDataTable from "../FSDataTable.vue";
73
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
74
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
75
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
76
+
77
+ export default defineComponent({
78
+ name: "FSBaseScenarioOrganisationsList",
79
+ components: {
80
+ FSDataTable,
81
+ FSTagGroup,
82
+ FSIcon,
83
+ FSRow
84
+ },
85
+ props: {
86
+ tableCode: {
87
+ type: String as PropType<string | null>,
88
+ required: false,
89
+ default: null
90
+ },
91
+ scenarioOrganisationFilters: {
92
+ type: Object as PropType<ScenarioOrganisationFilters>,
93
+ required: false,
94
+ default: null
95
+ },
96
+ itemTo: {
97
+ type: Function as PropType<(item: ScenarioOrganisationInfos) => Partial<RouteLocation>>,
98
+ required: false
99
+ },
100
+ editable: {
101
+ type: Boolean,
102
+ required: false,
103
+ default: true
104
+ },
105
+ modelValue: {
106
+ type: Array as PropType<string[]>,
107
+ default: () => [],
108
+ required: false
109
+ }
110
+ },
111
+ emits: ["update:modelValue"],
112
+ setup(props) {
113
+ const { entities: scenarioOrganisations, fetching: fetchingScenarioOrganisations, getMany: getManyScenarioOrganisations } = useScenarioOrganisations();
114
+
115
+
116
+ const headersOptions = computed(() => ({
117
+ criticity: {
118
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
119
+ value: e.value,
120
+ text: AlertTools.criticityLabel(e.value)
121
+ })),
122
+ methodFilter: (value: Criticity, item: Criticity) => value == item
123
+ }
124
+ }));
125
+
126
+ const isSelected = (id: string): boolean => {
127
+ return props.modelValue.includes(id);
128
+ };
129
+
130
+ watch(() => props.scenarioOrganisationFilters, (next, previous) => {
131
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
132
+ getManyScenarioOrganisations(props.scenarioOrganisationFilters);
133
+ }
134
+ }, { immediate: true });
135
+
136
+ return {
137
+ fetchingScenarioOrganisations,
138
+ scenarioOrganisations,
139
+ headersOptions,
140
+ AlertTools,
141
+ isSelected
142
+ };
143
+ }
144
+ });
145
+ </script>
@@ -0,0 +1,241 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingScenarioOrganisationTypes || fetchingScenarioOrganisations"
4
+ :headersOptions="headersOptions"
5
+ :extraHeaders="headerAssociation"
6
+ :items="scenarios"
7
+ :itemTo="routerLink"
8
+ :modelValue="$props.modelValue"
9
+ :tableCode="$props.tableCode"
10
+ @update:modelValue="$emit('update:modelValue', $event)"
11
+ v-bind="$attrs"
12
+ >
13
+ <template
14
+ v-for="(_, name) in $slots"
15
+ v-slot:[name]="slotData"
16
+ >
17
+ <slot
18
+ :name="name"
19
+ v-bind="slotData"
20
+ />
21
+ </template>
22
+
23
+ <template
24
+ #item.icon="{ item }"
25
+ >
26
+ <FSIcon>
27
+ {{ item.icon }}
28
+ </FSIcon>
29
+ </template>
30
+
31
+ <template
32
+ #item.criticity="{ item }"
33
+ >
34
+ <FSRow
35
+ align="center-left"
36
+ >
37
+ <FSIcon
38
+ :color="AlertTools.criticityColor(item.criticity)"
39
+ >
40
+ {{ AlertTools.criticityIcon(item.criticity) }}
41
+ </FSIcon>
42
+ <FSSpan>
43
+ {{ AlertTools.criticityLabel(item.criticity) }}
44
+ </FSSpan>
45
+ </FSRow>
46
+ </template>
47
+
48
+ <template
49
+ #item.tags="{ item }"
50
+ >
51
+ <FSTagGroup
52
+ variant="slide"
53
+ :editable="false"
54
+ :tags="item.tags"
55
+ />
56
+ </template>
57
+ </FSDataTable>
58
+ </template>
59
+
60
+ <script lang="ts">
61
+ import { defineComponent, type PropType, watch, computed } from "vue";
62
+ import _ from "lodash";
63
+
64
+ import { useTranslations } from "@dative-gpi/bones-ui";
65
+
66
+ import { Criticity, ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
67
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
68
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
69
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools"
70
+
71
+ import type { ScenarioOrganisationFilters, ScenarioOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
72
+ import { useScenarioOrganisations, useScenarioOrganisationTypes, useRouteOrganisation } from "@dative-gpi/foundation-core-services/composables";
73
+
74
+ import FSDataTable from "../FSDataTable.vue";
75
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
76
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
77
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
78
+
79
+ export default defineComponent({
80
+ name: "FSBaseScenariosList",
81
+ components:{
82
+ FSDataTable,
83
+ FSTagGroup,
84
+ FSIcon,
85
+ FSRow
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
+ scenarioOrganisationFilters: {
99
+ type: Object as PropType<ScenarioOrganisationFilters>,
100
+ required: false,
101
+ default: null
102
+ },
103
+ scenarioOrganisationTypeFilters: {
104
+ type: Object as PropType<ScenarioOrganisationTypeFilters>,
105
+ required: false,
106
+ default: null
107
+ },
108
+ showAssociation: {
109
+ type: Boolean,
110
+ required: false,
111
+ default: true
112
+ },
113
+ scope: {
114
+ type: Number as PropType<ApplicationScope>,
115
+ required: false,
116
+ default: ApplicationScope.None
117
+ }
118
+ },
119
+ emits: ["update:modelValue"],
120
+ setup(props) {
121
+ const { $tr } = useTranslations();
122
+ const { entities: scenarioOrganisations, fetching: fetchingScenarioOrganisations, getMany: getManyScenarioOrganisations } = useScenarioOrganisations();
123
+ const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
124
+
125
+ const { $r } = useRouteOrganisation();
126
+
127
+ const headerAssociation = computed(() => {
128
+ if(props.showAssociation){
129
+ return [{
130
+ columnId: "association",
131
+ text: $tr("ui.common.association", "Association"),
132
+ value: "association",
133
+ sortable: false,
134
+ filterable: false,
135
+ index: -1,
136
+ hidden: false
137
+ }];
138
+ }
139
+ });
140
+
141
+ const headersOptions = computed(() => ({
142
+ criticity: {
143
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
144
+ value: e.value,
145
+ text: AlertTools.criticityLabel(e.value)
146
+ })),
147
+ methodFilter: (value: Criticity, item: Criticity) => value == item
148
+ }
149
+ }));
150
+
151
+ const scenarios = computed(() => {
152
+ if(props.scope == ApplicationScope.Organisation){
153
+ return scenarioOrganisations.value
154
+ }
155
+ else if(props.scope == ApplicationScope.OrganisationType){
156
+ return scenarioOrganisationTypes.value
157
+ }
158
+ else{
159
+ return scenarioOrganisations.value.map(c => {
160
+ return {
161
+ id: c.id,
162
+ modelId: c.modelId,
163
+ dataCategoryId : c.dataCategoryId,
164
+ dataCategoryLabel: c.dataCategoryLabel,
165
+ scenarioId: c.scenarioId,
166
+ scope: c.scope,
167
+ label: c.label,
168
+ modelLabel: c.modelLabel,
169
+ code: c.code,
170
+ icon: c.icon,
171
+ tags: c.tags,
172
+ criticity: c.criticity,
173
+ parameters: c.parameters
174
+ }
175
+ })
176
+ .concat(scenarioOrganisationTypes.value.map(c => {
177
+ return {
178
+ id: c.id,
179
+ modelId: c.modelId,
180
+ dataCategoryId : c.dataCategoryId,
181
+ dataCategoryLabel: c.dataCategoryLabel,
182
+ scenarioId: c.scenarioId,
183
+ scope: c.scope,
184
+ label: c.label,
185
+ modelLabel: c.modelLabel,
186
+ code: c.code,
187
+ icon: c.icon,
188
+ tags: c.tags,
189
+ criticity: c.criticity,
190
+ parameters: c.parameters
191
+ }
192
+ }));
193
+ }
194
+ });
195
+
196
+ const routerLink = (item: any) => {
197
+ if(item.scope == ApplicationScope.OrganisationType){
198
+ return $r({ name: "scenario-organisation-type", params: { entityId: item.id } });
199
+ }
200
+ else
201
+ {
202
+ return $r({ name: "scenario-organisation", params: { entityId: item.id } });
203
+ }
204
+ };
205
+
206
+ const fetch = () =>{
207
+ if(props.scope == ApplicationScope.OrganisationType){
208
+ getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
209
+ }
210
+ else if(props.scope == ApplicationScope.Organisation){
211
+ getManyScenarioOrganisations(props.scenarioOrganisationFilters);
212
+ }
213
+ else{
214
+ getManyScenarioOrganisations(props.scenarioOrganisationFilters);
215
+ getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
216
+ }
217
+ }
218
+
219
+ watch(() => [props.scenarioOrganisationFilters,props.scenarioOrganisationTypeFilters, props.scope], (next, previous) => {
220
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
221
+ fetch();
222
+ }
223
+ }, { immediate: true });
224
+
225
+
226
+ return {
227
+ fetchingScenarioOrganisationTypes,
228
+ fetchingScenarioOrganisations,
229
+ scenarioOrganisationTypes,
230
+ scenarioOrganisations,
231
+ headerAssociation,
232
+ ApplicationScope,
233
+ headersOptions,
234
+ AlertTools,
235
+ ColorEnum,
236
+ scenarios,
237
+ routerLink
238
+ };
239
+ }
240
+ });
241
+ </script>
@@ -0,0 +1,155 @@
1
+ <template>
2
+ <FSDataTable
3
+ :items="serviceAccountOrganisations"
4
+ :itemTo="$props.itemTo"
5
+ :loading="fetchingServiceAccountOrganisations"
6
+ :showSelect="$props.editable"
7
+ :tableCode="$props.tableCode"
8
+ :modelValue="$props.modelValue"
9
+ @update:modelValue="$emit('update:modelValue', $event)"
10
+ v-bind="$attrs"
11
+ >
12
+ <template
13
+ v-for="(_, name) in $slots"
14
+ v-slot:[name]="slotData"
15
+ >
16
+ <slot
17
+ :name="name"
18
+ v-bind="slotData"
19
+ />
20
+ </template>
21
+ <template
22
+ #header.imageId-title
23
+ >
24
+ <FSIcon>
25
+ mdi-panorama-variant-outline
26
+ </FSIcon>
27
+ </template>
28
+ <template
29
+ #item.imageId="{ item }"
30
+ >
31
+ <FSImage
32
+ v-if="item.imageId"
33
+ height="32px"
34
+ width="32px"
35
+ :imageId="item.imageId"
36
+ :thumbnail="true"
37
+ />
38
+ </template>
39
+ <template
40
+ #item.tags="{ item }"
41
+ >
42
+ <FSTagGroup
43
+ variant="slide"
44
+ :editable="false"
45
+ :tags="item.tags"
46
+ />
47
+ </template>
48
+ <template
49
+ #item.validity="{ item }"
50
+ >
51
+ <FSSpan
52
+ font="text-overline"
53
+ >
54
+ {{ userValidityLabel(item.validity) }}
55
+ </FSSpan>
56
+ </template>
57
+ <template
58
+ #item.userType="{ item }"
59
+ >
60
+ <FSSpan
61
+ font="text-overline"
62
+ >
63
+ {{ userTypeLabel(item.userType) }}
64
+ </FSSpan>
65
+ </template>
66
+ <template
67
+ #item.tile="{ item, toggleSelect }"
68
+ >
69
+ <FSServiceAccountOrganisationTileUI
70
+ :to="$props.itemTo && $props.itemTo(item)"
71
+ :editable="$props.editable"
72
+ :modelValue="isSelected(item.id)"
73
+ @update:modelValue="toggleSelect(item)"
74
+ v-bind="item"
75
+ />
76
+ </template>
77
+ </FSDataTable>
78
+ </template>
79
+
80
+ <script lang="ts">
81
+ import type { PropType} from "vue";
82
+ import { defineComponent, watch } from "vue";
83
+ import type { RouteLocation } from "vue-router";
84
+ import _ from "lodash";
85
+
86
+ import type { ServiceAccountOrganisationFilters, ServiceAccountOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
87
+ import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
88
+ import { useServiceAccountOrganisations } from "@dative-gpi/foundation-core-services/composables";
89
+
90
+ import FSDataTable from "../FSDataTable.vue";
91
+
92
+ import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
93
+ import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
94
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
95
+ import FSServiceAccountOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSServiceAccountOrganisationTileUI.vue";
96
+
97
+ export default defineComponent({
98
+ name: "FSBaseServiceAccountOrganisationsList",
99
+ components: {
100
+ FSDataTable,
101
+ FSImage,
102
+ FSTagGroup,
103
+ FSSpan,
104
+ FSServiceAccountOrganisationTileUI
105
+ },
106
+ props: {
107
+ tableCode: {
108
+ type: String as PropType<string | null>,
109
+ required: false,
110
+ default: null
111
+ },
112
+ serviceAccountOrganisationsFilters: {
113
+ type: Object as PropType<ServiceAccountOrganisationFilters | null>,
114
+ required: false,
115
+ default: null
116
+ },
117
+ itemTo: {
118
+ type: Function as PropType<(item: ServiceAccountOrganisationInfos) => Partial<RouteLocation>>,
119
+ required: false
120
+ },
121
+ editable: {
122
+ type: Boolean,
123
+ required: false,
124
+ default: true
125
+ },
126
+ modelValue: {
127
+ type: Array as PropType<string[]>,
128
+ required: false,
129
+ default: () => []
130
+ }
131
+ },
132
+ emits: ["update:modelValue"],
133
+ setup(props) {
134
+ const { getMany: getManyServiceAccountOrganisations, entities: serviceAccountOrganisations, fetching: fetchingServiceAccountOrganisations } = useServiceAccountOrganisations();
135
+
136
+ const isSelected = (id: string): boolean => {
137
+ return props.modelValue.includes(id);
138
+ };
139
+
140
+ watch(() => props.serviceAccountOrganisationsFilters, (next, previous) => {
141
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
142
+ getManyServiceAccountOrganisations(props.serviceAccountOrganisationsFilters ?? undefined);
143
+ }
144
+ }, { immediate: true });
145
+
146
+ return {
147
+ fetchingServiceAccountOrganisations,
148
+ serviceAccountOrganisations,
149
+ userValidityLabel,
150
+ userTypeLabel,
151
+ isSelected
152
+ };
153
+ }
154
+ });
155
+ </script>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <FSDataTable
3
+ :loading="fetchingServiceAccountRoleOrganisations"
4
+ :items="serviceAccountRoleOrganisations"
5
+ :showSelect="$props.editable"
6
+ :tableCode="$props.tableCode"
7
+ :itemTo="$props.itemTo"
8
+ :modelValue="$props.modelValue"
9
+ @update:modelValue="$emit('update:modelValue', $event)"
10
+ v-bind="$attrs"
11
+ >
12
+ <template
13
+ v-for="(_, name) in $slots"
14
+ v-slot:[name]="slotData"
15
+ >
16
+ <slot
17
+ :name="name"
18
+ v-bind="slotData"
19
+ />
20
+ </template>
21
+ <template
22
+ #item.icon="{ item }"
23
+ >
24
+ <FSIcon>
25
+ {{ item.icon }}
26
+ </FSIcon>
27
+ </template>
28
+ <template
29
+ #item.userType="{ item }"
30
+ >
31
+ <FSRow
32
+ align="center-left"
33
+ >
34
+ <FSIcon>
35
+ {{ userTypeIcon(item.userType) }}
36
+ </FSIcon>
37
+ <FSText>
38
+ {{ userTypeLabel(item.userType) }}
39
+ </FSText>
40
+ </FSRow>
41
+ </template>
42
+ <template
43
+ #item.tags="{ item }"
44
+ >
45
+ <FSTagGroup
46
+ variant="slide"
47
+ :editable="false"
48
+ :tags="item.tags"
49
+ />
50
+ </template>
51
+ </FSDataTable>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { defineComponent, type PropType, watch } from "vue";
56
+ import { type RouteLocation } from "vue-router";
57
+ import _ from "lodash";
58
+
59
+ import { type ServiceAccountRoleOrganisationFilters, type ServiceAccountRoleOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
60
+ import { useServiceAccountRoleOrganisations } from "@dative-gpi/foundation-core-services/composables";
61
+ import { userTypeIcon, userTypeLabel } from "@dative-gpi/foundation-core-components/utils";
62
+
63
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
64
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
65
+ import FSText from "@dative-gpi/foundation-shared-components/components/FSText.vue";
66
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
67
+
68
+ import FSDataTable from "../FSDataTable.vue";
69
+
70
+ export default defineComponent({
71
+ name: "FSBaseServiceAccountRoleOrganisationsList",
72
+ components: {
73
+ FSDataTable,
74
+ FSTagGroup,
75
+ FSIcon,
76
+ FSText,
77
+ FSRow
78
+ },
79
+ props: {
80
+ tableCode: {
81
+ type: String as PropType<string | null>,
82
+ required: false,
83
+ default: null
84
+ },
85
+ serviceAccountRoleOrganisationsFilters: {
86
+ type: Object as PropType<ServiceAccountRoleOrganisationFilters | null>,
87
+ required: false,
88
+ default: null
89
+ },
90
+ itemTo: {
91
+ type: Function as PropType<(item: ServiceAccountRoleOrganisationInfos) => Partial<RouteLocation>>,
92
+ required: false
93
+ },
94
+ editable: {
95
+ type: Boolean,
96
+ required: false,
97
+ default: true
98
+ },
99
+ modelValue: {
100
+ type: Array as PropType<string[]>,
101
+ required: false,
102
+ default: () => []
103
+ }
104
+ },
105
+ emits: ["update:modelValue"],
106
+ setup(props) {
107
+ const { getMany: getManyServiceAccountRoleOrganisations, fetching: fetchingServiceAccountRoleOrganisations, entities: serviceAccountRoleOrganisations } = useServiceAccountRoleOrganisations();
108
+
109
+ const isSelected = (id: string): boolean => {
110
+ return props.modelValue.includes(id);
111
+ };
112
+
113
+ watch(() => props.serviceAccountRoleOrganisationsFilters, (next, previous) => {
114
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
115
+ getManyServiceAccountRoleOrganisations(props.serviceAccountRoleOrganisationsFilters ?? undefined);
116
+ }
117
+ }, { immediate: true });
118
+
119
+ return {
120
+ fetchingServiceAccountRoleOrganisations,
121
+ serviceAccountRoleOrganisations,
122
+ userTypeLabel,
123
+ userTypeIcon,
124
+ isSelected
125
+ };
126
+ }
127
+ });
128
+ </script>