display normal & featured menu on connect front-end based on show/hide boolean value

This commit is contained in:
Alex Martzios 2022-07-20 12:13:55 +03:00
parent 2c289af1e6
commit a79e9f6cc9
2 changed files with 7 additions and 3 deletions

View File

@ -180,7 +180,7 @@
</ng-container> </ng-container>
<!-- Custom menu items --> <!-- Custom menu items -->
<!-- TODO: Add to mobile menu as well! --> <!-- TODO: Add to mobile menu as well! -->
<ng-container *ngIf="additionalMenuItems?.length > 0 && properties.environment == 'development'"> <ng-container *ngIf="isMenuEnabled && additionalMenuItems?.length > 0">
<ng-container *ngFor="let menu of additionalMenuItems"> <ng-container *ngFor="let menu of additionalMenuItems">
<li class="uk-parent" [class.uk-active]="isTheActiveMenu(menu)"> <li class="uk-parent" [class.uk-active]="isTheActiveMenu(menu)">
<!-- INTERNAL ROOT--> <!-- INTERNAL ROOT-->
@ -235,8 +235,8 @@
</nav> </nav>
</div> </div>
</div> </div>
<!-- New navbar for featured menu items - test only --> <!-- New navbar for featured menu items only -->
<ng-container *ngIf="featuredMenuItems?.length > 0 && properties.environment == 'development'"> <ng-container *ngIf="isFeaturedMenuEnabled && featuredMenuItems?.length > 0">
<div class="uk-background-primary uk-light"> <div class="uk-background-primary uk-light">
<div class="uk-container uk-container-expand"> <div class="uk-container uk-container-expand">
<div class="uk-navbar" uk-navbar> <div class="uk-navbar" uk-navbar>

View File

@ -56,6 +56,8 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
public additionalMenuItems: MenuItem[] = []; public additionalMenuItems: MenuItem[] = [];
public featuredMenuItems: MenuItem[] = []; public featuredMenuItems: MenuItem[] = [];
public isMenuEnabled: boolean = false;
public isFeaturedMenuEnabled: boolean = false;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -119,6 +121,8 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
this.subs.push( this.subs.push(
this._helpContentService.getMenuItems(this.portal).subscribe( this._helpContentService.getMenuItems(this.portal).subscribe(
data => { data => {
this.isMenuEnabled = data.isMenuEnabled;
this.isFeaturedMenuEnabled = data.isFeaturedMenuEnabled;
this.featuredMenuItems = data.featuredMenuItems; this.featuredMenuItems = data.featuredMenuItems;
this.additionalMenuItems = data.menuItems; this.additionalMenuItems = data.menuItems;
}, },