create Menu class for mapping AP response
This commit is contained in:
parent
e81b3bdc72
commit
5ec26ce0cf
|
@ -142,8 +142,8 @@ export class MenuComponent implements OnInit {
|
|||
this.subscriptions.push(
|
||||
this._helpContentService.getMenuItems(this.portal).subscribe(
|
||||
data => {
|
||||
this.featuredMenuItems = data['featuredMenuItems'];
|
||||
this.normalMenuItems = data['menuItems'];
|
||||
this.featuredMenuItems = data.featuredMenuItems;
|
||||
this.normalMenuItems = data.menuItems;
|
||||
this.getPages();
|
||||
this.showLoading = false;
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@ import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statis
|
|||
import {CustomOptions} from './servicesUtils/customOptions.class';
|
||||
import {catchError, map} from "rxjs/operators";
|
||||
import {properties} from "../../../environments/environment";
|
||||
import {MenuItem, MenuItemExtended} from '../sharedComponents/menu';
|
||||
import {Menu, MenuItem, MenuItemExtended} from '../sharedComponents/menu';
|
||||
|
||||
@Injectable()
|
||||
export class HelpContentService {
|
||||
|
@ -318,7 +318,7 @@ export class HelpContentService {
|
|||
// Menu Items
|
||||
|
||||
getMenuItems(portalPid: string) {
|
||||
return this.http.get<Array<MenuItemExtended>>(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/full")
|
||||
return this.http.get<Menu>(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/full")
|
||||
.pipe(catchError(this.handleError));
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,14 @@ export class MenuItemExtended extends MenuItem {
|
|||
parentItemId: string;
|
||||
}
|
||||
|
||||
export class Menu {
|
||||
portalPid: string;
|
||||
isFeaturedMenuEnabled: boolean;
|
||||
isMenuEnabled: boolean;
|
||||
featuredMenuItems: MenuItemExtended[] = [];
|
||||
menuItems: MenuItemExtended[] = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* */
|
||||
|
|
Loading…
Reference in New Issue