aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-09-20 10:00:37 +0300
committerMichael Lando <ml636r@att.com>2018-09-20 10:06:59 +0000
commita9803eafa0afb76c0941e301798ceed98e0ed086 (patch)
tree52874400117dea121f48a4a27e2084665807eba8 /catalog-ui/src/app
parent2f6e78971e912d33b4b2b3013ebe12f2407630a1 (diff)
Fix wrong selected tab in top-nav
Fixed a bug with wrong selected tabs in the top-nav Change-Id: I0a4fdb2d62154207b60fee641bf28b7f971d2456 Issue-ID: SDC-1583 Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app')
-rw-r--r--catalog-ui/src/app/ng2/components/layout/top-nav/top-nav.component.ts6
1 files changed, 5 insertions, 1 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 881a91613d..a253b3a933 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
@@ -50,6 +50,7 @@ export class TopNavComponent {
public topLvlMenu:MenuItemGroup;
public user:IUserProperties;
+ private topNavPlugins: Array<Plugin>;
constructor(private translateService:TranslateService,
@Inject('$state') private $state:ng.ui.IStateService,
@@ -69,7 +70,7 @@ export class TopNavComponent {
this.topLvlMenu.menuItems.every((item:MenuItem, index:number)=> {
if (item.state === this.$state.current.name) {
if (this.$state.current.name === 'plugins') {
- const pluginIdx = _.findIndex(PluginsConfiguration.plugins, (plugin: Plugin) => plugin.pluginStateUrl === this.$state.params.path);
+ const pluginIdx = _.findIndex(this.topNavPlugins, (plugin: Plugin) => plugin.pluginStateUrl === this.$state.params.path);
if (pluginIdx !== -1) {
result = index + pluginIdx;
return false;
@@ -112,6 +113,9 @@ export class TopNavComponent {
ngOnInit() {
console.log('Nav is init!', this.menuModel);
this.user = this.userService.getLoggedinUser();
+ this.topNavPlugins = _.filter(PluginsConfiguration.plugins, (plugin: Plugin) => {
+ return plugin.pluginDisplayOptions["tab"] !== undefined;
+ });
this.translateService.languageChangedObservable.subscribe((lang) => {
let tmpArray: Array<MenuItem> = [