@dative-gpi/foundation-core-components 1.0.27 → 1.0.28-remove-deprecated2

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 +60 -58
  2. package/components/autocompletes/FSAutocompleteDashboard.vue +59 -56
  3. package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +30 -39
  4. package/components/autocompletes/FSAutocompleteDataCategory.vue +52 -38
  5. package/components/autocompletes/FSAutocompleteDataDefinition.vue +25 -39
  6. package/components/autocompletes/FSAutocompleteGroup.vue +23 -38
  7. package/components/autocompletes/FSAutocompleteLocation.vue +23 -38
  8. package/components/autocompletes/FSAutocompleteManufacturer.vue +65 -2
  9. package/components/autocompletes/FSAutocompleteModel.vue +66 -3
  10. package/components/autocompletes/FSAutocompleteOrganisationType.vue +23 -0
  11. package/components/autocompletes/FSAutocompleteRole.vue +59 -56
  12. package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +105 -0
  13. package/components/autocompletes/FSAutocompleteUserOrganisation.vue +32 -57
  14. package/components/customProperties/FSMetaField.vue +31 -35
  15. package/components/customProperties/FSMetaHistory.vue +4 -4
  16. package/components/customProperties/FSMetaValue.vue +66 -33
  17. package/components/customProperties/helpers.ts +2 -1
  18. package/components/entities/FSBaseEntitiesList.vue +50 -0
  19. package/components/entities/FSDialogSelectEntities.vue +83 -0
  20. package/components/entities/FSEntityField.vue +203 -0
  21. package/components/entities/FSSelectEntitiesList.vue +209 -0
  22. package/components/entities/FSSimpleEntitiesList.vue +100 -0
  23. package/components/explorers/FSBaseDevicesExplorer.vue +310 -0
  24. package/components/explorers/FSBaseFoldersExplorer.vue +265 -0
  25. package/components/lists/FSDataTable.vue +23 -21
  26. package/components/lists/alerts/FSBaseAlertsList.vue +337 -0
  27. package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +101 -0
  28. package/components/lists/authTokens/FSBaseAuthTokensList.vue +79 -0
  29. package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +204 -0
  30. package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +205 -0
  31. package/components/lists/charts/FSBaseChartsList.vue +268 -0
  32. package/components/lists/comments/FSBaseCommentsList.vue +143 -0
  33. package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
  34. package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +168 -0
  35. package/components/lists/dashboards/FSBaseDashboardsList.vue +227 -0
  36. package/components/lists/dashboards/FSSimpleDashboardsList.vue +63 -0
  37. package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +154 -0
  38. package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +129 -0
  39. package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +327 -0
  40. package/components/lists/deviceOrganisations/FSSimpleDeviceOrganisationsList.vue +44 -0
  41. package/components/lists/folders/FSBaseFoldersList.vue +127 -0
  42. package/components/lists/folders/FSSimpleFoldersList.vue +44 -0
  43. package/components/lists/groups/FSBaseGroupsList.vue +136 -0
  44. package/components/lists/groups/FSSimpleGroupsList.vue +44 -0
  45. package/components/lists/locations/FSBaseLocationsList.vue +118 -0
  46. package/components/lists/locations/FSSimpleLocationsList.vue +44 -0
  47. package/components/lists/models/FSBaseModelsList.vue +155 -0
  48. package/components/lists/models/FSSimpleModelsList.vue +44 -0
  49. package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +128 -0
  50. package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +128 -0
  51. package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +157 -0
  52. package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +145 -0
  53. package/components/lists/scenarios/FSBaseScenariosList.vue +241 -0
  54. package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +156 -0
  55. package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
  56. package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +172 -0
  57. package/components/lists/userOrganisations/FSSimpleUserOrganisationsList.vue +45 -0
  58. package/components/tiles/FSDeviceOrganisationTile.vue +9 -2
  59. package/components/tiles/FSLocationTile.vue +66 -0
  60. package/components/treeviews/FSTreeViewFolder.vue +15 -3
  61. package/components/treeviews/FSTreeViewGroup.vue +22 -4
  62. package/package.json +9 -9
  63. package/utils/dashboards.ts +33 -5
  64. package/utils/index.ts +2 -2
  65. package/utils/permissions.ts +80 -0
  66. package/utils/roles.ts +4 -4
  67. package/utils/tables.ts +41 -0
  68. package/utils/users.ts +7 -4
  69. package/components/selects/FSAggregationSelector.vue +0 -51
  70. package/components/selects/FSAxisTypeSelector.vue +0 -48
  71. package/components/selects/FSDataCategorySelector.vue +0 -62
  72. package/components/selects/FSDataDefinitionSelector.vue +0 -66
  73. package/components/selects/FSDisplayAsSelector.vue +0 -52
  74. package/components/selects/FSFilterTypeSelector.vue +0 -53
  75. package/components/selects/FSHeatmapRuleSelector.vue +0 -52
  76. package/components/selects/FSModelSelector.vue +0 -56
  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/FSSelectSelectedEntities.vue +0 -59
  81. package/components/selects/FSSerieTypeSelector.vue +0 -51
  82. package/utils/charts.ts +0 -136
@@ -0,0 +1,157 @@
1
+ <template>
2
+ <FSDataTable
3
+ :items="scenarioOrganisationTypes"
4
+ :itemTo="$props.itemTo"
5
+ :loading="fetchingScenarioOrganisationTypes"
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
+
22
+ <template
23
+ #item.icon="{ item }"
24
+ >
25
+ <FSIcon>
26
+ {{ item.icon }}
27
+ </FSIcon>
28
+ </template>
29
+
30
+ <template
31
+ #item.criticity="{ item }"
32
+ >
33
+ <FSRow
34
+ align="center-left"
35
+ >
36
+ <FSIcon
37
+ :color="AlertTools.criticityColor(item.criticity)"
38
+ >
39
+ {{ AlertTools.criticityIcon(item.criticity) }}
40
+ </FSIcon>
41
+ <FSSpan>
42
+ {{ AlertTools.criticityLabel(item.criticity) }}
43
+ </FSSpan>
44
+ </FSRow>
45
+ </template>
46
+
47
+ <template
48
+ #item.imageId="{ item }"
49
+ >
50
+ <FSImage
51
+ v-if="item.imageId"
52
+ height="32px"
53
+ width="32px"
54
+ :imageId="item.imageId"
55
+ :thumbnail="true"
56
+ />
57
+ </template>
58
+
59
+ <template
60
+ #item.tags="{ item }"
61
+ >
62
+ <FSTagGroup
63
+ variant="slide"
64
+ :editable="false"
65
+ :tags="item.tags"
66
+ />
67
+ </template>
68
+ </FSDataTable>
69
+ </template>
70
+
71
+ <script lang="ts">
72
+ import { computed, defineComponent, type PropType, watch } from "vue";
73
+ import type { RouteLocation } from "vue-router";
74
+ import _ from "lodash";
75
+
76
+ import { Criticity } from "@dative-gpi/foundation-shared-domain/enums";
77
+ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
78
+ import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
79
+
80
+ import type { ScenarioOrganisationTypeFilters, ScenarioOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
81
+ import { useScenarioOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
82
+
83
+ import FSDataTable from "../FSDataTable.vue";
84
+ import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
85
+ import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
86
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
87
+ import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
88
+
89
+ export default defineComponent({
90
+ name: "FSBaseScenarioOrganisationTypesList",
91
+ components: {
92
+ FSDataTable,
93
+ FSTagGroup,
94
+ FSImage,
95
+ FSIcon,
96
+ FSRow,
97
+ },
98
+ props: {
99
+ tableCode: {
100
+ type: String as PropType<string | null>,
101
+ required: false,
102
+ default: null
103
+ },
104
+ scenarioOrganisationTypeFilters: {
105
+ type: Object as PropType<ScenarioOrganisationTypeFilters>,
106
+ required: false,
107
+ default: null
108
+ },
109
+ itemTo: {
110
+ type: Function as PropType<(item: ScenarioOrganisationTypeInfos) => Partial<RouteLocation>>,
111
+ required: false
112
+ },
113
+ editable: {
114
+ type: Boolean,
115
+ required: false,
116
+ default: true
117
+ },
118
+ modelValue: {
119
+ type: Array as PropType<string[]>,
120
+ default: () => [],
121
+ required: false
122
+ }
123
+ },
124
+ emits: ["update:modelValue"],
125
+ setup(props) {
126
+ const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
127
+
128
+ const headersOptions = computed(() => ({
129
+ criticity: {
130
+ fixedFilters: getEnumEntries(Criticity).map(e => ({
131
+ value: e.value,
132
+ text: AlertTools.criticityLabel(e.value)
133
+ })),
134
+ methodFilter: (value: Criticity, item: Criticity) => value == item
135
+ }
136
+ }));
137
+
138
+ const isSelected = (id: string): boolean => {
139
+ return props.modelValue.includes(id);
140
+ };
141
+
142
+ watch(() => props.scenarioOrganisationTypeFilters, (next, previous) => {
143
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
144
+ getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters);
145
+ }
146
+ }, { immediate: true });
147
+
148
+ return {
149
+ fetchingScenarioOrganisationTypes,
150
+ scenarioOrganisationTypes,
151
+ headersOptions,
152
+ AlertTools,
153
+ isSelected
154
+ };
155
+ }
156
+ });
157
+ </script>
@@ -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,156 @@
1
+ <template>
2
+ <FSDataTable
3
+ defaultMode="iterator"
4
+ :items="serviceAccountOrganisations"
5
+ :itemTo="$props.itemTo"
6
+ :loading="fetchingServiceAccountOrganisations"
7
+ :showSelect="$props.editable"
8
+ :tableCode="$props.tableCode"
9
+ :modelValue="$props.modelValue"
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
+ <template
23
+ #header.imageId-title
24
+ >
25
+ <FSIcon>
26
+ mdi-panorama-variant-outline
27
+ </FSIcon>
28
+ </template>
29
+ <template
30
+ #item.imageId="{ item }"
31
+ >
32
+ <FSImage
33
+ v-if="item.imageId"
34
+ height="32px"
35
+ width="32px"
36
+ :imageId="item.imageId"
37
+ :thumbnail="true"
38
+ />
39
+ </template>
40
+ <template
41
+ #item.tags="{ item }"
42
+ >
43
+ <FSTagGroup
44
+ variant="slide"
45
+ :editable="false"
46
+ :tags="item.tags"
47
+ />
48
+ </template>
49
+ <template
50
+ #item.validity="{ item }"
51
+ >
52
+ <FSSpan
53
+ font="text-overline"
54
+ >
55
+ {{ userValidityLabel(item.validity) }}
56
+ </FSSpan>
57
+ </template>
58
+ <template
59
+ #item.userType="{ item }"
60
+ >
61
+ <FSSpan
62
+ font="text-overline"
63
+ >
64
+ {{ userTypeLabel(item.userType) }}
65
+ </FSSpan>
66
+ </template>
67
+ <template
68
+ #item.tile="{ item, toggleSelect }"
69
+ >
70
+ <FSServiceAccountOrganisationTileUI
71
+ :to="$props.itemTo && $props.itemTo(item)"
72
+ :editable="$props.editable"
73
+ :modelValue="isSelected(item.id)"
74
+ @update:modelValue="toggleSelect(item)"
75
+ v-bind="item"
76
+ />
77
+ </template>
78
+ </FSDataTable>
79
+ </template>
80
+
81
+ <script lang="ts">
82
+ import type { PropType} from "vue";
83
+ import { defineComponent, watch } from "vue";
84
+ import type { RouteLocation } from "vue-router";
85
+ import _ from "lodash";
86
+
87
+ import type { ServiceAccountOrganisationFilters, ServiceAccountOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
88
+ import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
89
+ import { useServiceAccountOrganisations } from "@dative-gpi/foundation-core-services/composables";
90
+
91
+ import FSDataTable from "../FSDataTable.vue";
92
+
93
+ import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
94
+ import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
95
+ import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
96
+ import FSServiceAccountOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSServiceAccountOrganisationTileUI.vue";
97
+
98
+ export default defineComponent({
99
+ name: "FSBaseServiceAccountOrganisationsList",
100
+ components: {
101
+ FSDataTable,
102
+ FSImage,
103
+ FSTagGroup,
104
+ FSSpan,
105
+ FSServiceAccountOrganisationTileUI
106
+ },
107
+ props: {
108
+ tableCode: {
109
+ type: String as PropType<string | null>,
110
+ required: false,
111
+ default: null
112
+ },
113
+ serviceAccountOrganisationsFilters: {
114
+ type: Object as PropType<ServiceAccountOrganisationFilters | null>,
115
+ required: false,
116
+ default: null
117
+ },
118
+ itemTo: {
119
+ type: Function as PropType<(item: ServiceAccountOrganisationInfos) => Partial<RouteLocation>>,
120
+ required: false
121
+ },
122
+ editable: {
123
+ type: Boolean,
124
+ required: false,
125
+ default: true
126
+ },
127
+ modelValue: {
128
+ type: Array as PropType<string[]>,
129
+ required: false,
130
+ default: () => []
131
+ }
132
+ },
133
+ emits: ["update:modelValue"],
134
+ setup(props) {
135
+ const { getMany: getManyServiceAccountOrganisations, entities: serviceAccountOrganisations, fetching: fetchingServiceAccountOrganisations } = useServiceAccountOrganisations();
136
+
137
+ const isSelected = (id: string): boolean => {
138
+ return props.modelValue.includes(id);
139
+ };
140
+
141
+ watch(() => props.serviceAccountOrganisationsFilters, (next, previous) => {
142
+ if ((!next && !previous) || !_.isEqual(next, previous)) {
143
+ getManyServiceAccountOrganisations(props.serviceAccountOrganisationsFilters ?? undefined);
144
+ }
145
+ }, { immediate: true });
146
+
147
+ return {
148
+ fetchingServiceAccountOrganisations,
149
+ serviceAccountOrganisations,
150
+ userValidityLabel,
151
+ userTypeLabel,
152
+ isSelected
153
+ };
154
+ }
155
+ });
156
+ </script>