@dative-gpi/foundation-core-components 1.0.65 → 1.0.67-map-edit
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.
- package/components/autocompletes/FSAutocompleteChart.vue +15 -8
- package/components/autocompletes/FSAutocompleteDashboard.vue +14 -6
- package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteDataCategory.vue +11 -5
- package/components/autocompletes/FSAutocompleteDataDefinition.vue +7 -1
- package/components/autocompletes/FSAutocompleteGroup.vue +7 -1
- package/components/autocompletes/FSAutocompleteLocation.vue +6 -0
- package/components/autocompletes/FSAutocompleteManufacturer.vue +8 -0
- package/components/autocompletes/FSAutocompleteModel.vue +9 -1
- package/components/autocompletes/FSAutocompleteOrganisationType.vue +7 -1
- package/components/autocompletes/FSAutocompleteRole.vue +14 -6
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
- package/components/customProperties/FSMetaField.vue +35 -40
- package/components/customProperties/FSMetaFormContent.vue +4 -3
- package/components/customProperties/FSMetaHistory.vue +2 -2
- package/components/customProperties/helpers.ts +57 -165
- package/components/entities/FSBaseEntitiesList.vue +12 -2
- package/components/entities/FSDialogSelectEntities.vue +19 -2
- package/components/entities/FSEntityField.vue +75 -14
- package/components/entities/FSSelectEntitiesList.vue +40 -7
- package/components/explorers/FSBaseDevicesExplorer.vue +322 -0
- package/components/explorers/FSBaseFoldersExplorer.vue +126 -24
- package/components/lists/FSDataTable.vue +22 -16
- package/components/lists/alerts/FSBaseAlertsList.vue +96 -106
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +4 -4
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +6 -4
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +97 -34
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +98 -34
- package/components/lists/charts/FSBaseChartsList.vue +153 -64
- package/components/lists/comments/FSBaseCommentsList.vue +39 -23
- package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +41 -8
- package/components/lists/dashboards/FSBaseDashboardsList.vue +76 -16
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +33 -7
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +8 -6
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +8 -5
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +70 -44
- package/components/lists/folders/FSBaseFoldersList.vue +27 -15
- package/components/lists/groups/FSBaseGroupsList.vue +13 -9
- package/components/lists/locations/FSBaseLocationsList.vue +17 -13
- package/components/lists/models/FSBaseModelsList.vue +31 -13
- package/components/lists/playlists/FSSimplePlaylistsList.vue +44 -0
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +6 -5
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +17 -16
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +45 -8
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +45 -7
- package/components/lists/scenarios/FSBaseScenariosList.vue +121 -86
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +10 -7
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +10 -7
- package/components/lists/userOrganisations/FSChipUserOrganisationsList.vue +61 -0
- package/components/tiles/FSChartTile.vue +71 -0
- package/components/tiles/FSDashboardOrganisationTile.vue +3 -3
- package/components/tiles/FSDashboardOrganisationTypeTile.vue +3 -3
- package/components/tiles/FSDashboardShallowTile.vue +3 -3
- package/components/tiles/FSDeviceOrganisationTile.vue +3 -3
- package/components/tiles/FSFolderTile.vue +7 -5
- package/components/tiles/FSGroupTile.vue +3 -3
- package/components/tiles/FSLocationTile.vue +5 -3
- package/components/tiles/FSModelTile.vue +64 -0
- package/components/tiles/FSServiceAccountOrganisationTile.vue +3 -3
- package/components/tiles/FSUserOrganisationTile.vue +3 -3
- package/components/treeviews/FSTreeViewGroup.vue +7 -1
- package/package.json +9 -9
- package/utils/dashboards.ts +4 -4
- package/utils/index.ts +0 -1
- package/utils/roles.ts +3 -3
- package/utils/users.ts +3 -3
- package/components/selects/FSAggregationSelector.vue +0 -51
- package/components/selects/FSAxisTypeSelector.vue +0 -48
- package/components/selects/FSDisplayAsSelector.vue +0 -52
- package/components/selects/FSFilterTypeSelector.vue +0 -53
- package/components/selects/FSHeatmapRuleSelector.vue +0 -52
- package/components/selects/FSOperationOnSelector.vue +0 -51
- package/components/selects/FSPlanningTypeSelector.vue +0 -51
- package/components/selects/FSPlotPerSelector.vue +0 -51
- package/components/selects/FSSelectEntityType.vue +0 -59
- package/components/selects/FSSerieTypeSelector.vue +0 -51
- package/utils/charts.ts +0 -137
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSDataTable
|
|
3
3
|
:loading="fetchingScenarioOrganisationTypes || fetchingScenarioOrganisations"
|
|
4
|
-
:
|
|
4
|
+
:headersOptions="headersOptions"
|
|
5
|
+
:extraHeaders="headerAssociation"
|
|
5
6
|
:items="scenarios"
|
|
6
|
-
:
|
|
7
|
-
:tableCode="$props.tableCode"
|
|
7
|
+
:itemTo="routerLink"
|
|
8
8
|
:modelValue="$props.modelValue"
|
|
9
|
+
:tableCode="$props.tableCode"
|
|
9
10
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
10
11
|
v-bind="$attrs"
|
|
11
12
|
>
|
|
@@ -27,12 +28,29 @@
|
|
|
27
28
|
</FSIcon>
|
|
28
29
|
</template>
|
|
29
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
|
+
|
|
30
48
|
<template
|
|
31
49
|
#item.tags="{ item }"
|
|
32
50
|
>
|
|
33
51
|
<FSTagGroup
|
|
34
52
|
variant="slide"
|
|
35
|
-
:
|
|
53
|
+
:showRemove="false"
|
|
36
54
|
:tags="item.tags"
|
|
37
55
|
/>
|
|
38
56
|
</template>
|
|
@@ -45,27 +63,37 @@ import _ from "lodash";
|
|
|
45
63
|
|
|
46
64
|
import { useTranslations } from "@dative-gpi/bones-ui";
|
|
47
65
|
|
|
48
|
-
import {
|
|
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"
|
|
49
70
|
|
|
50
71
|
import type { ScenarioOrganisationFilters, ScenarioOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
51
|
-
|
|
52
|
-
import { useScenarioOrganisations, useScenarioOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
72
|
+
import { useScenarioOrganisations, useScenarioOrganisationTypes, useRouteOrganisation } from "@dative-gpi/foundation-core-services/composables";
|
|
53
73
|
|
|
54
74
|
import FSDataTable from "../FSDataTable.vue";
|
|
55
|
-
import FSIcon from "@dative-gpi/foundation-shared-components/components/FSIcon.vue";
|
|
56
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";
|
|
57
78
|
|
|
58
79
|
export default defineComponent({
|
|
59
80
|
name: "FSBaseScenariosList",
|
|
60
|
-
components:
|
|
81
|
+
components:{
|
|
61
82
|
FSDataTable,
|
|
83
|
+
FSTagGroup,
|
|
62
84
|
FSIcon,
|
|
63
|
-
|
|
85
|
+
FSRow
|
|
64
86
|
},
|
|
65
87
|
props: {
|
|
66
88
|
tableCode: {
|
|
67
|
-
type: String
|
|
68
|
-
required:
|
|
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
|
|
69
97
|
},
|
|
70
98
|
scenarioOrganisationFilters: {
|
|
71
99
|
type: Object as PropType<ScenarioOrganisationFilters>,
|
|
@@ -77,79 +105,60 @@ export default defineComponent({
|
|
|
77
105
|
required: false,
|
|
78
106
|
default: null
|
|
79
107
|
},
|
|
80
|
-
|
|
108
|
+
showAssociation: {
|
|
81
109
|
type: Boolean,
|
|
82
110
|
required: false,
|
|
83
111
|
default: true
|
|
84
112
|
},
|
|
85
|
-
|
|
86
|
-
type:
|
|
87
|
-
|
|
88
|
-
|
|
113
|
+
scope: {
|
|
114
|
+
type: Number as PropType<ApplicationScope>,
|
|
115
|
+
required: false,
|
|
116
|
+
default: ApplicationScope.None
|
|
89
117
|
}
|
|
90
118
|
},
|
|
91
119
|
emits: ["update:modelValue"],
|
|
92
|
-
setup(props
|
|
120
|
+
setup(props) {
|
|
93
121
|
const { $tr } = useTranslations();
|
|
94
122
|
const { entities: scenarioOrganisations, fetching: fetchingScenarioOrganisations, getMany: getManyScenarioOrganisations } = useScenarioOrganisations();
|
|
95
123
|
const { entities: scenarioOrganisationTypes, fetching: fetchingScenarioOrganisationTypes, getMany: getManyScenarioOrganisationTypes } = useScenarioOrganisationTypes();
|
|
96
124
|
|
|
97
|
-
const
|
|
98
|
-
return props.modelValue.includes(value);
|
|
99
|
-
};
|
|
125
|
+
const { $r } = useRouteOrganisation();
|
|
100
126
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
const headerAssociation = computed(() => {
|
|
128
|
+
if(props.showAssociation){
|
|
129
|
+
return [{
|
|
130
|
+
columnId: "association",
|
|
131
|
+
text: $tr("ui.common.association", "Association"),
|
|
132
|
+
value: "association",
|
|
106
133
|
sortable: false,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
text: $tr("entity.scenario.modelLabel", "Model label"),
|
|
115
|
-
value: "modelLabel",
|
|
116
|
-
sortable: true
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
text: $tr("entity.scenario.dataCategoryLabel", "Data category label"),
|
|
120
|
-
value: "dataCategoryLabel",
|
|
121
|
-
sortable: true
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
text: $tr("ui.common.action", ""),
|
|
125
|
-
value: "action",
|
|
126
|
-
sortable: false
|
|
127
|
-
}
|
|
128
|
-
];
|
|
134
|
+
filterable: false,
|
|
135
|
+
index: -1,
|
|
136
|
+
hidden: false
|
|
137
|
+
}];
|
|
138
|
+
}
|
|
129
139
|
});
|
|
130
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
|
+
}));
|
|
131
150
|
|
|
132
151
|
const scenarios = computed(() => {
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
label: c.label,
|
|
142
|
-
modelLabel: c.modelLabel,
|
|
143
|
-
code: c.code,
|
|
144
|
-
icon: c.icon,
|
|
145
|
-
tags: c.tags,
|
|
146
|
-
criticity: c.criticity,
|
|
147
|
-
parameters: c.parameters
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
.concat(scenarioOrganisationTypes.value.map(c => {
|
|
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 => {
|
|
151
160
|
return {
|
|
152
|
-
id:
|
|
161
|
+
id: c.id,
|
|
153
162
|
modelId: c.modelId,
|
|
154
163
|
dataCategoryId : c.dataCategoryId,
|
|
155
164
|
dataCategoryLabel: c.dataCategoryLabel,
|
|
@@ -163,43 +172,69 @@ export default defineComponent({
|
|
|
163
172
|
criticity: c.criticity,
|
|
164
173
|
parameters: c.parameters
|
|
165
174
|
}
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
+
});
|
|
173
195
|
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
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
|
+
};
|
|
177
205
|
|
|
178
|
-
|
|
179
|
-
|
|
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);
|
|
180
212
|
}
|
|
181
213
|
else{
|
|
182
|
-
|
|
214
|
+
getManyScenarioOrganisations(props.scenarioOrganisationFilters);
|
|
215
|
+
getManyScenarioOrganisationTypes(props.scenarioOrganisationTypeFilters)
|
|
183
216
|
}
|
|
184
217
|
}
|
|
185
|
-
|
|
186
|
-
watch(() => [props.scenarioOrganisationFilters,props.scenarioOrganisationTypeFilters], (next, previous) => {
|
|
218
|
+
|
|
219
|
+
watch(() => [props.scenarioOrganisationFilters,props.scenarioOrganisationTypeFilters, props.scope], (next, previous) => {
|
|
187
220
|
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
188
221
|
fetch();
|
|
189
222
|
}
|
|
190
223
|
}, { immediate: true });
|
|
191
|
-
|
|
224
|
+
|
|
192
225
|
|
|
193
226
|
return {
|
|
194
227
|
fetchingScenarioOrganisationTypes,
|
|
195
228
|
fetchingScenarioOrganisations,
|
|
196
229
|
scenarioOrganisationTypes,
|
|
197
230
|
scenarioOrganisations,
|
|
231
|
+
headerAssociation,
|
|
232
|
+
ApplicationScope,
|
|
233
|
+
headersOptions,
|
|
234
|
+
AlertTools,
|
|
198
235
|
ColorEnum,
|
|
199
236
|
scenarios,
|
|
200
|
-
|
|
201
|
-
isSelected,
|
|
202
|
-
update
|
|
237
|
+
routerLink
|
|
203
238
|
};
|
|
204
239
|
}
|
|
205
240
|
});
|
package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:items="serviceAccountOrganisations"
|
|
4
4
|
:itemTo="$props.itemTo"
|
|
5
5
|
:loading="fetchingServiceAccountOrganisations"
|
|
6
|
-
:
|
|
6
|
+
:selectable="$props.selectable"
|
|
7
7
|
:tableCode="$props.tableCode"
|
|
8
8
|
:modelValue="$props.modelValue"
|
|
9
9
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
height="32px"
|
|
34
34
|
width="32px"
|
|
35
35
|
:imageId="item.imageId"
|
|
36
|
+
:thumbnail="true"
|
|
36
37
|
/>
|
|
37
38
|
</template>
|
|
38
39
|
<template
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
>
|
|
41
42
|
<FSTagGroup
|
|
42
43
|
variant="slide"
|
|
43
|
-
:
|
|
44
|
+
:showRemove="false"
|
|
44
45
|
:tags="item.tags"
|
|
45
46
|
/>
|
|
46
47
|
</template>
|
|
@@ -63,11 +64,12 @@
|
|
|
63
64
|
</FSSpan>
|
|
64
65
|
</template>
|
|
65
66
|
<template
|
|
66
|
-
#item.tile="{ item, toggleSelect }"
|
|
67
|
+
#item.tile="{ index, item, toggleSelect }"
|
|
67
68
|
>
|
|
68
69
|
<FSServiceAccountOrganisationTileUI
|
|
70
|
+
:key="index"
|
|
69
71
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
70
|
-
:
|
|
72
|
+
:selectable="$props.selectable"
|
|
71
73
|
:modelValue="isSelected(item.id)"
|
|
72
74
|
@update:modelValue="toggleSelect(item)"
|
|
73
75
|
v-bind="item"
|
|
@@ -104,8 +106,9 @@ export default defineComponent({
|
|
|
104
106
|
},
|
|
105
107
|
props: {
|
|
106
108
|
tableCode: {
|
|
107
|
-
type: String
|
|
108
|
-
required:
|
|
109
|
+
type: String as PropType<string | null>,
|
|
110
|
+
required: false,
|
|
111
|
+
default: null
|
|
109
112
|
},
|
|
110
113
|
serviceAccountOrganisationsFilters: {
|
|
111
114
|
type: Object as PropType<ServiceAccountOrganisationFilters | null>,
|
|
@@ -116,7 +119,7 @@ export default defineComponent({
|
|
|
116
119
|
type: Function as PropType<(item: ServiceAccountOrganisationInfos) => Partial<RouteLocation>>,
|
|
117
120
|
required: false
|
|
118
121
|
},
|
|
119
|
-
|
|
122
|
+
selectable: {
|
|
120
123
|
type: Boolean,
|
|
121
124
|
required: false,
|
|
122
125
|
default: true
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
:loading="fetchingServiceAccountRoleOrganisations"
|
|
4
|
+
:items="serviceAccountRoleOrganisations"
|
|
5
|
+
:selectable="$props.selectable"
|
|
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
|
+
:showRemove="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
|
+
selectable: {
|
|
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>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:items="userOrganisations"
|
|
4
4
|
:itemTo="$props.itemTo"
|
|
5
5
|
:loading="fetchingUserOrganisations"
|
|
6
|
-
:
|
|
6
|
+
:selectable="$props.selectable"
|
|
7
7
|
:tableCode="$props.tableCode"
|
|
8
8
|
:modelValue="$props.modelValue"
|
|
9
9
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
height="32px"
|
|
34
34
|
width="32px"
|
|
35
35
|
:imageId="item.imageId"
|
|
36
|
+
:thumbnail="true"
|
|
36
37
|
/>
|
|
37
38
|
</template>
|
|
38
39
|
<template
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
>
|
|
55
56
|
<FSTagGroup
|
|
56
57
|
variant="slide"
|
|
57
|
-
:
|
|
58
|
+
:showRemove="false"
|
|
58
59
|
:tags="item.tags"
|
|
59
60
|
/>
|
|
60
61
|
</template>
|
|
@@ -77,11 +78,12 @@
|
|
|
77
78
|
</FSSpan>
|
|
78
79
|
</template>
|
|
79
80
|
<template
|
|
80
|
-
#item.tile="{ item, toggleSelect }"
|
|
81
|
+
#item.tile="{ index, item, toggleSelect }"
|
|
81
82
|
>
|
|
82
83
|
<FSUserOrganisationTileUI
|
|
84
|
+
:key="index"
|
|
83
85
|
:to="$props.itemTo && $props.itemTo(item)"
|
|
84
|
-
:
|
|
86
|
+
:selectable="$props.selectable"
|
|
85
87
|
:modelValue="isSelected(item.id)"
|
|
86
88
|
@update:modelValue="toggleSelect(item)"
|
|
87
89
|
v-bind="item"
|
|
@@ -120,8 +122,9 @@ export default defineComponent({
|
|
|
120
122
|
},
|
|
121
123
|
props: {
|
|
122
124
|
tableCode: {
|
|
123
|
-
type: String
|
|
124
|
-
required:
|
|
125
|
+
type: String as PropType<string | null>,
|
|
126
|
+
required: false,
|
|
127
|
+
default: null
|
|
125
128
|
},
|
|
126
129
|
userOrganisationsFilters: {
|
|
127
130
|
type: Object as PropType<UserOrganisationFilters | null>,
|
|
@@ -132,7 +135,7 @@ export default defineComponent({
|
|
|
132
135
|
type: Function as PropType<(item: UserOrganisationInfos) => Partial<RouteLocation>>,
|
|
133
136
|
required: false
|
|
134
137
|
},
|
|
135
|
-
|
|
138
|
+
selectable: {
|
|
136
139
|
type: Boolean,
|
|
137
140
|
required: false,
|
|
138
141
|
default: true
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
v-if="fetching"
|
|
4
|
+
>
|
|
5
|
+
<FSLoader
|
|
6
|
+
v-for="i in 4"
|
|
7
|
+
:key="i"
|
|
8
|
+
variant="chip"
|
|
9
|
+
height="12px"
|
|
10
|
+
/>
|
|
11
|
+
</FSRow>
|
|
12
|
+
<FSChipGroup
|
|
13
|
+
v-else
|
|
14
|
+
:color="ColorEnum.Light"
|
|
15
|
+
:labels="userOrganisations?.map(u => u.name)"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { defineComponent, watch, type PropType } from "vue";
|
|
22
|
+
|
|
23
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
24
|
+
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
25
|
+
|
|
26
|
+
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
27
|
+
import FSLoader from "@dative-gpi/foundation-shared-components/components/FSLoader.vue";
|
|
28
|
+
import FSChipGroup from "@dative-gpi/foundation-shared-components/components/FSChipGroup.vue";
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: "FSChipUserOrganisationsList",
|
|
32
|
+
components: {
|
|
33
|
+
FSChipGroup,
|
|
34
|
+
FSLoader,
|
|
35
|
+
FSRow
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
userOrganisationIds: {
|
|
39
|
+
type: Array as PropType<string[]>,
|
|
40
|
+
required: false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(props) {
|
|
44
|
+
const {getMany: fetchUserOrganisations, fetching, entities: userOrganisations} = useUserOrganisations();
|
|
45
|
+
|
|
46
|
+
watch(() => props.userOrganisationIds, async () => {
|
|
47
|
+
if(props.userOrganisationIds && props.userOrganisationIds.length > 0){
|
|
48
|
+
fetchUserOrganisations({
|
|
49
|
+
userOrganisationsIds: props.userOrganisationIds
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, {immediate: true});
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
userOrganisations,
|
|
56
|
+
ColorEnum,
|
|
57
|
+
fetching
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSChartTileUI
|
|
3
|
+
v-if="chart"
|
|
4
|
+
:label="chart.label"
|
|
5
|
+
:icon="chart.icon"
|
|
6
|
+
:type="chart.chartType"
|
|
7
|
+
:scope="chart.scope"
|
|
8
|
+
:imageId="chart.imageId"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import { computed, defineComponent, type PropType, watch } from "vue";
|
|
15
|
+
|
|
16
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
17
|
+
import { chartIcon } from "@dative-gpi/foundation-shared-components/tools";
|
|
18
|
+
|
|
19
|
+
import { useChartOrganisation, useChartOrganisationType } from "@dative-gpi/foundation-core-services/composables";
|
|
20
|
+
import { ApplicationScope } from "@dative-gpi/foundation-shared-domain/enums";
|
|
21
|
+
|
|
22
|
+
import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: "FSChartTile",
|
|
26
|
+
components: {
|
|
27
|
+
FSChartTileUI
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
chartId: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
scope: {
|
|
35
|
+
type: Object as PropType<ApplicationScope | number>,
|
|
36
|
+
required : true
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setup(props) {
|
|
40
|
+
const { get : fetchChartOrganisationType, entity : chartOrganisationType } = useChartOrganisationType();
|
|
41
|
+
const { get : fetchChartOrganisation, entity : chartOrganisation } = useChartOrganisation();
|
|
42
|
+
|
|
43
|
+
const chart = computed(() => {
|
|
44
|
+
if (props.scope == ApplicationScope.Organisation) {
|
|
45
|
+
return chartOrganisation.value;
|
|
46
|
+
}
|
|
47
|
+
else if (props.scope == ApplicationScope.OrganisationType) {
|
|
48
|
+
return chartOrganisationType.value;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return null
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
watch(() => [props.chartId, props.scope], () => {
|
|
56
|
+
if (props.scope == ApplicationScope.Organisation) {
|
|
57
|
+
fetchChartOrganisation(props.chartId);
|
|
58
|
+
}
|
|
59
|
+
else if (props.scope == ApplicationScope.OrganisationType) {
|
|
60
|
+
fetchChartOrganisationType(props.chartId)
|
|
61
|
+
}
|
|
62
|
+
}, {immediate : true})
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
ColorEnum,
|
|
66
|
+
chart,
|
|
67
|
+
chartIcon
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
</script>
|