diff --git a/src/app/app.component.ts b/src/app/app.component.ts index db7a185..34ad4c5 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -43,7 +43,7 @@ export class AppComponent implements OnInit, OnDestroy { stickyAnimation: false }; - userMenuItems: MenuItem[] = [new MenuItem("", "My profile", "", "", false, [], [], {})]; + userMenuItems: MenuItem[] = []; adminMenuItems: MenuItem[] = []; stakeholder: Stakeholder = null; activeTopic: Topic = null; @@ -212,12 +212,12 @@ export class AppComponent implements OnInit, OnDestroy { this.menuItems = []; this.adminMenuItems = []; this.userMenuItems = []; - if (this.isAdmin()) { - this.userMenuItems.push(new MenuItem("", "Manage profiles", - "", "/admin", true, [], [], {})) - } if (this.user) { this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); + if (this.isCurator()) { + this.userMenuItems.push(new MenuItem("", "Manage profiles", + "", "/admin", false, [], [], {})); + } } if (this.stakeholder) { if (this.isFrontPage) { @@ -231,7 +231,7 @@ export class AppComponent implements OnInit, OnDestroy { badge: false, stickyAnimation: false }; - if (this.isAdmin()) { + if (this.isCurator()) { this.menuItems.push({ rootItem: new MenuItem("manage", "Manage", "", "/admin", false, [], null, {}), items: [] @@ -263,13 +263,6 @@ export class AppComponent implements OnInit, OnDestroy { this.specialSideBarMenuItem.icon = '
'; // ''; this.specialSideBarMenuItem.customClass = 'uk-text-uppercase uk-text-bold uk-text-secondary'; } - this.userMenuItems = []; - /* if (Session.isPortalAdministrator(this.user)) { - this.userMenuItems.push(new MenuItem("", "Manage helptexts", - "", "/helptexts", true, [], [], {communityId:'openaire'})) - - }*/ - } else { if (this.isFrontPage || !this.hasAdminMenu) { this.menuHeader = { @@ -282,8 +275,18 @@ export class AppComponent implements OnInit, OnDestroy { badge: true, stickyAnimation: false }; - //TODO monitor menu items? - + this.menuItems.push({ + rootItem: new MenuItem("about", "About", + "https://" + (this.properties.environment == 'beta' ? 'beta.' : '') + 'monitor.openaire.eu/about/learn-how', "", false, [], null, {}), items: [] + }); + this.menuItems.push({ + rootItem: new MenuItem("browse", "Browse", + "https://" + (this.properties.environment == 'beta' ? 'beta.' : '') + 'monitor.openaire.eu/browse', "", false, [], null, {}), items: [] + }); + this.menuItems.push({ + rootItem: new MenuItem("contact", "Contact us", + "https://" + (this.properties.environment == 'beta' ? 'beta.' : '') + 'monitor.openaire.eu/contact-us', "", false, [], null, {}), items: [] + }); } else { this.menuHeader = { route: "/", @@ -315,9 +318,11 @@ export class AppComponent implements OnInit, OnDestroy { } } - - public isAdmin() { - return this.user && (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || (this.stakeholder && Session.isManager(this.stakeholder.type, this.stakeholder.alias, this.user))); + public isCurator() { + return this.user && (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || Session.isKindOfMonitorManager(this.user)); + } + public isManager(stakeholder:Stakeholder) { + return this.user && (Session.isPortalAdministrator(this.user) || Session.isCurator(stakeholder.type, this.user) || Session.isManager(stakeholder.type, stakeholder.alias, this.user)); } private resolvePageInner() { @@ -341,7 +346,7 @@ export class AppComponent implements OnInit, OnDestroy { } else { if (this.isViewPublic) { // preview for not members return false; - } else if (this.isAdmin()) { + } else if (this.isManager(this.stakeholder)) { // if user is member, return true return true; } diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts index 6226468..697af0b 100644 --- a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts +++ b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts @@ -16,7 +16,7 @@ declare var UIkit; @Component({ selector: 'edit-stakeholder', template: ` -