Skip to content

Commit

Permalink
Merge pull request #558 from AudiovisualMetadataPlatform/AMP-3554_dro…
Browse files Browse the repository at this point in the history
…pdown-items

Fix populating dropdown nav items on page load
  • Loading branch information
yingfeng-iu authored Dec 25, 2024
2 parents 60277e2 + d712923 commit 57783b8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/components/navigation/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@
<b-nav-item
:id="menu.url"
@click.prevent="routeTo(menu)"
:class="{
'd-none': resolvePermissions(menu.permissionKey)
}"
v-if="!menu.children && menu.url !== '/mgm-evaluation'"
>
<span v-html="menu.icon"></span>
<span class="pl-2 menu-name">{{ menu.name }}</span>
</b-nav-item>
<b-nav-item-dropdown
:class="{
'd-none': resolvePermissions(menu.permissionKey)
}"
v-else
>
<template #button-content>
Expand Down Expand Up @@ -107,7 +101,18 @@ export default {
acActions: sync("acActions"),
orderedMenuList() {
let self = this;
return this.sharedService.sortByNumber(self.menuList, "displayId");
// Update menu list based on user permissions when acIsAdmin is updated
if(!self.acIsAdmin) {
if(self.acActions.length > 0) {
// Filter menu list based on user permissions when acActions is updated
let filteredMenus = self.menuList.filter(menu => {
return !self.resolvePermissions(menu.permissionKey);
});
return self.sharedService.sortByNumber(filteredMenus, "displayId")
}
} else {
return self.sharedService.sortByNumber(self.menuList, "displayId");
}
},
},
methods: {
Expand Down

0 comments on commit 57783b8

Please sign in to comment.