[Connect | Trunk]: Create header for navigation bar on app component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59589 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
f4c21720f8
commit
e5455314df
|
@ -12,6 +12,7 @@ import {HelperFunctions} from "./openaireLibrary/utils/HelperFunctions.class";
|
|||
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
|
||||
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
|
||||
import {properties} from '../environments/environment';
|
||||
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
|
||||
|
||||
@Component({
|
||||
//changeDetection: ChangeDetectionStrategy.Default,
|
||||
|
@ -21,13 +22,13 @@ import {properties} from '../environments/environment';
|
|||
`],
|
||||
template: `
|
||||
<div [class]="(community)?(community.id +'App communityApp'):'connectApp'">
|
||||
<navbar *ngIf="properties && showMenu && !community" [portal]="properties.dashboard" [onlyTop]=false
|
||||
[userMenuItems]=userMenuItems [menuItems]=menuItems [user]="user"
|
||||
<navbar *ngIf="properties && showMenu && !community && header" [portal]="properties.dashboard" [onlyTop]=false
|
||||
[userMenuItems]=userMenuItems [menuItems]=menuItems [user]="user" [header]="header"
|
||||
[showMenu]=showMenu [properties]="properties" [showHomeMenuItem]="false" communityId="connect"></navbar>
|
||||
<navbar *ngIf="properties && showMenu && community" [portal]="properties.dashboard" [onlyTop]=false
|
||||
[communityId]="community.id"
|
||||
<navbar *ngIf="properties && showMenu && community && header" [portal]="properties.dashboard" [onlyTop]=false
|
||||
[communityId]="community.id" [header]="header"
|
||||
[userMenuItems]=userMenuItems [menuItems]=menuItems [user]="user"
|
||||
[community]=community [showMenu]=showMenu [properties]="properties" [enableSearch]="false"
|
||||
[showMenu]=showMenu [properties]="properties" [enableSearch]="false"
|
||||
searchRoute="/search/find/research-outcomes"
|
||||
[showHomeMenuItem]="false"></navbar>
|
||||
<customization *ngIf="properties && communityId && communityId.length > 0" [properties]="properties"
|
||||
|
@ -89,7 +90,8 @@ export class AppComponent {
|
|||
managerOfCommunities = false;
|
||||
user: User;
|
||||
communityId: string = "";
|
||||
|
||||
header: Header;
|
||||
logoPath: string = 'assets/common-assets/';
|
||||
// community: {id:string, name:string, logoUrl:string};
|
||||
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
||||
private _communitiesService: CommunitiesService, private _subscribeService: SubscribeService,
|
||||
|
@ -188,8 +190,16 @@ export class AppComponent {
|
|||
logoUrl: community.logoUrl,
|
||||
description:community.description
|
||||
};
|
||||
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
|
||||
};
|
||||
console.log(this.header);
|
||||
this.menuItems = [];
|
||||
|
||||
this.menuItems.push({
|
||||
rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], this.properties.environment != "development" ? {} : {communityId: community.communityId}),
|
||||
items: []
|
||||
|
@ -235,6 +245,15 @@ export class AppComponent {
|
|||
|
||||
}
|
||||
if (community == null) {
|
||||
this.header = {
|
||||
route: "/",
|
||||
url: null,
|
||||
title: 'connect',
|
||||
logoUrl: this.logoPath + 'logo-large-connect.png',
|
||||
logoSmallUrl:this.logoPath + 'logo-small-connect.png',
|
||||
position:'left',
|
||||
badge:true
|
||||
};
|
||||
this.menuItems = [];
|
||||
this.menuItems.push({
|
||||
rootItem: new MenuItem("about", "About", "", "/about/learn-how", false, [], null, {}),
|
||||
|
|
Loading…
Reference in New Issue