[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
master
k.triantafyllou 4 years ago
parent 02f4f7d59a
commit e518c99b53

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

@ -12,6 +12,7 @@ import {Session, User} from './openaireLibrary/login/utils/helper.class';
import {HelperFunctions} from './openaireLibrary/utils/HelperFunctions.class';
import {UserManagementService} from './openaireLibrary/services/user-management.service';
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
import {Header} from './openaireLibrary/sharedComponents/navigationBar.component';
declare var UIkit: any;
@ -37,6 +38,8 @@ export class AppComponent implements OnInit {
wellcome = false;
showMenu: boolean = false;
user: User;
logoPath: string = 'assets/common-assets/';
header: Header;
constructor(private route: ActivatedRoute,
private propertiesService: EnvironmentSpecificService,
@ -46,11 +49,7 @@ export class AppComponent implements OnInit {
this.router.events.forEach((event) => {
if (event instanceof NavigationStart) {
HelperFunctions.scroll();
if (event.url === '/') {
this.wellcome = true;
} else {
this.wellcome = false;
}
this.wellcome = event.url === '/';
}
});
}
@ -110,6 +109,14 @@ export class AppComponent implements OnInit {
name: (com.shortTitle) ? com.shortTitle : com.title,
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.menuItems = [
{
@ -123,6 +130,14 @@ export class AppComponent implements OnInit {
name: (communities[index_managerOfCommunity].shortTitle) ? communities[index_managerOfCommunity].shortTitle : com.title,
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 = [
{
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 === '') {
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;
}
if (this.communityId) {

Loading…
Cancel
Save