[Monitor Dashboard | Trunk]: Reset user menu items before build
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57884 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
d7a84cb3aa
commit
5da23e9673
|
@ -17,7 +17,6 @@ import {MenuItem} from "./openaireLibrary/sharedComponents/menu";
|
|||
export class AppComponent implements OnInit, OnDestroy {
|
||||
properties: EnvProperties;
|
||||
user: User;
|
||||
loginCheck: boolean = false;
|
||||
hasSidebar: boolean = false;
|
||||
hasHeader: boolean = false;
|
||||
userMenuItems: MenuItem[] = [new MenuItem("", "My profile", "", "", false, [], [], {})];
|
||||
|
@ -65,7 +64,6 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
}));
|
||||
this.subscriptions.push(this.userManagementService.getUserInfo(this.properties.userInfoUrl).subscribe(user => {
|
||||
this.user = user;
|
||||
this.loginCheck = true;
|
||||
this.buildMenu();
|
||||
}, error => {
|
||||
console.log("App couldn't fetch properties");
|
||||
|
@ -96,6 +94,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
|
||||
|
||||
buildMenu() {
|
||||
this.userMenuItems = [];
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire", "", true, [], [], {}))
|
||||
|
|
|
@ -360,6 +360,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
|||
}
|
||||
|
||||
buildMenu() {
|
||||
this.userMenuItems = [];
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire", "", true, [], [], {}))
|
||||
|
|
Loading…
Reference in New Issue