@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.
- package/components/autocompletes/FSAutocompleteChart.vue +60 -58
- package/components/autocompletes/FSAutocompleteDashboard.vue +59 -56
- package/components/autocompletes/FSAutocompleteDashboardOrganisation.vue +30 -39
- package/components/autocompletes/FSAutocompleteDataCategory.vue +52 -38
- package/components/autocompletes/FSAutocompleteDataDefinition.vue +25 -39
- package/components/autocompletes/FSAutocompleteGroup.vue +23 -38
- package/components/autocompletes/FSAutocompleteLocation.vue +23 -38
- package/components/autocompletes/FSAutocompleteManufacturer.vue +65 -2
- package/components/autocompletes/FSAutocompleteModel.vue +66 -3
- package/components/autocompletes/FSAutocompleteOrganisationType.vue +23 -0
- package/components/autocompletes/FSAutocompleteRole.vue +59 -56
- package/components/autocompletes/FSAutocompleteServiceAccountRoleOrganisation.vue +105 -0
- package/components/autocompletes/FSAutocompleteUserOrganisation.vue +32 -57
- 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 +265 -0
- package/components/lists/FSDataTable.vue +23 -21
- package/components/lists/alerts/FSBaseAlertsList.vue +337 -0
- package/components/lists/alerts/FSButtonAcknowledgeAlert.vue +101 -0
- package/components/lists/authTokens/FSBaseAuthTokensList.vue +79 -0
- package/components/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +204 -0
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +205 -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 +168 -0
- package/components/lists/dashboards/FSBaseDashboardsList.vue +227 -0
- package/components/lists/dashboards/FSSimpleDashboardsList.vue +63 -0
- package/components/lists/dataCategories/FSBaseDataCategoriesList.vue +154 -0
- package/components/lists/dataDefinitions/FSBaseDataDefinitionsList.vue +129 -0
- package/components/lists/deviceOrganisations/FSBaseDeviceOrganisationsList.vue +327 -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/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 +156 -0
- package/components/lists/serviceAccountRoleOrganisations/FSBaseServiceAccountRoleOrganisationsList.vue +128 -0
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +172 -0
- package/components/lists/userOrganisations/FSSimpleUserOrganisationsList.vue +45 -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/FSDataCategorySelector.vue +0 -62
- package/components/selects/FSDataDefinitionSelector.vue +0 -66
- package/components/selects/FSDisplayAsSelector.vue +0 -52
- package/components/selects/FSFilterTypeSelector.vue +0 -53
- package/components/selects/FSHeatmapRuleSelector.vue +0 -52
- package/components/selects/FSModelSelector.vue +0 -56
- 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
|
@@ -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>
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDataTable
|
|
3
|
+
defaultMode="iterator"
|
|
4
|
+
:items="userOrganisations"
|
|
5
|
+
:itemTo="$props.itemTo"
|
|
6
|
+
:loading="fetchingUserOrganisations"
|
|
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.allowEmails="{ item }"
|
|
42
|
+
>
|
|
43
|
+
<FSIconCheck
|
|
44
|
+
:value="item.allowEmails"
|
|
45
|
+
/>
|
|
46
|
+
</template>
|
|
47
|
+
<template
|
|
48
|
+
#item.allowSms="{ item }"
|
|
49
|
+
>
|
|
50
|
+
<FSIconCheck
|
|
51
|
+
:value="item.allowSms"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
<template
|
|
55
|
+
#item.tags="{ item }"
|
|
56
|
+
>
|
|
57
|
+
<FSTagGroup
|
|
58
|
+
variant="slide"
|
|
59
|
+
:editable="false"
|
|
60
|
+
:tags="item.tags"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
63
|
+
<template
|
|
64
|
+
#item.validity="{ item }"
|
|
65
|
+
>
|
|
66
|
+
<FSSpan
|
|
67
|
+
font="text-overline"
|
|
68
|
+
>
|
|
69
|
+
{{ userValidityLabel(item.validity) }}
|
|
70
|
+
</FSSpan>
|
|
71
|
+
</template>
|
|
72
|
+
<template
|
|
73
|
+
#item.userType="{ item }"
|
|
74
|
+
>
|
|
75
|
+
<FSSpan
|
|
76
|
+
font="text-overline"
|
|
77
|
+
>
|
|
78
|
+
{{ userTypeLabel(item.userType) }}
|
|
79
|
+
</FSSpan>
|
|
80
|
+
</template>
|
|
81
|
+
<template
|
|
82
|
+
#item.tile="{ item, toggleSelect }"
|
|
83
|
+
>
|
|
84
|
+
<FSUserOrganisationTileUI
|
|
85
|
+
:to="$props.itemTo && $props.itemTo(item)"
|
|
86
|
+
:editable="$props.editable"
|
|
87
|
+
:modelValue="isSelected(item.id)"
|
|
88
|
+
@update:modelValue="toggleSelect(item)"
|
|
89
|
+
v-bind="item"
|
|
90
|
+
/>
|
|
91
|
+
</template>
|
|
92
|
+
</FSDataTable>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<script lang="ts">
|
|
96
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
97
|
+
import { type RouteLocation } from "vue-router";
|
|
98
|
+
import _ from "lodash";
|
|
99
|
+
|
|
100
|
+
import type { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
101
|
+
import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
102
|
+
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
103
|
+
|
|
104
|
+
import FSDataTable from "../FSDataTable.vue";
|
|
105
|
+
|
|
106
|
+
import FSSpan from "@dative-gpi/foundation-shared-components/components/FSSpan.vue";
|
|
107
|
+
import FSImage from "@dative-gpi/foundation-shared-components/components/FSImage.vue";
|
|
108
|
+
import FSTagGroup from "@dative-gpi/foundation-shared-components/components/FSTagGroup.vue";
|
|
109
|
+
import FSIconCheck from "@dative-gpi/foundation-shared-components/components/FSIconCheck.vue";
|
|
110
|
+
import FSUserOrganisationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSUserOrganisationTileUI.vue";
|
|
111
|
+
|
|
112
|
+
export default defineComponent({
|
|
113
|
+
name: "FSBaseUserOrganisationsList",
|
|
114
|
+
components: {
|
|
115
|
+
FSDataTable,
|
|
116
|
+
FSImage,
|
|
117
|
+
FSUserOrganisationTileUI,
|
|
118
|
+
FSSpan,
|
|
119
|
+
FSTagGroup,
|
|
120
|
+
FSIconCheck
|
|
121
|
+
|
|
122
|
+
},
|
|
123
|
+
props: {
|
|
124
|
+
tableCode: {
|
|
125
|
+
type: String as PropType<string | null>,
|
|
126
|
+
required: false,
|
|
127
|
+
default: null
|
|
128
|
+
},
|
|
129
|
+
userOrganisationsFilters: {
|
|
130
|
+
type: Object as PropType<UserOrganisationFilters | null>,
|
|
131
|
+
required: false,
|
|
132
|
+
default: null
|
|
133
|
+
},
|
|
134
|
+
itemTo: {
|
|
135
|
+
type: Function as PropType<(item: UserOrganisationInfos) => Partial<RouteLocation>>,
|
|
136
|
+
required: false
|
|
137
|
+
},
|
|
138
|
+
editable: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
required: false,
|
|
141
|
+
default: true
|
|
142
|
+
},
|
|
143
|
+
modelValue: {
|
|
144
|
+
type: Array as PropType<string[]>,
|
|
145
|
+
required: false,
|
|
146
|
+
default: () => []
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
emits: ["update:modelValue"],
|
|
150
|
+
setup(props) {
|
|
151
|
+
const { getMany: fetchUserOrganisations, entities: userOrganisations, fetching: fetchingUserOrganisations } = useUserOrganisations();
|
|
152
|
+
|
|
153
|
+
const isSelected = (id: string): boolean => {
|
|
154
|
+
return props.modelValue.includes(id);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
watch(() => props.userOrganisationsFilters, (next, previous) => {
|
|
158
|
+
if ((!next && !previous) || !_.isEqual(next, previous)) {
|
|
159
|
+
fetchUserOrganisations(props.userOrganisationsFilters ?? undefined);
|
|
160
|
+
}
|
|
161
|
+
}, { immediate: true });
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
fetchingUserOrganisations,
|
|
165
|
+
userOrganisations,
|
|
166
|
+
userValidityLabel,
|
|
167
|
+
userTypeLabel,
|
|
168
|
+
isSelected
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSimpleList
|
|
3
|
+
:items="userOrganisations"
|
|
4
|
+
itemLabel="name"
|
|
5
|
+
:loading="fetching"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { defineComponent, type PropType, watch } from "vue";
|
|
12
|
+
|
|
13
|
+
import type { UserOrganisationFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
14
|
+
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
15
|
+
|
|
16
|
+
import FSSimpleList from "@dative-gpi/foundation-shared-components/components/lists/FSSimpleList.vue";
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: "FSSimpleUserOrganisationsList",
|
|
20
|
+
components: {
|
|
21
|
+
FSSimpleList,
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
userOrganisationFilters: {
|
|
25
|
+
type: Object as PropType<UserOrganisationFilters>,
|
|
26
|
+
required: false,
|
|
27
|
+
default: () => ({})
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(props){
|
|
31
|
+
const { entities: userOrganisations, getMany, fetching } = useUserOrganisations();
|
|
32
|
+
|
|
33
|
+
const fetch = () => {
|
|
34
|
+
getMany(props.userOrganisationFilters);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
watch(() => props.userOrganisationFilters, fetch, { immediate: true });
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
userOrganisations,
|
|
41
|
+
fetching
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
v-if="getting"
|
|
4
4
|
:editable="$props.editable"
|
|
5
5
|
:modelValue="$props.modelValue"
|
|
6
|
-
@update:modelValue="
|
|
6
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
7
|
/>
|
|
8
8
|
<FSDeviceOrganisationTileUI
|
|
9
9
|
v-else-if="entity"
|
|
@@ -16,8 +16,9 @@
|
|
|
16
16
|
:modelStatuses="entity.modelStatuses"
|
|
17
17
|
:deviceStatuses="entity.status?.statuses"
|
|
18
18
|
:editable="$props.editable"
|
|
19
|
+
:alertTo="$props.alertTo"
|
|
19
20
|
:modelValue="$props.modelValue"
|
|
20
|
-
@update:modelValue="
|
|
21
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
21
22
|
v-bind="$attrs"
|
|
22
23
|
/>
|
|
23
24
|
</template>
|
|
@@ -50,8 +51,14 @@ export default defineComponent({
|
|
|
50
51
|
type: Boolean,
|
|
51
52
|
required: false,
|
|
52
53
|
default: true
|
|
54
|
+
},
|
|
55
|
+
alertTo: {
|
|
56
|
+
type: Function,
|
|
57
|
+
required: false,
|
|
58
|
+
default: null
|
|
53
59
|
}
|
|
54
60
|
},
|
|
61
|
+
emits: ["update:modelValue"],
|
|
55
62
|
setup(props) {
|
|
56
63
|
const { get, getting, entity } = useDeviceOrganisation();
|
|
57
64
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSLoadTile
|
|
3
|
+
v-if="getting"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
:modelValue="modelValue"
|
|
6
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
7
|
+
/>
|
|
8
|
+
<FSLocationTileUI
|
|
9
|
+
v-else-if="entity"
|
|
10
|
+
:icon="entity.icon"
|
|
11
|
+
:label="entity.label"
|
|
12
|
+
:code="entity.code"
|
|
13
|
+
:color="entity.color"
|
|
14
|
+
:address="entity.address.placeLabel"
|
|
15
|
+
:deviceCount="entity.deviceOrganisationsCount"
|
|
16
|
+
:editable="$props.editable"
|
|
17
|
+
:modelValue="modelValue"
|
|
18
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
19
|
+
v-bind="$attrs"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { defineComponent, watch } from "vue";
|
|
25
|
+
|
|
26
|
+
import { useLocation } from "@dative-gpi/foundation-core-services/composables";
|
|
27
|
+
|
|
28
|
+
import FSLocationTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSLocationTileUI.vue";
|
|
29
|
+
import FSLoadTile from "@dative-gpi/foundation-shared-components/components/tiles/FSLoadTile.vue";
|
|
30
|
+
|
|
31
|
+
export default defineComponent({
|
|
32
|
+
name: "FSLocationTile",
|
|
33
|
+
components: {
|
|
34
|
+
FSLocationTileUI,
|
|
35
|
+
FSLoadTile
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
locationId: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
required: false,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
editable: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false,
|
|
50
|
+
default: true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(props) {
|
|
54
|
+
const { get, getting, entity } = useLocation();
|
|
55
|
+
|
|
56
|
+
watch(() => props.locationId, () => {
|
|
57
|
+
get(props.locationId);
|
|
58
|
+
}, { immediate: true });
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
getting,
|
|
62
|
+
entity
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
|
-
import { defineComponent, type PropType } from "vue";
|
|
23
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
24
24
|
|
|
25
|
+
import { type FolderFilters, type FolderInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
25
26
|
import { useTreeView } from "@dative-gpi/foundation-shared-components/composables";
|
|
26
|
-
import { type FolderFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
27
27
|
import { useFolders } from "@dative-gpi/foundation-core-services/composables";
|
|
28
28
|
|
|
29
29
|
import FSTreeViewField from "@dative-gpi/foundation-shared-components/components/fields/FSTreeViewField.vue";
|
|
@@ -41,6 +41,11 @@ export default defineComponent({
|
|
|
41
41
|
required: false,
|
|
42
42
|
default: null
|
|
43
43
|
},
|
|
44
|
+
exclude: {
|
|
45
|
+
type: String as PropType<string | null>,
|
|
46
|
+
required: false,
|
|
47
|
+
default: null
|
|
48
|
+
},
|
|
44
49
|
modelValue: {
|
|
45
50
|
type: [Array, String] as PropType<string[] | string | null>,
|
|
46
51
|
required: false,
|
|
@@ -54,7 +59,14 @@ export default defineComponent({
|
|
|
54
59
|
},
|
|
55
60
|
emits: ["update:modelValue"],
|
|
56
61
|
setup(props, { emit }) {
|
|
57
|
-
const { getMany: getManyFolders, fetching: fetchingFolders, entities
|
|
62
|
+
const { getMany: getManyFolders, fetching: fetchingFolders, entities } = useFolders();
|
|
63
|
+
|
|
64
|
+
const folders = computed((): FolderInfos[] => {
|
|
65
|
+
if (!props.exclude) {
|
|
66
|
+
return entities.value;
|
|
67
|
+
}
|
|
68
|
+
return entities.value.filter(g => g.id !== props.exclude && !g.path.some(p => p.id === props.exclude));
|
|
69
|
+
});
|
|
58
70
|
|
|
59
71
|
const fetch = () => {
|
|
60
72
|
return getManyFolders({ ...props.folderFilters });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTreeViewField
|
|
3
|
+
:label="$props.label ?? $tr('ui.common.group', 'Group')"
|
|
3
4
|
:multiple="$props.multiple"
|
|
4
5
|
:loading="fetchingGroups"
|
|
5
6
|
:items="groups"
|
|
@@ -20,10 +21,10 @@
|
|
|
20
21
|
</template>
|
|
21
22
|
|
|
22
23
|
<script lang="ts">
|
|
23
|
-
import { defineComponent, type PropType } from "vue";
|
|
24
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
24
25
|
|
|
26
|
+
import { type GroupFilters, type GroupInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
25
27
|
import { useTreeView } from "@dative-gpi/foundation-shared-components/composables";
|
|
26
|
-
import { type GroupFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
27
28
|
import { useGroups } from "@dative-gpi/foundation-core-services/composables";
|
|
28
29
|
|
|
29
30
|
import FSTreeViewField from "@dative-gpi/foundation-shared-components/components/fields/FSTreeViewField.vue";
|
|
@@ -41,6 +42,11 @@ export default defineComponent({
|
|
|
41
42
|
required: false,
|
|
42
43
|
default: null
|
|
43
44
|
},
|
|
45
|
+
exclude: {
|
|
46
|
+
type: String as PropType<string | null>,
|
|
47
|
+
required: false,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
44
50
|
modelValue: {
|
|
45
51
|
type: [Array, String] as PropType<string[] | string | null>,
|
|
46
52
|
required: false,
|
|
@@ -50,11 +56,23 @@ export default defineComponent({
|
|
|
50
56
|
type: Boolean,
|
|
51
57
|
required: false,
|
|
52
58
|
default: false
|
|
53
|
-
}
|
|
59
|
+
},
|
|
60
|
+
label: {
|
|
61
|
+
type: String as PropType<string | null>,
|
|
62
|
+
required: false,
|
|
63
|
+
default: null
|
|
64
|
+
}
|
|
54
65
|
},
|
|
55
66
|
emits: ["update:modelValue"],
|
|
56
67
|
setup(props, { emit }) {
|
|
57
|
-
const { getMany: getManyGroups, fetching: fetchingGroups, entities
|
|
68
|
+
const { getMany: getManyGroups, fetching: fetchingGroups, entities } = useGroups();
|
|
69
|
+
|
|
70
|
+
const groups = computed((): GroupInfos[] => {
|
|
71
|
+
if (!props.exclude) {
|
|
72
|
+
return entities.value;
|
|
73
|
+
}
|
|
74
|
+
return entities.value.filter(g => g.id !== props.exclude && !g.path.some(p => p.id === props.exclude));
|
|
75
|
+
});
|
|
58
76
|
|
|
59
77
|
const fetch = () => {
|
|
60
78
|
return getManyGroups({ ...props.groupFilters });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.28-remove-deprecated2",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-core-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-core-services": "1.0.
|
|
15
|
-
"@dative-gpi/foundation-shared-components": "1.0.
|
|
16
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
17
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-core-domain": "1.0.28-remove-deprecated2",
|
|
14
|
+
"@dative-gpi/foundation-core-services": "1.0.28-remove-deprecated2",
|
|
15
|
+
"@dative-gpi/foundation-shared-components": "1.0.28-remove-deprecated2",
|
|
16
|
+
"@dative-gpi/foundation-shared-domain": "1.0.28-remove-deprecated2",
|
|
17
|
+
"@dative-gpi/foundation-shared-services": "1.0.28-remove-deprecated2"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@dative-gpi/bones-ui": "^0.0
|
|
20
|
+
"@dative-gpi/bones-ui": "^1.0.0",
|
|
21
21
|
"color": "^4.2.3",
|
|
22
|
-
"vue": "^3.4.
|
|
22
|
+
"vue": "^3.4.38"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/color": "3.0.6",
|
|
26
26
|
"sass": "1.71.1",
|
|
27
27
|
"sass-loader": "13.3.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "65c182fd697939a07ad87c683a2f4c2fb765a7c7"
|
|
30
30
|
}
|
package/utils/dashboards.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { DashboardOrganisationInfos, DashboardOrganisationTypeInfos, DashboardShallowInfos, FolderInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
1
2
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
3
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
3
|
-
import { DashboardType } from "@dative-gpi/foundation-shared-domain/
|
|
4
|
+
import { DashboardType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
4
5
|
|
|
5
6
|
const { $tr } = useTranslationsProvider();
|
|
6
7
|
|
|
7
8
|
export const dashboardTypeLabel = (type: DashboardType): string => {
|
|
8
9
|
switch (type) {
|
|
9
|
-
case DashboardType.None: return $tr("ui.
|
|
10
|
+
case DashboardType.None: return $tr("ui.common.none", "None");
|
|
10
11
|
case DashboardType.Organisation:
|
|
11
|
-
case DashboardType.Shallow: return $tr("ui.
|
|
12
|
-
case DashboardType.OrganisationType: return $tr("ui.
|
|
12
|
+
case DashboardType.Shallow: return $tr("ui.common.custom", "Custom");
|
|
13
|
+
case DashboardType.OrganisationType: return $tr("ui.common.shared", "Shared");
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -20,4 +21,31 @@ export const dashboardTypeColor = (type: DashboardType): ColorBase => {
|
|
|
20
21
|
case DashboardType.Shallow: return ColorEnum.Primary;
|
|
21
22
|
case DashboardType.OrganisationType: return ColorEnum.Warning;
|
|
22
23
|
}
|
|
23
|
-
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export interface DashboardShallowListItem extends DashboardShallowInfos {
|
|
27
|
+
dashboardType: DashboardType.Shallow
|
|
28
|
+
type: FoldersListType.Dashboard
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DashboardOrganisationListItem extends DashboardOrganisationInfos {
|
|
32
|
+
dashboardType: DashboardType.Organisation
|
|
33
|
+
type: FoldersListType.Dashboard
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface OrganisationTypeDashboardListItem extends DashboardOrganisationTypeInfos {
|
|
37
|
+
dashboardType: DashboardType.OrganisationType
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface FolderListItem extends FolderInfos {
|
|
41
|
+
dashboardType: DashboardType.None
|
|
42
|
+
type: FoldersListType.Folder
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum FoldersListType {
|
|
46
|
+
Dashboard = "dashboard",
|
|
47
|
+
Folder = "folder"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type DashboardsListItem = DashboardShallowListItem | DashboardOrganisationListItem | OrganisationTypeDashboardListItem;
|
|
51
|
+
export type FoldersListItem = DashboardShallowListItem | DashboardOrganisationListItem | FolderListItem;
|
package/utils/index.ts
CHANGED