diff --git a/src/app/app.component.html b/src/app/app.component.html index 7597d54..97868ea 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,10 +4,25 @@ BETA -
- - - + +
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 0f475bf..ebd61a9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -10,11 +10,12 @@ import { import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; -import {User} from './openaireLibrary/login/utils/helper.class'; +import {Session, User} from './openaireLibrary/login/utils/helper.class'; import {UserManagementService} from "./openaireLibrary/services/user-management.service"; import {StakeholderService} from "./services/stakeholder.service"; import {Subscriber} from "rxjs"; import {LayoutService} from "./library/sharedComponents/sidebar/layout.service"; +import {MenuItem} from "./openaireLibrary/sharedComponents/menu"; @Component({ @@ -27,6 +28,7 @@ export class AppComponent implements OnInit, OnDestroy { loginCheck: boolean = false; hasSidebar: boolean = false; hasHeader: boolean = false; + userMenuItems: MenuItem[] = [new MenuItem("", "My profile", "", "", false, [], [], {})]; private subscriptions: any[] = []; constructor(private route: ActivatedRoute, @@ -72,6 +74,7 @@ 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"); console.log(error); @@ -98,4 +101,16 @@ export class AppComponent implements OnInit, OnDestroy { this.layoutService.setOpen(false); } } + + + buildMenu() { + 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, [], [], {})) + + } + if(this.user) { + this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); + } + } } diff --git a/src/assets/env-properties.json b/src/assets/env-properties.json index e7cb764..9ff715b 100644 --- a/src/assets/env-properties.json +++ b/src/assets/env-properties.json @@ -37,9 +37,9 @@ "piwikBaseUrl" :"https://analytics.openaire.eu/piwik.php?idsite=", "piwikSiteId" : "80", - "loginUrl" :"http://rudie.di.uoa.gr:8080/dnet-login/openid_connect_login", + "loginUrl" :"http://dl170.madgik.di.uoa.gr:8180/dnet-login/openid_connect_login", - "userInfoUrl" : "http://rudie.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=", + "userInfoUrl" : "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=", "logoutUrl" :"https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=", diff --git a/src/assets/monitor-custom.css b/src/assets/monitor-custom.css index 8676e83..e0dbe4a 100644 --- a/src/assets/monitor-custom.css +++ b/src/assets/monitor-custom.css @@ -100,3 +100,8 @@ .stakeholderPage #style_switcher{ top:200px; } + +.loginLink, .loginLink:hover{ + color: white; + font-weight: bold; +} \ No newline at end of file