@dative-gpi/foundation-core-components 1.1.13 → 1.1.14-fix-last
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/lists/chartOrganisationTypes/FSBaseChartOrganisationTypesList.vue +7 -6
- package/components/lists/chartOrganisations/FSBaseChartOrganisationsList.vue +7 -6
- package/components/lists/charts/FSBaseChartsList.vue +7 -14
- package/components/lists/userOrganisations/FSBaseUserOrganisationsList.vue +4 -6
- package/package.json +7 -7
- package/utils/users.ts +11 -1
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
</FSRow>
|
|
71
71
|
</template>
|
|
72
72
|
<template
|
|
73
|
-
#item.
|
|
73
|
+
#item.models="{ item }"
|
|
74
74
|
>
|
|
75
75
|
<FSTagGroup
|
|
76
76
|
variant="slide"
|
|
77
|
-
:tags="item.
|
|
77
|
+
:tags="item.models.map((d: any) => d.label)"
|
|
78
78
|
:showRemove="false"
|
|
79
79
|
/>
|
|
80
80
|
</template>
|
|
@@ -109,7 +109,8 @@ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
|
109
109
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
110
110
|
import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
|
|
111
111
|
|
|
112
|
-
import type {
|
|
112
|
+
import type { ModelInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
113
|
+
import type { ChartOrganisationTypeFilters, ChartOrganisationTypeInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
113
114
|
import { useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
114
115
|
|
|
115
116
|
import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
|
|
@@ -168,8 +169,8 @@ export default defineComponent({
|
|
|
168
169
|
const { entities: chartOrganisationTypes, fetching: fetchingChartOrganisationTypes, getMany: getManyChartOrganisationTypes } = useChartOrganisationTypes();
|
|
169
170
|
|
|
170
171
|
const headersOptions = computed(() => ({
|
|
171
|
-
|
|
172
|
-
fixedFilters: chartOrganisationTypes.value.map(c => c.
|
|
172
|
+
models: {
|
|
173
|
+
fixedFilters: chartOrganisationTypes.value.map(c => c.models).reduce((acc, models) => {
|
|
173
174
|
for (const m of models) {
|
|
174
175
|
if (!acc.map((m) => m.id).includes(m.id)) {
|
|
175
176
|
acc.push(m);
|
|
@@ -183,7 +184,7 @@ export default defineComponent({
|
|
|
183
184
|
value: '',
|
|
184
185
|
text: '--'
|
|
185
186
|
}),
|
|
186
|
-
methodFilter: (value: string, items:
|
|
187
|
+
methodFilter: (value: string, items: ModelInfos[]) => (items.length == 0 && value == '') || (items.length > 0 && items.some(ml => ml.id == value))
|
|
187
188
|
},
|
|
188
189
|
chartType: {
|
|
189
190
|
fixedFilters: getEnumEntries(ChartType).map(e => ({
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
/>
|
|
57
57
|
</template>
|
|
58
58
|
<template
|
|
59
|
-
#item.
|
|
59
|
+
#item.models="{ item }"
|
|
60
60
|
>
|
|
61
61
|
<FSTagGroup
|
|
62
62
|
variant="slide"
|
|
63
|
-
:tags="item.
|
|
63
|
+
:tags="item.models.map((d: any) => d.label)"
|
|
64
64
|
:showRemove="false"
|
|
65
65
|
/>
|
|
66
66
|
</template>
|
|
@@ -109,7 +109,8 @@ import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
|
109
109
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
110
110
|
import { chartTypeLabel, chartIcon } from "@dative-gpi/foundation-shared-components/tools";
|
|
111
111
|
|
|
112
|
-
import type {
|
|
112
|
+
import type { ModelInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
113
|
+
import type { ChartOrganisationFilters, ChartOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
113
114
|
import { useChartOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
114
115
|
|
|
115
116
|
import FSRow from "@dative-gpi/foundation-shared-components/components/FSRow.vue";
|
|
@@ -168,8 +169,8 @@ export default defineComponent({
|
|
|
168
169
|
const { entities: chartOrganisations, fetching: fetchingChartOrganisations, getMany: getManyChartOrganisations } = useChartOrganisations();
|
|
169
170
|
|
|
170
171
|
const headersOptions = computed(() => ({
|
|
171
|
-
|
|
172
|
-
fixedFilters: chartOrganisations.value.map(c => c.
|
|
172
|
+
models: {
|
|
173
|
+
fixedFilters: chartOrganisations.value.map(c => c.models).reduce((acc, models) => {
|
|
173
174
|
for (const m of models) {
|
|
174
175
|
if (!acc.map((m) => m.id).includes(m.id)) {
|
|
175
176
|
acc.push(m);
|
|
@@ -183,7 +184,7 @@ export default defineComponent({
|
|
|
183
184
|
value: '',
|
|
184
185
|
text: '--'
|
|
185
186
|
}),
|
|
186
|
-
methodFilter: (value: string, items:
|
|
187
|
+
methodFilter: (value: string, items: ModelInfos[]) => (items.length == 0 && value == '') || (items.length > 0 && items.some(ml => ml.id == value))
|
|
187
188
|
},
|
|
188
189
|
chartType: {
|
|
189
190
|
fixedFilters: getEnumEntries(ChartType).map(e => ({
|
|
@@ -68,14 +68,6 @@
|
|
|
68
68
|
</FSText>
|
|
69
69
|
</FSRow>
|
|
70
70
|
</template>
|
|
71
|
-
<template
|
|
72
|
-
#item.modelsLabels="{ item }"
|
|
73
|
-
>
|
|
74
|
-
<FSTagGroup
|
|
75
|
-
:showRemove="false"
|
|
76
|
-
:tags="item.modelsLabels.map((d: any) => d.label)"
|
|
77
|
-
/>
|
|
78
|
-
</template>
|
|
79
71
|
<template
|
|
80
72
|
#item.scope="{ item }"
|
|
81
73
|
>
|
|
@@ -113,7 +105,8 @@ import { ChartOrigin, ChartType } from "@dative-gpi/foundation-shared-domain/enu
|
|
|
113
105
|
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
114
106
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
115
107
|
|
|
116
|
-
import type {
|
|
108
|
+
import type { ModelInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
109
|
+
import type { ChartOrganisationFilters, ChartOrganisationTypeFilters } from "@dative-gpi/foundation-core-domain/models";
|
|
117
110
|
import { useChartOrganisations, useChartOrganisationTypes } from "@dative-gpi/foundation-core-services/composables";
|
|
118
111
|
|
|
119
112
|
import FSChartTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSChartTileUI.vue";
|
|
@@ -199,7 +192,7 @@ export default defineComponent({
|
|
|
199
192
|
tags: c.tags,
|
|
200
193
|
multiple: c.multiple,
|
|
201
194
|
chartType: c.chartType,
|
|
202
|
-
|
|
195
|
+
models: c.models
|
|
203
196
|
})).concat(chartOrganisationTypes.value.map(c => ({
|
|
204
197
|
id: c.id,
|
|
205
198
|
imageId: c.imageId,
|
|
@@ -214,13 +207,13 @@ export default defineComponent({
|
|
|
214
207
|
tags: c.tags,
|
|
215
208
|
multiple: c.multiple,
|
|
216
209
|
chartType: c.chartType,
|
|
217
|
-
|
|
210
|
+
models: c.models
|
|
218
211
|
})));
|
|
219
212
|
});
|
|
220
213
|
|
|
221
214
|
const headersOptions = computed(() => ({
|
|
222
|
-
|
|
223
|
-
fixedFilters: chartOrganisationTypes.value.map(c => c.
|
|
215
|
+
models: {
|
|
216
|
+
fixedFilters: chartOrganisationTypes.value.map(c => c.models).reduce((acc, models) => {
|
|
224
217
|
for(const m of models){
|
|
225
218
|
if(!acc.map((m) => m.id).includes(m.id)){
|
|
226
219
|
acc.push(m);
|
|
@@ -234,7 +227,7 @@ export default defineComponent({
|
|
|
234
227
|
value: '',
|
|
235
228
|
text: '--'
|
|
236
229
|
}),
|
|
237
|
-
methodFilter: (value: string, items:
|
|
230
|
+
methodFilter: (value: string, items: ModelInfos[]) => (items.length == 0 && value == '') || (items.length > 0 && items.some(ml => ml.id == value))
|
|
238
231
|
},
|
|
239
232
|
chartType: {
|
|
240
233
|
fixedFilters: getEnumEntries(ChartType).map(e => ({
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
<FSSpan
|
|
91
91
|
font="text-overline"
|
|
92
92
|
>
|
|
93
|
-
{{
|
|
93
|
+
{{ formatLastActivity(item.lastActivity) }}
|
|
94
94
|
</FSSpan>
|
|
95
95
|
</template>
|
|
96
96
|
<template
|
|
@@ -114,9 +114,8 @@ import { type RouteLocation } from "vue-router";
|
|
|
114
114
|
import _ from "lodash";
|
|
115
115
|
|
|
116
116
|
import type { UserOrganisationFilters, UserOrganisationInfos } from "@dative-gpi/foundation-core-domain/models";
|
|
117
|
-
import { userTypeLabel, userValidityLabel } from "@dative-gpi/foundation-core-components/utils";
|
|
117
|
+
import { userTypeLabel, userValidityLabel,formatLastActivity } from "@dative-gpi/foundation-core-components/utils";
|
|
118
118
|
import { useUserOrganisations } from "@dative-gpi/foundation-core-services/composables";
|
|
119
|
-
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
120
119
|
|
|
121
120
|
import FSDataTable from "../FSDataTable.vue";
|
|
122
121
|
|
|
@@ -166,7 +165,6 @@ export default defineComponent({
|
|
|
166
165
|
emits: ["update:modelValue"],
|
|
167
166
|
setup(props) {
|
|
168
167
|
const { getMany: fetchUserOrganisations, entities: userOrganisations, fetching: fetchingUserOrganisations } = useUserOrganisations();
|
|
169
|
-
const { epochToShortTimeFormat } = useDateFormat();
|
|
170
168
|
|
|
171
169
|
const isSelected = (id: string): boolean => {
|
|
172
170
|
return props.modelValue.includes(id);
|
|
@@ -181,10 +179,10 @@ export default defineComponent({
|
|
|
181
179
|
return {
|
|
182
180
|
fetchingUserOrganisations,
|
|
183
181
|
userOrganisations,
|
|
184
|
-
epochToShortTimeFormat,
|
|
185
182
|
userValidityLabel,
|
|
186
183
|
userTypeLabel,
|
|
187
|
-
isSelected
|
|
184
|
+
isSelected,
|
|
185
|
+
formatLastActivity
|
|
188
186
|
};
|
|
189
187
|
}
|
|
190
188
|
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
|
|
5
5
|
},
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"version": "1.1.
|
|
7
|
+
"version": "1.1.14-fix-last",
|
|
8
8
|
"description": "",
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dative-gpi/foundation-core-domain": "1.1.
|
|
17
|
-
"@dative-gpi/foundation-core-services": "1.1.
|
|
18
|
-
"@dative-gpi/foundation-shared-components": "1.1.
|
|
19
|
-
"@dative-gpi/foundation-shared-domain": "1.1.
|
|
20
|
-
"@dative-gpi/foundation-shared-services": "1.1.
|
|
16
|
+
"@dative-gpi/foundation-core-domain": "1.1.14-fix-last",
|
|
17
|
+
"@dative-gpi/foundation-core-services": "1.1.14-fix-last",
|
|
18
|
+
"@dative-gpi/foundation-shared-components": "1.1.14-fix-last",
|
|
19
|
+
"@dative-gpi/foundation-shared-domain": "1.1.14-fix-last",
|
|
20
|
+
"@dative-gpi/foundation-shared-services": "1.1.14-fix-last"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"sass": "1.71.1",
|
|
30
30
|
"sass-loader": "13.3.2"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0e133d0134125e2b5981b29204dbe6627b221ea9"
|
|
33
33
|
}
|
package/utils/users.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
1
2
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
3
|
import { UserType, UserValidityState } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
4
|
|
|
4
5
|
const { $tr } = useTranslationsProvider();
|
|
6
|
+
const { epochToShortTimeFormat } = useDateFormat();
|
|
5
7
|
|
|
6
8
|
export const userTypeLabel = (type: UserType): string => {
|
|
7
9
|
switch (type) {
|
|
@@ -29,4 +31,12 @@ export const userValidityLabel = (validity: UserValidityState): string => {
|
|
|
29
31
|
case UserValidityState.AccountValidated: return $tr("ui.user-validity.account-validated", "Validated");
|
|
30
32
|
default: return "";
|
|
31
33
|
}
|
|
32
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const formatLastActivity = (value?: string | null): string => {
|
|
37
|
+
if (!value) {
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
const timestamp = new Date(value).getTime();
|
|
41
|
+
return epochToShortTimeFormat(timestamp);
|
|
42
|
+
};
|