diff options
author | 2018-01-31 18:57:31 +0200 | |
---|---|---|
committer | 2018-02-01 08:15:25 +0000 | |
commit | 162f50777e13eebe3b27ec8364ee892be628f7b0 (patch) | |
tree | ebce6947b372a61827745e9985eef0ac3f144af2 /catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts | |
parent | 3c9f4df71b978e92a6eeb6f22bc7535e749d11c2 (diff) |
Align configuration for new design
Aligned the designers configuration according to the new design addition and changes
Change-Id: Id08942b5a8adbac10bbe76bdd8a2a6f093ec8b46
Issue-ID: SDC-975
Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts index 5e43fec680..b8b0e80861 100644 --- a/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts +++ b/catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts @@ -120,14 +120,15 @@ export class TopNavComponent { tmpArray.push(new MenuItem(hostedApp.navTitle, null, hostedApp.defaultState, "goToState", null, null)); } }); - - _.each(PluginsConfiguration.plugins, (plugin: Plugin) => { - if (plugin.pluginDisplayOptions["top"]) { - tmpArray.push(new MenuItem(plugin.pluginDisplayOptions["top"].displayName, null, "plugins", "goToState", {path: plugin.pluginStateUrl}, null)); - } - }) } + // Adding plugins to top-nav only if they can be displayed for the current connected user role + _.each(PluginsConfiguration.plugins, (plugin: Plugin) => { + if (plugin.pluginDisplayOptions["tab"] && (this.user && plugin.pluginDisplayOptions["tab"].displayRoles.includes(this.user.role))) { + tmpArray.push(new MenuItem(plugin.pluginDisplayOptions["tab"].displayName, null, "plugins", "goToState", {path: plugin.pluginStateUrl}, null)); + } + }); + this.topLvlMenu = new MenuItemGroup(0, tmpArray, true); this.topLvlMenu.selectedIndex = isNaN(this.topLvlSelectedIndex) ? this._getTopLvlSelectedIndexByState() : this.topLvlSelectedIndex; |