use new API response for getting the menu items

This commit is contained in:
Alex Martzios 2022-07-15 13:43:11 +03:00
parent 5ec26ce0cf
commit 13a3590559
1 changed files with 3 additions and 12 deletions

View File

@ -115,21 +115,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
this.handleError('Error getting community information (e.g. pages,entities) for community with id: ' + this.communityId, error);
}));
}
if(this.properties.environment == "development" && this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') {
if(this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') {
this.subs.push(
this._helpContentService.getMenuItems(this.portal).subscribe(
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 {
// disable additional menu items for now
// this.additionalMenuItems.push(menuItem);
}
});
this.featuredMenuItems = data.featuredMenuItems;
this.additionalMenuItems = data.menuItems;
},
error => this.handleError("Server error fetching custom menu items", error)
)