@data-fair/lib-vuetify 1.9.2 → 1.10.1
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/package.json +2 -2
- package/personal-menu.vue +8 -8
- package/personal-menu.vue.js +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@data-fair/lib-vuetify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"type": "module",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@data-fair/lib-common-types": "^1.
|
|
26
|
+
"@data-fair/lib-common-types": "^1.10.4",
|
|
27
27
|
"@mdi/js": "^7.4.47"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/personal-menu.vue
CHANGED
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
<v-list-item-title>
|
|
50
50
|
{{ account.type === 'user' ? t('personalAccount') : account.name }}
|
|
51
51
|
</v-list-item-title>
|
|
52
|
-
<v-list-item-subtitle v-if="account.department">
|
|
53
|
-
{{ account.departmentName || account.department }}
|
|
52
|
+
<v-list-item-subtitle v-if="account.department || organization?.roleLabel">
|
|
53
|
+
{{ account.departmentName || account.department }} {{ organization?.roleLabel }}
|
|
54
54
|
</v-list-item-subtitle>
|
|
55
55
|
<v-list-item-subtitle>{{ user.name }}</v-list-item-subtitle>
|
|
56
56
|
</v-list-item>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
v-for="organization in switchableOrganizations"
|
|
103
103
|
:id="'toolbar-menu-switch-orga-' + organization.id"
|
|
104
104
|
:key="organization.id"
|
|
105
|
-
@click="session.switchOrganization(organization.id , organization.department)"
|
|
105
|
+
@click="session.switchOrganization(organization.id , organization.department, organization.role)"
|
|
106
106
|
>
|
|
107
107
|
<template #prepend>
|
|
108
108
|
<v-avatar
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
<v-list-item-title>
|
|
114
114
|
{{ organization.name }}
|
|
115
115
|
</v-list-item-title>
|
|
116
|
-
<v-list-item-subtitle v-if="organization.department">
|
|
117
|
-
{{ organization.departmentName || organization.department }}
|
|
116
|
+
<v-list-item-subtitle v-if="organization.department || organization.roleLabel">
|
|
117
|
+
{{ organization.departmentName || organization.department }} {{ organization.roleLabel }}
|
|
118
118
|
</v-list-item-subtitle>
|
|
119
119
|
</v-list-item>
|
|
120
120
|
</template>
|
|
@@ -208,11 +208,11 @@ import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline } from '@m
|
|
|
208
208
|
const session = useSession()
|
|
209
209
|
|
|
210
210
|
const { t } = useI18n({ useScope: 'local' })
|
|
211
|
-
const { user, account } = toRefs(session.state)
|
|
211
|
+
const { user, account, organization } = toRefs(session.state)
|
|
212
212
|
const switchableOrganizations = computed(() => {
|
|
213
|
-
const { user, account } = session.state
|
|
213
|
+
const { user, account, accountRole } = session.state
|
|
214
214
|
if (!user || !account) return
|
|
215
|
-
return user.organizations.filter(o => account.type === 'user' || account.id !== o.id || (account.department || null) !== (o.department || null))
|
|
215
|
+
return user.organizations.filter(o => account.type === 'user' || account.id !== o.id || (account.department || null) !== (o.department || null) || (accountRole || null) !== (o.role || null))
|
|
216
216
|
})
|
|
217
217
|
</script>
|
|
218
218
|
|
package/personal-menu.vue.js
CHANGED
|
@@ -7,12 +7,12 @@ import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline } from '@m
|
|
|
7
7
|
const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
|
|
8
8
|
const session = useSession();
|
|
9
9
|
const { t } = useI18n({ useScope: 'local' });
|
|
10
|
-
const { user, account } = toRefs(session.state);
|
|
10
|
+
const { user, account, organization } = toRefs(session.state);
|
|
11
11
|
const switchableOrganizations = computed(() => {
|
|
12
|
-
const { user, account } = session.state;
|
|
12
|
+
const { user, account, accountRole } = session.state;
|
|
13
13
|
if (!user || !account)
|
|
14
14
|
return;
|
|
15
|
-
return user.organizations.filter(o => account.type === 'user' || account.id !== o.id || (account.department || null) !== (o.department || null));
|
|
15
|
+
return user.organizations.filter(o => account.type === 'user' || account.id !== o.id || (account.department || null) !== (o.department || null) || (accountRole || null) !== (o.role || null));
|
|
16
16
|
});
|
|
17
17
|
const __VLS_fnComponent = (await import('vue')).defineComponent({});
|
|
18
18
|
;
|
|
@@ -104,13 +104,14 @@ function __VLS_template() {
|
|
|
104
104
|
(__VLS_ctx.account.type === 'user' ? __VLS_ctx.t('personalAccount') : __VLS_ctx.account.name);
|
|
105
105
|
__VLS_nonNullable(__VLS_57.slots).default;
|
|
106
106
|
const __VLS_57 = __VLS_pickFunctionalComponentCtx(__VLS_52, __VLS_54);
|
|
107
|
-
if (__VLS_ctx.account.department) {
|
|
107
|
+
if (__VLS_ctx.account.department || __VLS_ctx.organization?.roleLabel) {
|
|
108
108
|
const __VLS_58 = __VLS_resolvedLocalAndGlobalComponents.VListItemSubtitle;
|
|
109
109
|
/** @type { [typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, ] } */
|
|
110
110
|
// @ts-ignore
|
|
111
111
|
const __VLS_59 = __VLS_asFunctionalComponent(__VLS_58, new __VLS_58({}));
|
|
112
112
|
const __VLS_60 = __VLS_59({}, ...__VLS_functionalComponentArgsRest(__VLS_59));
|
|
113
113
|
(__VLS_ctx.account.departmentName || __VLS_ctx.account.department);
|
|
114
|
+
(__VLS_ctx.organization?.roleLabel);
|
|
114
115
|
__VLS_nonNullable(__VLS_63.slots).default;
|
|
115
116
|
const __VLS_63 = __VLS_pickFunctionalComponentCtx(__VLS_58, __VLS_60);
|
|
116
117
|
}
|
|
@@ -180,7 +181,7 @@ function __VLS_template() {
|
|
|
180
181
|
return;
|
|
181
182
|
if (!((__VLS_ctx.user.organizations.length > 1 || (__VLS_ctx.user.organizations.length === 1 && (!__VLS_ctx.user.ipa || __VLS_ctx.account.type === 'user')))))
|
|
182
183
|
return;
|
|
183
|
-
__VLS_ctx.session.switchOrganization(organization.id, organization.department);
|
|
184
|
+
__VLS_ctx.session.switchOrganization(organization.id, organization.department, organization.role);
|
|
184
185
|
}
|
|
185
186
|
};
|
|
186
187
|
let __VLS_99;
|
|
@@ -202,13 +203,14 @@ function __VLS_template() {
|
|
|
202
203
|
(organization.name);
|
|
203
204
|
__VLS_nonNullable(__VLS_115.slots).default;
|
|
204
205
|
const __VLS_115 = __VLS_pickFunctionalComponentCtx(__VLS_110, __VLS_112);
|
|
205
|
-
if (organization.department) {
|
|
206
|
+
if (organization.department || organization.roleLabel) {
|
|
206
207
|
const __VLS_116 = __VLS_resolvedLocalAndGlobalComponents.VListItemSubtitle;
|
|
207
208
|
/** @type { [typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, ] } */
|
|
208
209
|
// @ts-ignore
|
|
209
210
|
const __VLS_117 = __VLS_asFunctionalComponent(__VLS_116, new __VLS_116({}));
|
|
210
211
|
const __VLS_118 = __VLS_117({}, ...__VLS_functionalComponentArgsRest(__VLS_117));
|
|
211
212
|
(organization.departmentName || organization.department);
|
|
213
|
+
(organization.roleLabel);
|
|
212
214
|
__VLS_nonNullable(__VLS_121.slots).default;
|
|
213
215
|
const __VLS_121 = __VLS_pickFunctionalComponentCtx(__VLS_116, __VLS_118);
|
|
214
216
|
}
|
|
@@ -368,6 +370,7 @@ const __VLS_self = (await import('vue')).defineComponent({
|
|
|
368
370
|
t: t,
|
|
369
371
|
user: user,
|
|
370
372
|
account: account,
|
|
373
|
+
organization: organization,
|
|
371
374
|
switchableOrganizations: switchableOrganizations,
|
|
372
375
|
};
|
|
373
376
|
},
|