From 5e92fdf83bbdff652743f9c73be574023483be1f Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Wed, 2 Mar 2022 12:27:48 +0200 Subject: [PATCH] add featured menu items in the nav bar - dev only --- sharedComponents/navigationBar.component.html | 30 +++++++++++++++++-- sharedComponents/navigationBar.component.ts | 14 +++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 893bb754..9375da32 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -247,8 +247,9 @@ - - + + +
  • + + + +
    diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index be35cb3e..7dc6406c 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -51,7 +51,8 @@ export class NavigationBarComponent implements OnInit, OnDestroy { showPage = {}; specialAnnouncementContent: string = null; - public customMenuItems: MenuItem[] = []; + public additionalMenuItems: MenuItem[] = []; + public featuredMenuItems: MenuItem[] = []; constructor(private router: Router, private route: ActivatedRoute, @@ -109,7 +110,16 @@ export class NavigationBarComponent implements OnInit, OnDestroy { this.subs.push( this._helpContentService.getMenuItems(this.portal).subscribe( data => { - this.customMenuItems = data; + // Will divide all the custom menu items into 2 arrays. + // One for the extra(added next to the hardcoded menu items in the existing nav bar) - additionalMenuItems + // One for the featured(new nav bar below the existing one) - featuredMenuItems + data.forEach(menuItem => { + if(menuItem.isFeatured) { + this.featuredMenuItems.push(menuItem); + } else { + this.additionalMenuItems.push(menuItem); + } + }); }, error => this.handleError("Server error fetching custom menu items", error) )