use new API response for getting the menu items
This commit is contained in:
parent
5ec26ce0cf
commit
13a3590559
|
@ -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);
|
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.subs.push(
|
||||||
this._helpContentService.getMenuItems(this.portal).subscribe(
|
this._helpContentService.getMenuItems(this.portal).subscribe(
|
||||||
data => {
|
data => {
|
||||||
// Will divide all the custom menu items into 2 arrays.
|
this.featuredMenuItems = data.featuredMenuItems;
|
||||||
// One for the extra(added next to the hardcoded menu items in the existing nav bar) - additionalMenuItems
|
this.additionalMenuItems = data.menuItems;
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
error => this.handleError("Server error fetching custom menu items", error)
|
error => this.handleError("Server error fetching custom menu items", error)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue