[Admin | Trunk]: Create header for navigation bar

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@59586 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-10-14 09:54:49 +00:00
parent 02f4f7d59a
commit e518c99b53
2 changed files with 30 additions and 5 deletions

View File

@ -1,4 +1,5 @@
<navbar *ngIf="properties && showMenu" portal="connect-admin" logoPath="assets/imgs/" [onlyTop]="false" <navbar *ngIf="properties && showMenu" portal="connect-admin" logoPath="assets/imgs/" [onlyTop]="false"
[header]="header"
[userMenu]="true" [userMenu]="true"
[homeurl]="false" [user]="user" [userMenuItems]="userMenuItems" [menuItems]="menuItems" [homeurl]="false" [user]="user" [userMenuItems]="userMenuItems" [menuItems]="menuItems"
[properties]="properties" [properties]="properties"

View File

@ -12,6 +12,7 @@ import {Session, User} from './openaireLibrary/login/utils/helper.class';
import {HelperFunctions} from './openaireLibrary/utils/HelperFunctions.class'; import {HelperFunctions} from './openaireLibrary/utils/HelperFunctions.class';
import {UserManagementService} from './openaireLibrary/services/user-management.service'; import {UserManagementService} from './openaireLibrary/services/user-management.service';
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper"; import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
import {Header} from './openaireLibrary/sharedComponents/navigationBar.component';
declare var UIkit: any; declare var UIkit: any;
@ -37,6 +38,8 @@ export class AppComponent implements OnInit {
wellcome = false; wellcome = false;
showMenu: boolean = false; showMenu: boolean = false;
user: User; user: User;
logoPath: string = 'assets/common-assets/';
header: Header;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private propertiesService: EnvironmentSpecificService, private propertiesService: EnvironmentSpecificService,
@ -46,11 +49,7 @@ export class AppComponent implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart) { if (event instanceof NavigationStart) {
HelperFunctions.scroll(); HelperFunctions.scroll();
if (event.url === '/') { this.wellcome = event.url === '/';
this.wellcome = true;
} else {
this.wellcome = false;
}
} }
}); });
} }
@ -110,6 +109,14 @@ export class AppComponent implements OnInit {
name: (com.shortTitle) ? com.shortTitle : com.title, name: (com.shortTitle) ? com.shortTitle : com.title,
logoUrl: com.logoUrl logoUrl: com.logoUrl
}; };
this.header = {
url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
title: this.community.name,
logoUrl: this.community.logoUrl,
logoSmallUrl: this.community.logoUrl,
position: 'left',
badge: true
};
this.communityType = com.type; this.communityType = com.type;
this.menuItems = [ this.menuItems = [
{ {
@ -123,6 +130,14 @@ export class AppComponent implements OnInit {
name: (communities[index_managerOfCommunity].shortTitle) ? communities[index_managerOfCommunity].shortTitle : com.title, name: (communities[index_managerOfCommunity].shortTitle) ? communities[index_managerOfCommunity].shortTitle : com.title,
logoUrl: communities[index_managerOfCommunity].logoUrl logoUrl: communities[index_managerOfCommunity].logoUrl
}; };
this.header = {
url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
title: this.community.name,
logoUrl: this.community.logoUrl,
logoSmallUrl: this.community.logoUrl,
position: 'left',
badge: true
};
this.menuItems = [ this.menuItems = [
{ {
rootItem: new MenuItem('dashboard', 'Overview', '/dashboard', '/dashboard', false, [], null, {communityId: communities[index_managerOfCommunity].communityId}), rootItem: new MenuItem('dashboard', 'Overview', '/dashboard', '/dashboard', false, [], null, {communityId: communities[index_managerOfCommunity].communityId}),
@ -132,6 +147,15 @@ export class AppComponent implements OnInit {
} }
} }
if (!this.communityId || this.communityId === '') { if (!this.communityId || this.communityId === '') {
this.header = {
route: "/",
url: null,
title: 'connect-admin',
logoUrl: this.logoPath + 'logo-large-connect.png',
logoSmallUrl:this.logoPath + 'logo-small-connect.png',
position:'left',
badge:true
};
this.community = null; this.community = null;
} }
if (this.communityId) { if (this.communityId) {