[Trunk | Monitor Dashboard]:
1. app.component: Add view and functionality for login/logout. 2. assets/monitor-custom.css: Class 'loginLink' added. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57865 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
a4fb0b928a
commit
517ebae463
|
@ -4,10 +4,25 @@
|
|||
<img class="badge small-badge right-badge"
|
||||
src="assets/theme-assets/prototype_flag.svg"
|
||||
alt="BETA">
|
||||
<div class="uk-light">
|
||||
<!-- uk-light-->
|
||||
<div class="">
|
||||
<nav class="uk-navbar">
|
||||
<a *ngIf="hasSidebar" id="sidebar_main_toggle" (click)="toggleOpen()" class="sSwitch sSwitch_left">
|
||||
<span class="sSwitchIcon"></span>
|
||||
</a>
|
||||
<div class="uk-navbar-right">
|
||||
<ul class="uk-navbar-nav user_actions uk-padding uk-padding-remove-vertical">
|
||||
<li>
|
||||
<user-mini *ngIf="properties"
|
||||
[user]="user" [dashboard]="true"
|
||||
[redirectUrl]="properties.afterLoginRedirectLink"
|
||||
[logInUrl]=properties.loginUrl [logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain
|
||||
[userMenuItems]=userMenuItems>
|
||||
</user-mini>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<router-outlet></router-outlet>
|
||||
|
|
|
@ -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, [], [], {}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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=",
|
||||
|
||||
|
|
|
@ -100,3 +100,8 @@
|
|||
.stakeholderPage #style_switcher{
|
||||
top:200px;
|
||||
}
|
||||
|
||||
.loginLink, .loginLink:hover{
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
Loading…
Reference in New Issue