@data-fair/lib-vuetify 1.9.1 → 1.10.0

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { type Session } from '@data-fair/lib-vue/session.js';
2
2
  import { VuetifyOptions } from 'vuetify';
3
- export declare function vuetifySessionOptions(session: Session): VuetifyOptions;
3
+ export declare function vuetifySessionOptions(session: Session, cspNonce?: string): VuetifyOptions;
4
4
  export declare function defaultOptions(searchParams: Record<string, string>, darkCookie?: boolean, locale?: string): VuetifyOptions;
package/index.js CHANGED
@@ -13,7 +13,7 @@ const baseDarkColors = {
13
13
  primary: '#2196F3', // blue.base
14
14
  success: '#00E676' // green.accent3
15
15
  }
16
- export function vuetifySessionOptions (session) {
16
+ export function vuetifySessionOptions (session, cspNonce) {
17
17
  if (!session.site.value) { throw new Error('vuetifySessionOptions requires fething site info in session util') }
18
18
  const colors = { ...baseColors, ...session.site.value?.colors }
19
19
  return {
@@ -23,6 +23,7 @@ export function vuetifySessionOptions (session) {
23
23
  messages: { fr, en }
24
24
  },
25
25
  theme: {
26
+ cspNonce,
26
27
  defaultTheme: session.theme.value ?? 'default',
27
28
  themes: {
28
29
  [session.theme.value ?? 'default']: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
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.1.0",
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
@@ -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>
@@ -210,9 +210,9 @@ const session = useSession()
210
210
  const { t } = useI18n({ useScope: 'local' })
211
211
  const { user, account } = 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
 
@@ -9,10 +9,10 @@ const session = useSession();
9
9
  const { t } = useI18n({ useScope: 'local' });
10
10
  const { user, account } = 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
  ;
@@ -180,7 +180,7 @@ function __VLS_template() {
180
180
  return;
181
181
  if (!((__VLS_ctx.user.organizations.length > 1 || (__VLS_ctx.user.organizations.length === 1 && (!__VLS_ctx.user.ipa || __VLS_ctx.account.type === 'user')))))
182
182
  return;
183
- __VLS_ctx.session.switchOrganization(organization.id, organization.department);
183
+ __VLS_ctx.session.switchOrganization(organization.id, organization.department, organization.role);
184
184
  }
185
185
  };
186
186
  let __VLS_99;
@@ -202,13 +202,14 @@ function __VLS_template() {
202
202
  (organization.name);
203
203
  __VLS_nonNullable(__VLS_115.slots).default;
204
204
  const __VLS_115 = __VLS_pickFunctionalComponentCtx(__VLS_110, __VLS_112);
205
- if (organization.department) {
205
+ if (organization.department || organization.roleLabel) {
206
206
  const __VLS_116 = __VLS_resolvedLocalAndGlobalComponents.VListItemSubtitle;
207
207
  /** @type { [typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, typeof __VLS_components.VListItemSubtitle, typeof __VLS_components.vListItemSubtitle, ] } */
208
208
  // @ts-ignore
209
209
  const __VLS_117 = __VLS_asFunctionalComponent(__VLS_116, new __VLS_116({}));
210
210
  const __VLS_118 = __VLS_117({}, ...__VLS_functionalComponentArgsRest(__VLS_117));
211
211
  (organization.departmentName || organization.department);
212
+ (organization.roleLabel);
212
213
  __VLS_nonNullable(__VLS_121.slots).default;
213
214
  const __VLS_121 = __VLS_pickFunctionalComponentCtx(__VLS_116, __VLS_118);
214
215
  }