@dative-gpi/foundation-core-components 1.0.35 → 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.
- package/components/autocompletes/FSAutocompleteChart.vue +18 -8
- package/components/autocompletes/FSAutocompleteDashboard.vue +16 -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 +17 -6
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +7 -1
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +9 -1
- package/components/chips/FSChipGroupUserOrganisation.vue +61 -0
- package/components/chips/FSChipGroupUserOrganisationUI.vue +38 -0
- package/components/customProperties/FSMetaField.vue +31 -35
- package/components/customProperties/FSMetaHistory.vue +4 -4
- package/components/customProperties/FSMetaValue.vue +66 -33
- package/components/customProperties/helpers.ts +2 -1
- package/components/entities/FSBaseEntitiesList.vue +50 -0
- package/components/entities/FSDialogSelectEntities.vue +83 -0
- package/components/entities/FSEntityField.vue +203 -0
- package/components/entities/FSSelectEntitiesList.vue +209 -0
- package/components/entities/FSSimpleEntitiesList.vue +100 -0
- package/components/explorers/FSBaseDevicesExplorer.vue +310 -0
- package/components/explorers/FSBaseFoldersExplorer.vue +277 -0
- package/components/lists/FSDataTable.vue +23 -21
- package/components/lists/alerts/FSBaseAlertsList.vue +338 -0
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +101 -0
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +79 -0
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +205 -0
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +206 -0
- package/components/lists/charts/FSBaseChartsList.vue +268 -0
- package/components/lists/comments/FSBaseCommentsList.vue +143 -0
- package/components/lists/connectivityScenarios/FSBaseConnectivityScenariosList.vue +128 -0
- package/components/lists/dashboardOrganisationTypes/FSBaseDashboardOrganisationTypesList.vue +179 -0
- package/components/lists/dashboards/FSBaseDashboardsList.vue +235 -0
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +62 -0
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +155 -0
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +130 -0
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +378 -0
- package/components/lists/deviceOrganisations/FSSimpleDeviceOrganisationsList.vue +44 -0
- package/components/lists/folders/FSBaseFoldersList.vue +127 -0
- package/components/lists/folders/FSSimpleFoldersList.vue +44 -0
- package/components/lists/groups/FSBaseGroupsList.vue +136 -0
- package/components/lists/groups/FSSimpleGroupsList.vue +44 -0
- package/components/lists/locations/FSBaseLocationsList.vue +118 -0
- package/components/lists/locations/FSSimpleLocationsList.vue +44 -0
- package/components/lists/models/FSBaseModelsList.vue +155 -0
- package/components/lists/models/FSSimpleModelsList.vue +44 -0
- package/components/lists/reports/FSBaseReportExecutionsList.vue +137 -0
- package/components/lists/reports/FSBaseReportsList.vue +140 -0
- package/components/lists/roleOrganisationTypes/FSBaseRoleOrganisationTypesList.vue +128 -0
- package/components/lists/roleOrganisations/FSBaseRoleOrganisationsList.vue +128 -0
- package/components/lists/scenarioOrganisationTypes/FSBaseScenarioOrganisationTypesList.vue +157 -0
- package/components/lists/scenarioOrganisations/FSBaseScenarioOrganisationsList.vue +145 -0
- package/components/lists/scenarios/FSBaseScenariosList.vue +241 -0
- package/components/lists/serviceAccountOrganisations/FSBaseServiceAccountOrganisationsList.vue +155 -0
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +171 -0
- package/components/lists/userOrganisations/FSSimpleUserOrganisationsList.vue +45 -0
- package/components/tiles/FSChartTile.vue +70 -0
- package/components/tiles/FSDeviceOrganisationTile.vue +9 -2
- package/components/tiles/FSLocationTile.vue +66 -0
- package/components/treeviews/FSTreeViewFolder.vue +15 -3
- package/components/treeviews/FSTreeViewGroup.vue +22 -4
- package/package.json +9 -9
- package/utils/dashboards.ts +33 -5
- package/utils/index.ts +2 -2
- package/utils/permissions.ts +80 -0
- package/utils/roles.ts +4 -4
- package/utils/tables.ts +41 -0
- package/utils/users.ts +7 -4
- 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/FSSelectSelectedEntities.vue +0 -59
- package/components/selects/FSSerieTypeSelector.vue +0 -51
- package/utils/charts.ts +0 -136
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.chart', 'Chart')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -56,12 +57,12 @@
|
|
|
56
57
|
<script lang="ts">
|
|
57
58
|
import { computed, defineComponent, type PropType } from "vue";
|
|
58
59
|
|
|
59
|
-
import { type ChartOrganisationFilters,
|
|
60
|
+
import { type ChartOrganisationFilters, type ChartOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
60
61
|
import { useChartOrganisations, useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
62
|
+
import { chartOriginColor, chartOriginLabel } from "@dative-gpi/foundation-shared-components/tools";
|
|
61
63
|
import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
|
|
62
64
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
63
|
-
|
|
64
|
-
import { chartOriginColor, chartOriginLabel } from "../../utils";
|
|
65
|
+
import { ChartOrigin } from "@dative-gpi/foundation-shared-domain/enums";
|
|
65
66
|
|
|
66
67
|
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
67
68
|
import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue";
|
|
@@ -93,7 +94,7 @@ export default defineComponent({
|
|
|
93
94
|
default: null
|
|
94
95
|
},
|
|
95
96
|
type: {
|
|
96
|
-
type: Number as PropType<ChartOrigin>,
|
|
97
|
+
type: [Array, Number] as PropType<ChartOrigin[] | ChartOrigin>,
|
|
97
98
|
required: false,
|
|
98
99
|
default: ChartOrigin.None
|
|
99
100
|
},
|
|
@@ -116,9 +117,14 @@ export default defineComponent({
|
|
|
116
117
|
type: Boolean,
|
|
117
118
|
required: false,
|
|
118
119
|
default: false
|
|
120
|
+
},
|
|
121
|
+
label: {
|
|
122
|
+
type: String as PropType<string | null>,
|
|
123
|
+
required: false,
|
|
124
|
+
default: null
|
|
119
125
|
}
|
|
120
126
|
},
|
|
121
|
-
emits: ["update:modelValue", "update:type"],
|
|
127
|
+
emits: ["update", "update:modelValue", "update:type"],
|
|
122
128
|
setup(props, { emit }) {
|
|
123
129
|
const { getMany: getManyChartOrganisationTypes, fetching: fetchingChartOrganisationTypes, entities: chartOrganisationTypes } = useChartOrganisationTypes();
|
|
124
130
|
const { getMany: getManyChartOrganisations, fetching: fetchingChartOrganisations, entities: chartOrganisations } = useChartOrganisations();
|
|
@@ -144,19 +150,23 @@ export default defineComponent({
|
|
|
144
150
|
|
|
145
151
|
const placeholder = computed((): string | null => {
|
|
146
152
|
if (props.multiple && props.modelValue) {
|
|
147
|
-
return $tr("
|
|
153
|
+
return $tr("autocomplete.chart.placeholder", "{0} chart(s) selected", props.modelValue.length);
|
|
148
154
|
}
|
|
149
155
|
return null;
|
|
150
156
|
});
|
|
151
157
|
|
|
152
158
|
const update = (value: Chart[] | Chart | null) => {
|
|
153
159
|
if (Array.isArray(value)) {
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
const newModelValue = value.map(v => v.id);
|
|
161
|
+
const newType = value.map(v => v.type);
|
|
162
|
+
emit("update:modelValue", newModelValue);
|
|
163
|
+
emit("update:type", newType);
|
|
164
|
+
emit("update", { modelValue: newModelValue, type: newType });
|
|
156
165
|
}
|
|
157
166
|
else {
|
|
158
167
|
emit("update:modelValue", value?.id);
|
|
159
168
|
emit("update:type", value?.type);
|
|
169
|
+
emit("update", { modelValue: value?.id, type: value?.type });
|
|
160
170
|
}
|
|
161
171
|
};
|
|
162
172
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.dashboard', 'Dashboard')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -60,8 +61,8 @@ import { type DashboardOrganisationFilters, type DashboardOrganisationTypeFilter
|
|
|
60
61
|
import { useDashboardOrganisations, useDashboardOrganisationTypes, useDashboardShallows } from "@dative-gpi/foundation-core-services/composables";
|
|
61
62
|
import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
|
|
62
63
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
63
|
-
import { DashboardType } from "@dative-gpi/foundation-shared-domain/models";
|
|
64
64
|
|
|
65
|
+
import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
65
66
|
import { dashboardTypeColor, dashboardTypeLabel } from "../../utils";
|
|
66
67
|
|
|
67
68
|
import FSAutocompleteField from "@dative-gpi/foundation-shared-components/components/fields/FSAutocompleteField.vue";
|
|
@@ -100,7 +101,7 @@ export default defineComponent({
|
|
|
100
101
|
default: null
|
|
101
102
|
},
|
|
102
103
|
type: {
|
|
103
|
-
type: Number as PropType<DashboardType>,
|
|
104
|
+
type: [Array, Number] as PropType<DashboardType[] | DashboardType>,
|
|
104
105
|
required: false,
|
|
105
106
|
default: DashboardType.None
|
|
106
107
|
},
|
|
@@ -123,9 +124,14 @@ export default defineComponent({
|
|
|
123
124
|
type: Boolean,
|
|
124
125
|
required: false,
|
|
125
126
|
default: false
|
|
127
|
+
},
|
|
128
|
+
label: {
|
|
129
|
+
type: String as PropType<string | null>,
|
|
130
|
+
required: false,
|
|
131
|
+
default: null
|
|
126
132
|
}
|
|
127
133
|
},
|
|
128
|
-
emits: ["update:modelValue", "update:type"],
|
|
134
|
+
emits: ["update", "update:modelValue", "update:type"],
|
|
129
135
|
setup(props, { emit }) {
|
|
130
136
|
const { getMany: getManyDashboardOrganisationTypes, fetching: fetchingDashboardOrganisationTypes, entities: dashboardOrganisationTypes } = useDashboardOrganisationTypes();
|
|
131
137
|
const { getMany: getManyDashboardOrganisations, fetching: fetchingDashboardOrganisations, entities: dashboardOrganisations } = useDashboardOrganisations();
|
|
@@ -157,19 +163,23 @@ export default defineComponent({
|
|
|
157
163
|
|
|
158
164
|
const placeholder = computed((): string | null => {
|
|
159
165
|
if (props.multiple && props.modelValue) {
|
|
160
|
-
return $tr("
|
|
166
|
+
return $tr("autocomplete.dashboard.placeholder", "{0} dashboard(s) selected", props.modelValue.length);
|
|
161
167
|
}
|
|
162
168
|
return null;
|
|
163
169
|
});
|
|
164
170
|
|
|
165
171
|
const update = (value: Dashboard[] | Dashboard | null) => {
|
|
166
172
|
if (Array.isArray(value)) {
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
const newModelValue = value.map(v => v.id);
|
|
174
|
+
const newType = value.map(v => v.type);
|
|
175
|
+
emit("update:modelValue", newModelValue);
|
|
176
|
+
emit("update:type", newType);
|
|
177
|
+
emit("update", { modelValue: newModelValue, type: newType });
|
|
169
178
|
}
|
|
170
179
|
else {
|
|
171
180
|
emit("update:modelValue", value?.id);
|
|
172
181
|
emit("update:type", value?.type);
|
|
182
|
+
emit("update", { modelValue: value?.id, type: value?.type });
|
|
173
183
|
}
|
|
174
184
|
};
|
|
175
185
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.dashboard', 'Dashboard')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:items="dashboardOrganisations"
|
|
5
6
|
:multiple="$props.multiple"
|
|
@@ -59,6 +60,11 @@ export default defineComponent({
|
|
|
59
60
|
type: Boolean,
|
|
60
61
|
required: false,
|
|
61
62
|
default: false
|
|
63
|
+
},
|
|
64
|
+
label: {
|
|
65
|
+
type: String as PropType<string | null>,
|
|
66
|
+
required: false,
|
|
67
|
+
default: null
|
|
62
68
|
}
|
|
63
69
|
},
|
|
64
70
|
emits: ["update:modelValue"],
|
|
@@ -72,7 +78,7 @@ export default defineComponent({
|
|
|
72
78
|
|
|
73
79
|
const placeholder = computed((): string | null => {
|
|
74
80
|
if (props.multiple && props.modelValue) {
|
|
75
|
-
return $tr("
|
|
81
|
+
return $tr("autocomplete.dashboard.placeholder", "{0} dashboard(s) selected", props.modelValue.length);
|
|
76
82
|
}
|
|
77
83
|
return null;
|
|
78
84
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.data-category', 'Data category')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -15,13 +16,13 @@
|
|
|
15
16
|
<FSChip
|
|
16
17
|
v-if="item.correlated"
|
|
17
18
|
prependIcon="mdi-link"
|
|
18
|
-
:label="$tr('
|
|
19
|
+
:label="$tr('autocomplete.data-category.linked','Linked')"
|
|
19
20
|
:color="ColorEnum.Success"
|
|
20
21
|
/>
|
|
21
22
|
<FSChip
|
|
22
23
|
v-else
|
|
23
24
|
prependIcon="mdi-link-off"
|
|
24
|
-
:label="$tr('
|
|
25
|
+
:label="$tr('autocomplete.data-category.not-linked','Not linked')"
|
|
25
26
|
:color="ColorEnum.Warning"
|
|
26
27
|
/>
|
|
27
28
|
</template>
|
|
@@ -41,13 +42,13 @@
|
|
|
41
42
|
<FSChip
|
|
42
43
|
v-if="props.item.correlated"
|
|
43
44
|
prependIcon="mdi-link"
|
|
44
|
-
:label="$tr('
|
|
45
|
+
:label="$tr('autocomplete.data-category.linked','Linked')"
|
|
45
46
|
:color="ColorEnum.Success"
|
|
46
47
|
/>
|
|
47
48
|
<FSChip
|
|
48
49
|
v-else
|
|
49
50
|
prependIcon="mdi-link-off"
|
|
50
|
-
:label="$tr('
|
|
51
|
+
:label="$tr('autocomplete.data-category.not-linked','Not linked')"
|
|
51
52
|
:color="ColorEnum.Warning"
|
|
52
53
|
/>
|
|
53
54
|
</template>
|
|
@@ -96,6 +97,11 @@ export default defineComponent({
|
|
|
96
97
|
type: Boolean,
|
|
97
98
|
required: false,
|
|
98
99
|
default: false
|
|
100
|
+
},
|
|
101
|
+
label: {
|
|
102
|
+
type: String as PropType<string | null>,
|
|
103
|
+
required: false,
|
|
104
|
+
default: null
|
|
99
105
|
}
|
|
100
106
|
},
|
|
101
107
|
emits: ["update:modelValue"],
|
|
@@ -109,7 +115,7 @@ export default defineComponent({
|
|
|
109
115
|
|
|
110
116
|
const placeholder = computed((): string | null => {
|
|
111
117
|
if (props.multiple && props.modelValue) {
|
|
112
|
-
return $tr("
|
|
118
|
+
return $tr("autocomplete.data-category.placeholder", "{0} data category(ies) selected", props.modelValue.length);
|
|
113
119
|
}
|
|
114
120
|
return null;
|
|
115
121
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.data-definition', 'Data')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -79,6 +80,11 @@ export default defineComponent({
|
|
|
79
80
|
type: Boolean,
|
|
80
81
|
required: false,
|
|
81
82
|
default: false
|
|
83
|
+
},
|
|
84
|
+
label: {
|
|
85
|
+
type: String as PropType<string | null>,
|
|
86
|
+
required: false,
|
|
87
|
+
default: null
|
|
82
88
|
}
|
|
83
89
|
},
|
|
84
90
|
emits: ["update:modelValue"],
|
|
@@ -92,7 +98,7 @@ export default defineComponent({
|
|
|
92
98
|
|
|
93
99
|
const placeholder = computed((): string | null => {
|
|
94
100
|
if (props.multiple && props.modelValue) {
|
|
95
|
-
return $tr("
|
|
101
|
+
return $tr("autocomplete.data-definition.placeholder", "{0} data definition(s) selected", props.modelValue.length);
|
|
96
102
|
}
|
|
97
103
|
return null;
|
|
98
104
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.group', 'Group')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -58,6 +59,11 @@ export default defineComponent({
|
|
|
58
59
|
type: Boolean,
|
|
59
60
|
required: false,
|
|
60
61
|
default: false
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String as PropType<string | null>,
|
|
65
|
+
required: false,
|
|
66
|
+
default: null
|
|
61
67
|
}
|
|
62
68
|
},
|
|
63
69
|
emits: ["update:modelValue"],
|
|
@@ -71,7 +77,7 @@ export default defineComponent({
|
|
|
71
77
|
|
|
72
78
|
const placeholder = computed((): string | null => {
|
|
73
79
|
if (props.multiple && props.modelValue) {
|
|
74
|
-
return $tr("
|
|
80
|
+
return $tr("autocomplete.group.placeholder", "{0} group(s) selected", props.modelValue.length);
|
|
75
81
|
}
|
|
76
82
|
return null;
|
|
77
83
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.location', 'Location')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -58,6 +59,11 @@ export default defineComponent({
|
|
|
58
59
|
type: Boolean,
|
|
59
60
|
required: false,
|
|
60
61
|
default: false
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String as PropType<string | null>,
|
|
65
|
+
required: false,
|
|
66
|
+
default: null
|
|
61
67
|
}
|
|
62
68
|
},
|
|
63
69
|
emits: ["update:modelValue"],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.manufacturer', 'Manufacturer')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
height="26px"
|
|
18
19
|
width="26px"
|
|
19
20
|
:imageId="item.imageId"
|
|
21
|
+
:thumbnail="true"
|
|
20
22
|
/>
|
|
21
23
|
</template>
|
|
22
24
|
<template
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
height="26px"
|
|
39
41
|
width="26px"
|
|
40
42
|
:imageId="props.item.imageId"
|
|
43
|
+
:thumbnail="true"
|
|
41
44
|
/>
|
|
42
45
|
</template>
|
|
43
46
|
</FSButton>
|
|
@@ -84,6 +87,11 @@ export default defineComponent({
|
|
|
84
87
|
type: Boolean,
|
|
85
88
|
required: false,
|
|
86
89
|
default: false
|
|
90
|
+
},
|
|
91
|
+
label: {
|
|
92
|
+
type: String as PropType<string | null>,
|
|
93
|
+
required: false,
|
|
94
|
+
default: null
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
97
|
emits: ["update:modelValue"],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.model', 'Model')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
height="26px"
|
|
18
19
|
width="26px"
|
|
19
20
|
:imageId="item.imageId"
|
|
21
|
+
:thumbnail="true"
|
|
20
22
|
/>
|
|
21
23
|
</template>
|
|
22
24
|
<template
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
height="26px"
|
|
39
41
|
width="26px"
|
|
40
42
|
:imageId="props.item.imageId"
|
|
43
|
+
:thumbnail="true"
|
|
41
44
|
/>
|
|
42
45
|
</template>
|
|
43
46
|
</FSButton>
|
|
@@ -84,6 +87,11 @@ export default defineComponent({
|
|
|
84
87
|
type: Boolean,
|
|
85
88
|
required: false,
|
|
86
89
|
default: false
|
|
90
|
+
},
|
|
91
|
+
label: {
|
|
92
|
+
type: String as PropType<string | null>,
|
|
93
|
+
required: false,
|
|
94
|
+
default: null
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
97
|
emits: ["update:modelValue"],
|
|
@@ -97,7 +105,7 @@ export default defineComponent({
|
|
|
97
105
|
|
|
98
106
|
const placeholder = computed((): string | null => {
|
|
99
107
|
if (props.multiple && props.modelValue) {
|
|
100
|
-
return $tr("
|
|
108
|
+
return $tr("autocomplete.model.placeholder", "{0} model(s) selected", props.modelValue.length);
|
|
101
109
|
}
|
|
102
110
|
return null;
|
|
103
111
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.organisation-type', 'Organisation type')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -46,6 +47,11 @@ export default defineComponent({
|
|
|
46
47
|
type: Boolean,
|
|
47
48
|
required: false,
|
|
48
49
|
default: false
|
|
50
|
+
},
|
|
51
|
+
label: {
|
|
52
|
+
type: String as PropType<string | null>,
|
|
53
|
+
required: false,
|
|
54
|
+
default: null
|
|
49
55
|
}
|
|
50
56
|
},
|
|
51
57
|
emits: ["update:modelValue"],
|
|
@@ -59,7 +65,7 @@ export default defineComponent({
|
|
|
59
65
|
|
|
60
66
|
const placeholder = computed((): string | null => {
|
|
61
67
|
if (props.multiple && props.modelValue) {
|
|
62
|
-
return $tr("
|
|
68
|
+
return $tr("autocomplete.organisation-type.placeholder", "{0} organisation type(s) selected", props.modelValue.length);
|
|
63
69
|
}
|
|
64
70
|
return null;
|
|
65
71
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.role', 'Role')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:placeholder="placeholder"
|
|
@@ -56,10 +57,11 @@
|
|
|
56
57
|
<script lang="ts">
|
|
57
58
|
import { computed, defineComponent, type PropType } from "vue";
|
|
58
59
|
|
|
59
|
-
import { type RoleOrganisationFilters, type RoleOrganisationTypeFilters
|
|
60
|
+
import { type RoleOrganisationFilters, type RoleOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
60
61
|
import { useRoleOrganisations, useRoleOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
61
62
|
import { useAutocomplete } from "@dative-gpi/foundation-shared-components/composables";
|
|
62
63
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
64
|
+
import { RoleType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
63
65
|
|
|
64
66
|
import { roleTypeColor, roleTypeLabel } from "../../utils";
|
|
65
67
|
|
|
@@ -93,7 +95,7 @@ export default defineComponent({
|
|
|
93
95
|
default: null
|
|
94
96
|
},
|
|
95
97
|
type: {
|
|
96
|
-
type: Number as PropType<RoleType>,
|
|
98
|
+
type: [Array, Number] as PropType<RoleType[] | RoleType>,
|
|
97
99
|
required: false,
|
|
98
100
|
default: RoleType.None
|
|
99
101
|
},
|
|
@@ -116,9 +118,14 @@ export default defineComponent({
|
|
|
116
118
|
type: Boolean,
|
|
117
119
|
required: false,
|
|
118
120
|
default: false
|
|
121
|
+
},
|
|
122
|
+
label: {
|
|
123
|
+
type: String as PropType<string | null>,
|
|
124
|
+
required: false,
|
|
125
|
+
default: null
|
|
119
126
|
}
|
|
120
127
|
},
|
|
121
|
-
emits: ["update:modelValue", "update:type"],
|
|
128
|
+
emits: ["update", "update:modelValue", "update:type"],
|
|
122
129
|
setup(props, { emit }) {
|
|
123
130
|
const { getMany: getManyRoleOrganisationTypes, fetching: fetchingRoleOrganisationTypes, entities: roleOrganisationTypes } = useRoleOrganisationTypes();
|
|
124
131
|
const { getMany: getManyRoleOrganisations, fetching: fetchingRoleOrganisations, entities: roleOrganisations } = useRoleOrganisations();
|
|
@@ -144,19 +151,23 @@ export default defineComponent({
|
|
|
144
151
|
|
|
145
152
|
const placeholder = computed((): string | null => {
|
|
146
153
|
if (props.multiple && props.modelValue) {
|
|
147
|
-
return $tr("
|
|
154
|
+
return $tr("autocomplete.role.placeholder", "{0} role(s) selected", props.modelValue.length);
|
|
148
155
|
}
|
|
149
156
|
return null;
|
|
150
157
|
});
|
|
151
158
|
|
|
152
159
|
const update = (value: Role[] | Role | null) => {
|
|
153
160
|
if (Array.isArray(value)) {
|
|
154
|
-
|
|
155
|
-
|
|
161
|
+
const newModelValue = value.map(v => v.id);
|
|
162
|
+
const newType = value.map(v => v.type);
|
|
163
|
+
emit("update:modelValue", newModelValue);
|
|
164
|
+
emit("update:type", newType);
|
|
165
|
+
emit("update", { modelValue: newModelValue, type: newType });
|
|
156
166
|
}
|
|
157
167
|
else {
|
|
158
168
|
emit("update:modelValue", value?.id);
|
|
159
169
|
emit("update:type", value?.type);
|
|
170
|
+
emit("update", { modelValue: value?.id, type: value?.type });
|
|
160
171
|
}
|
|
161
172
|
};
|
|
162
173
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.service-account-role', 'Service account role')"
|
|
3
4
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
5
|
:items="serviceAccountRoleOrganisations"
|
|
5
6
|
:multiple="$props.multiple"
|
|
@@ -58,6 +59,11 @@ export default defineComponent({
|
|
|
58
59
|
type: Boolean,
|
|
59
60
|
required: false,
|
|
60
61
|
default: false
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String as PropType<string | null>,
|
|
65
|
+
required: false,
|
|
66
|
+
default: null
|
|
61
67
|
}
|
|
62
68
|
},
|
|
63
69
|
emits: ["update:modelValue"],
|
|
@@ -71,7 +77,7 @@ export default defineComponent({
|
|
|
71
77
|
|
|
72
78
|
const placeholder = computed((): string | null => {
|
|
73
79
|
if (props.multiple && props.modelValue) {
|
|
74
|
-
return $tr("
|
|
80
|
+
return $tr("autocomplete.service-account-role.placeholder", "{0} role(s) selected", props.modelValue.length);
|
|
75
81
|
}
|
|
76
82
|
return null;
|
|
77
83
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
3
|
itemTitle="name"
|
|
4
|
+
:label="$props.label ?? $tr('ui.common.user', 'User')"
|
|
4
5
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
5
6
|
:multiple="$props.multiple"
|
|
6
7
|
:placeholder="placeholder"
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
height="26px"
|
|
19
20
|
width="26px"
|
|
20
21
|
:imageId="item.imageId"
|
|
22
|
+
:thumbnail="true"
|
|
21
23
|
/>
|
|
22
24
|
</template>
|
|
23
25
|
<template
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
height="26px"
|
|
40
42
|
width="26px"
|
|
41
43
|
:imageId="props.item.imageId"
|
|
44
|
+
:thumbnail="true"
|
|
42
45
|
/>
|
|
43
46
|
</template>
|
|
44
47
|
</FSButton>
|
|
@@ -85,6 +88,11 @@ export default defineComponent({
|
|
|
85
88
|
type: Boolean,
|
|
86
89
|
required: false,
|
|
87
90
|
default: false
|
|
91
|
+
},
|
|
92
|
+
label: {
|
|
93
|
+
type: String as PropType<string | null>,
|
|
94
|
+
required: false,
|
|
95
|
+
default: null
|
|
88
96
|
}
|
|
89
97
|
},
|
|
90
98
|
emits: ["update:modelValue"],
|
|
@@ -98,7 +106,7 @@ export default defineComponent({
|
|
|
98
106
|
|
|
99
107
|
const placeholder = computed((): string | null => {
|
|
100
108
|
if (props.multiple && props.modelValue) {
|
|
101
|
-
return $tr("
|
|
109
|
+
return $tr("autocomplete.user.placeholder", "{0} user(s) selected", props.modelValue.length);
|
|
102
110
|
}
|
|
103
111
|
return null;
|
|
104
112
|
});
|
|
@@ -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
|
+
<FSChipGroupUserOrganisationUI
|
|
13
|
+
v-else
|
|
14
|
+
:userOrganisationLabels="userOrganisations.map(u => u.name)"
|
|
15
|
+
:wrapped="wrapped"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { defineComponent, watch, type PropType } from "vue";
|
|
21
|
+
|
|
22
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
23
|
+
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
24
|
+
|
|
25
|
+
import FSChipGroupUserOrganisationUI from "./FSChipGroupUserOrganisationUI.vue";
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: "FSChipGroupUserOrganisation",
|
|
29
|
+
components: {
|
|
30
|
+
FSChipGroupUserOrganisationUI
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
userOrganisationIds: {
|
|
34
|
+
type: Array as PropType<string[]>,
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
wrapped: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: false,
|
|
40
|
+
default: true
|
|
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,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
:wrap="wrapped"
|
|
4
|
+
>
|
|
5
|
+
<FSChip
|
|
6
|
+
v-for="(label, i) in $props.userOrganisationLabels"
|
|
7
|
+
:key="i"
|
|
8
|
+
:color="ColorEnum.Light"
|
|
9
|
+
:label="label"
|
|
10
|
+
/>
|
|
11
|
+
</FSRow>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { defineComponent, type PropType } from "vue";
|
|
16
|
+
|
|
17
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: "FSChipGroupUserOrganisationUI",
|
|
21
|
+
props: {
|
|
22
|
+
userOrganisationLabels: {
|
|
23
|
+
type: Array as PropType<string[]>,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
wrapped: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: false,
|
|
29
|
+
default: true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
setup() {
|
|
33
|
+
return {
|
|
34
|
+
ColorEnum
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
</script>
|