Browse Source

Merge branch 'hotfix/fix-0903'

Vincent GUFFON 3 years ago
parent
commit
108ac4d3b4

+ 1 - 1
composables/layout/Menus/accountMenu.ts

@@ -90,7 +90,7 @@ class AccountMenu extends BaseMenu implements Menu {
     }
 
     const accountMenu = this.constructMenu('my_account', {
-      avatarId: this.$store.state.profile.access.avatarId,
+      avatarId: this.$store.state.profile.access.avatarId ?? true,
       avatarByDefault: this.$store.state.profile.access.gender == 'MISTER' ? 'men-1.png' : 'women-1.png'
     }, undefined, undefined, children, false)
 

+ 1 - 1
composables/layout/Menus/myAccessesMenu.ts

@@ -31,7 +31,7 @@ class MyAccessesMenu extends BaseMenu implements Menu {
     const children: ItemsMenu = []
 
     _.each(this.$store.state.profile.access.multiAccesses, (access) => {
-      children.push(this.constructMenu(access.organizationName, undefined, '/switch/' + access.organizationId, true))
+      children.push(this.constructMenu(access.name, undefined, '/switch/' + access.id, true))
     })
 
     return children.length > 0 ? this.constructMenu('multiAccesses', {name: 'fa-building'}, undefined, undefined, children) : null

+ 1 - 1
composables/layout/Menus/myFamilyMenu.ts

@@ -34,7 +34,7 @@ class MyFamilyMenu extends BaseMenu implements Menu {
     _.each(this.$store.state.profile.access.familyAccesses, (access) => {
       const url = `/switch_user/${this.$store.state.profile.organization.id}/${this.$store.state.profile.access.id}/${access.id}`
       children.push(this.constructMenu(`${access.givenName} ${access.name}`, {
-        avatarId: access.avatarId,
+        avatarId: access.avatarId ?? true,
         avatarByDefault: access.gender == 'MISTER' ? 'men-1.png' : 'women-1.png'
       }, url, true))
     })

+ 4 - 0
pages/subscription.vue

@@ -274,6 +274,10 @@ import { ApiResponse, DolibarrAccount } from '~/types/interfaces'
 
 export default defineComponent({
   name: 'Subscription',
+  middleware({ $ability, redirect }) {
+    if(!$ability.can('display', 'subscription_page'))
+      return redirect('/error')
+  },
   setup () {
     const { store, $dataProvider } = useContext()
     const organizationProfile = ref($organizationProfile(store))