Change navbar base on new theme
This commit is contained in:
parent
ada419f8e8
commit
d590732aba
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
|
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Session, User} from './utils/helper.class';
|
import {Session, User} from './utils/helper.class';
|
||||||
import {RouterHelper} from '../utils/routerHelper.class';
|
import {RouterHelper} from '../utils/routerHelper.class';
|
||||||
|
@ -6,72 +6,44 @@ import {Subscriber} from "rxjs";
|
||||||
import {MenuItem} from "../sharedComponents/menu";
|
import {MenuItem} from "../sharedComponents/menu";
|
||||||
import {UserManagementService} from "../services/user-management.service";
|
import {UserManagementService} from "../services/user-management.service";
|
||||||
|
|
||||||
// declare var logoutClicked;
|
declare var UIkit;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'user-mini',
|
selector: 'user-mini',
|
||||||
template: `
|
template: `
|
||||||
<ng-container *ngIf="!dashboard">
|
<ng-container *ngIf="!dashboard">
|
||||||
|
|
||||||
<ul *ngIf="!mobileView" class="uk-navbar-nav" [class.uk-dark]="dark">
|
<ul *ngIf="!mobileView" class="uk-navbar-nav" [class.uk-dark]="dark">
|
||||||
<li class="uk-parent">
|
<li class="uk-parent">
|
||||||
<a *ngIf="loggedIn" class="login">
|
<a *ngIf="!loggedIn" (click)="logIn()">Sign in</a>
|
||||||
<svg height="60" width="60">
|
<ng-container *ngIf="loggedIn">
|
||||||
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
<a class="login uk-icon">
|
||||||
<text *ngIf="firstLetters" x="50%" y="50%" text-anchor="middle" dy=".4em"
|
<svg height="60" width="60">
|
||||||
font-size="16">
|
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
||||||
{{firstLetters}}
|
<text x="50%" y="50%" text-anchor="middle" dy=".4em" font-size="16">
|
||||||
</text>
|
{{firstLetters?firstLetters:'AN'}}
|
||||||
<svg *ngIf="!firstLetters" ratio="1" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" width="20"
|
</text>
|
||||||
x="20">
|
|
||||||
<circle cx="9.9" cy="6.4" r="4.4" stroke-width="1.1"></circle>
|
|
||||||
<path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" stroke-width="1.1"></path>
|
|
||||||
</svg>
|
</svg>
|
||||||
</svg>
|
</a>
|
||||||
</a>
|
<div class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left">
|
||||||
<a *ngIf="!loggedIn" class="loginLink" id="userMenu-parent" (click)="logIn()">Sign in <span
|
<ul class="uk-nav uk-navbar-dropdown-nav">
|
||||||
class=" uk-margin-small-left uk-margin-small-right uk-icon"><svg width="20" height="20"
|
<ng-container *ngFor="let item of userMenuItems ">
|
||||||
viewBox="0 0 20 20"
|
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
[class.uk-active]="isTheActiveSubMenu(item)">
|
||||||
ratio="1"><circle fill="none"
|
<a *ngIf="item.route.length > 0" [routerLink]="item.route"
|
||||||
stroke="#000"
|
[queryParams]="item.params">{{item.title}}</a>
|
||||||
stroke-width="1.1"
|
<a *ngIf="item.route.length == 0 && item.url.length > 0" href="{{item.url}}"
|
||||||
cx="9.9" cy="6.4"
|
target="_blank">{{item.title}}</a>
|
||||||
r="4.4"></circle><path
|
</li>
|
||||||
fill="none" stroke="#000" stroke-width="1.1"
|
</ng-container>
|
||||||
d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2"></path></svg> </span>
|
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
||||||
</a>
|
<li><a (click)="logOut()">Log out</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div *ngIf="loggedIn" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left" id="userMenu" uk-toggle>
|
|
||||||
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
|
||||||
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav">
|
|
||||||
<!--li><a href="" >My profile</a></li>
|
|
||||||
<li><a routerLinkActive="uk-link" routerLink="/myclaims">My Claims</a></li>
|
|
||||||
<li *ngIf="isAuthorized"><a routerLinkActive="uk-link" routerLink="/claims">Manage all Claims</a></li-->
|
|
||||||
<ng-container *ngFor="let item of userMenuItems ">
|
|
||||||
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization" [class.uk-active]="isTheActiveSubMenu(item)">
|
|
||||||
<a *ngIf="item.route.length > 0" routerLink="{{item.route}}"
|
|
||||||
[queryParams]=item.params>{{item.title}}</a>
|
|
||||||
<a *ngIf="item.route.length == 0 && item.url.length > 0" href="{{item.url}}"
|
|
||||||
target="_blank">{{item.title}}</a>
|
|
||||||
</li>
|
|
||||||
</ng-container>
|
|
||||||
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
|
||||||
<li><a (click)="logOut()" id="logout">Log out</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div id="logout1"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-container>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ng-container>
|
<ul *ngIf="mobileView" class="uk-nav uk-nav-default">
|
||||||
|
<li>
|
||||||
<ng-container *ngIf="!dashboard">
|
|
||||||
|
|
||||||
<li *ngIf="mobileView" class="uk-nav-header uk-parent ">
|
|
||||||
|
|
||||||
<span *ngIf="loggedIn" class="uk-flex uk-flex-middle">
|
<span *ngIf="loggedIn" class="uk-flex uk-flex-middle">
|
||||||
<span>{{user.fullname + " "}}</span>
|
<span>{{user.fullname + " "}}</span>
|
||||||
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20"
|
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20"
|
||||||
|
@ -87,44 +59,22 @@ import {UserManagementService} from "../services/user-management.service";
|
||||||
d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2"></path></svg>
|
d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2"></path></svg>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!loggedIn">
|
<a *ngIf="!loggedIn" (click)="logIn()">Sign in</a>
|
||||||
<a class="loginLink" (click)="logIn()">Sign in <span class="uk-margin-small-right uk-icon"><svg width="20"
|
<ul *ngIf="loggedIn" class="uk-nav-sub">
|
||||||
height="20"
|
<ng-container *ngFor="let item of userMenuItems ">
|
||||||
viewBox="0 0 20 20"
|
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<a *ngIf="item.route.length > 0" routerLink="{{item.route}}" (click)="closeCanvas()">{{item.title}}</a>
|
||||||
ratio="1"><circle
|
<a *ngIf="item.route.length == 0 && item.url.length > 0" (click)="closeCanvas()" href="{{item.url}}">{{item.title}}</a>
|
||||||
fill="none" stroke="#000" stroke-width="1.1" cx="9.9" cy="6.4" r="4.4"></circle><path fill="none"
|
</li>
|
||||||
stroke="#000"
|
</ng-container>
|
||||||
stroke-width="1.1"
|
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
||||||
d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2"></path></svg></span>
|
<li><a (click)="logOut()">Log out</a></li>
|
||||||
</a>
|
</ul>
|
||||||
</span>
|
</li>
|
||||||
|
</ul>
|
||||||
<ul *ngIf="loggedIn" class="uk-nav-sub">
|
|
||||||
<!--li><a href="" >My profile</a></li>
|
|
||||||
<li><a routerLinkActive="uk-link" routerLink="/myclaims">My Claims</a></li>
|
|
||||||
<li *ngIf="isAuthorized"><a routerLinkActive="uk-link" routerLink="/claims">Manage all Claims</a></li-->
|
|
||||||
<ng-container *ngFor="let item of userMenuItems ">
|
|
||||||
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization">
|
|
||||||
<a *ngIf="item.route.length > 0" routerLink="{{item.route}}">{{item.title}}</a>
|
|
||||||
<a *ngIf="item.route.length == 0 && item.url.length > 0" href="{{item.url}}">{{item.title}}</a>
|
|
||||||
</li>
|
|
||||||
</ng-container>
|
|
||||||
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
|
||||||
<li><a (click)="logOut()" id="logout">Log out</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="dashboard">
|
<ng-container *ngIf="dashboard">
|
||||||
<a *ngIf="!loggedIn" class="uk-flex" (click)="logIn()">
|
<a *ngIf="!loggedIn" class="uk-flex" (click)="logIn()">Sign in</a>
|
||||||
<span>Sign in</span>
|
|
||||||
<span class="uk-margin-small-left uk-margin-small-right uk-icon">
|
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1">
|
|
||||||
<circle cx="9.9" cy="6.4" r="4.4" stroke-width="1.1"></circle>
|
|
||||||
<path d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2" stroke-width="1.1"></path>
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
<a *ngIf="loggedIn" class="login uk-icon">
|
<a *ngIf="loggedIn" class="login uk-icon">
|
||||||
<svg height="60" width="60">
|
<svg height="60" width="60">
|
||||||
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
||||||
|
@ -152,7 +102,7 @@ import {UserManagementService} from "../services/user-management.service";
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
||||||
<li><a (click)="logOut()" id="logout">Log out</a></li>
|
<li><a (click)="logOut()">Log out</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -172,9 +122,10 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
@Input() logOutUrl;
|
@Input() logOutUrl;
|
||||||
@Input() cookieDomain;
|
@Input() cookieDomain;
|
||||||
@Input() dark: boolean = false;
|
@Input() dark: boolean = false;
|
||||||
subscriptions = [];
|
@Output() closeCanvasEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||||
|
private subscriptions = [];
|
||||||
|
|
||||||
constructor(private router: Router, private route: ActivatedRoute, private userManagementService: UserManagementService) {
|
constructor(private router: Router, private route: ActivatedRoute, private userManagementService: UserManagementService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -189,7 +140,7 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
this.initUser();
|
this.initUser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscriber) {
|
if (subscription instanceof Subscriber) {
|
||||||
|
@ -198,6 +149,10 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeCanvas() {
|
||||||
|
this.closeCanvasEmitter.emit(true);
|
||||||
|
}
|
||||||
|
|
||||||
initUser() {
|
initUser() {
|
||||||
if (this.user) {
|
if (this.user) {
|
||||||
this.loggedIn = true;
|
this.loggedIn = true;
|
||||||
|
@ -222,14 +177,12 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
logIn() {
|
logIn() {
|
||||||
this.userManagementService.login();
|
this.userManagementService.login();
|
||||||
}
|
}
|
||||||
|
|
||||||
isTheActiveSubMenu(menuItem: MenuItem): boolean {
|
isTheActiveSubMenu(menuItem: MenuItem): boolean {
|
||||||
let currentRoute = this.router.url.split('?')[0];
|
let currentRoute = this.router.url.split('?')[0];
|
||||||
if (menuItem.route == currentRoute || menuItem.route == (currentRoute + "/") ) {
|
return menuItem.route == currentRoute || menuItem.route == (currentRoute + "/");
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parseName() {
|
parseName() {
|
||||||
this.firstLetters = "";
|
this.firstLetters = "";
|
||||||
if (this.user && this.user.firstname) {
|
if (this.user && this.user.firstname) {
|
||||||
|
|
|
@ -32,95 +32,71 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="specialAnnouncementContent" class="uk-hidden@m" [innerHTML]="specialAnnouncementContent">
|
<div *ngIf="specialAnnouncementContent" class="uk-hidden@m" [innerHTML]="specialAnnouncementContent">
|
||||||
</div>
|
</div>
|
||||||
<div id="tm-mobile" [attr.uk-offcanvas]="(offCanvasFlip?'flip:'+offCanvasFlip:'')" mode="slide" overlay=""
|
<div #canvas id="tm-mobile" [attr.uk-offcanvas]="(offCanvasFlip?'flip:'+(offCanvasFlip + ';'):'') + 'overlay: true'"
|
||||||
class="uk-offcanvas uk-hidden@m"
|
class="uk-offcanvas uk-hidden@m"
|
||||||
style="z-index:9999;">
|
style="z-index:9999;">
|
||||||
<div class="uk-offcanvas-bar">
|
<div class="uk-offcanvas-bar">
|
||||||
<button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
|
<button class="uk-offcanvas-close uk-close uk-icon" type="button" uk-close=""></button>
|
||||||
<div class="uk-child-width-1-1 uk-grid" uk-grid="">
|
<div class="uk-padding">
|
||||||
<div>
|
<ul class="uk-nav uk-nav-default">
|
||||||
<div class="uk-panel" id="module-0">
|
<ng-container *ngIf="!onlyTop">
|
||||||
<ul class="uk-nav uk-nav-default">
|
<ng-container *ngFor="let menu of menuItems">
|
||||||
<!-- <li *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
|
<li *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
|
||||||
class="uk-nav-header uk-parent">
|
<a routerLinkActive="uk-link" routerLink="/" (click)="closeCanvas(canvas)">Home</a>
|
||||||
Dashboards
|
</li>
|
||||||
|
<li [class.uk-active]="isTheActiveMenu(menu)"
|
||||||
|
*ngIf="isAtleastOneEnabled(menu.rootItem.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)">
|
||||||
|
<!--a routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a-->
|
||||||
|
<a *ngIf="menu.rootItem.route.length > 0 && (isEnabled([menu.rootItem.route], showPage) || !menu.rootItem.routeRequired)"
|
||||||
|
routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}"
|
||||||
|
[routerLinkActiveOptions]="{exact: true}" (click)="closeCanvas(canvas)"
|
||||||
|
[queryParams]="menu.rootItem.params" [fragment]="menu.rootItem.fragment">{{menu.rootItem.title}}</a>
|
||||||
|
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
||||||
|
routerLinkActive="uk-link" href="{{menu.rootItem.url}}" (click)="closeCanvas(canvas)"
|
||||||
|
target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}">{{menu.rootItem.title}}</a>
|
||||||
|
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) ||
|
||||||
|
(menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage)
|
||||||
|
&& isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))" (click)="closeCanvas(canvas)">{{menu.rootItem.title}}</a>
|
||||||
<ul class="uk-nav-sub">
|
<ul class="uk-nav-sub">
|
||||||
<li *ngIf="portal!='explore'"><a
|
<ng-container *ngFor="let submenu of menu.items">
|
||||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development' ?'beta.':'')+'explore.openaire.eu'"
|
<li [class.uk-active]="isTheActiveMenuItem(submenu)"
|
||||||
target="_blank" class="uk-heading-bullet explore-heading-bullet">EXPLORE</a></li>
|
*ngIf="isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage) && (submenu.route.length > 0 || submenu.url.length > 0)"
|
||||||
<li *ngIf="portal!='provide'"><a
|
[class.uk-parent]="submenu.items && submenu.items.length > 0">
|
||||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'provide.openaire.eu'"
|
<a *ngIf="submenu.route.length > 0" routerLinkActive="uk-link" (click)="closeCanvas(canvas)"
|
||||||
target="_blank" class="uk-heading-bullet provide-heading-bullet">PROVIDE</a></li>
|
routerLink="{{submenu.route}}" [queryParams]=submenu.params
|
||||||
<li *ngIf="portal!='connect'"><a
|
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
||||||
[href]="'https://'+(properties.environment =='beta' || properties.environment =='development'?'beta.':'')+'connect.openaire.eu'"
|
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0" routerLinkActive="uk-link"
|
||||||
target="_blank" class="uk-heading-bullet connect-heading-bullet">CONNECT</a></li>
|
href="{{submenu.url}}" (click)="closeCanvas(canvas)"
|
||||||
<li *ngIf="portal!='monitor'"><a [href]="'https://'+(properties.environment =='beta' ||
|
target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
||||||
properties.environment =='development'?'beta.':'')+'monitor.openaire.eu'" target="_blank"
|
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
||||||
class="uk-heading-bullet monitor-heading-bullet">MONITOR</a></li>
|
<ng-container *ngFor="let subsubmenu of submenu.items">
|
||||||
<li *ngIf="portal!='develop'"><a href="https://develop.openaire.eu" target="_blank"
|
<li>
|
||||||
class="uk-heading-bullet develop-heading-bullet">DEVELOP</a></li>
|
<a *ngIf="subsubmenu.route.length > 0" routerLinkActive="uk-link"
|
||||||
|
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
||||||
|
[fragment]="subsubmenu.fragment" (click)="closeCanvas(canvas)">{{subsubmenu.title}}</a>
|
||||||
|
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0"
|
||||||
|
routerLinkActive="uk-link" href="{{subsubmenu.url}}" (click)="closeCanvas(canvas)"
|
||||||
|
target="_blank">{{subsubmenu.title}}</a>
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li *ngIf="submenu.route.length == 0 && submenu.url.length == 0 && isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage)"
|
||||||
|
class="uk-nav-header">{{submenu.title}}</li>
|
||||||
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
</li>-->
|
</li>
|
||||||
<ng-container *ngIf="!onlyTop">
|
</ng-container>
|
||||||
<ng-container *ngFor="let menu of menuItems">
|
</ng-container>
|
||||||
<li class="uk-nav-header uk-parent " *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
|
</ul>
|
||||||
<a routerLinkActive="uk-link" routerLink="/">Home</a>
|
<ng-container *ngIf="userMenu">
|
||||||
</li>
|
<user-mini [user]="user" mobileView=true (closeCanvasEmitter)="closeCanvas(canvas)"
|
||||||
<li class="uk-nav-header uk-parent" [class.uk-active]="isTheActiveMenu(menu)"
|
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl
|
||||||
*ngIf="isAtleastOneEnabled(menu.rootItem.entitiesRequired,showEntity) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)">
|
[logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain></user-mini>
|
||||||
<!--a routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}" [queryParams]=menu.rootItem.params class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a-->
|
</ng-container>
|
||||||
<a *ngIf="menu.rootItem.route.length > 0 && (isEnabled([menu.rootItem.route], showPage) || !menu.rootItem.routeRequired)"
|
|
||||||
routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}"
|
|
||||||
[routerLinkActiveOptions]="{exact: true}"
|
|
||||||
[queryParams]="menu.rootItem.params" [fragment]="menu.rootItem.fragment"
|
|
||||||
class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a>
|
|
||||||
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
|
||||||
routerLinkActive="uk-link" href="{{menu.rootItem.url}}" target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}">{{menu.rootItem.title}}</a>
|
|
||||||
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) || (menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage))"
|
|
||||||
class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a>
|
|
||||||
|
|
||||||
<ul class="uk-nav-sub">
|
|
||||||
<ng-container *ngFor="let submenu of menu.items">
|
|
||||||
<li [class.uk-active]="isTheActiveMenuItem(submenu)" *ngIf="isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage) && (submenu.route.length > 0 || submenu.url.length > 0)"
|
|
||||||
[class.uk-parent]="submenu.items && submenu.items.length > 0">
|
|
||||||
<a *ngIf="submenu.route.length > 0" routerLinkActive="uk-link"
|
|
||||||
routerLink="{{submenu.route}}" [queryParams]=submenu.params [fragment]="submenu.fragment"
|
|
||||||
class="uk-offcanvas-close custom-offcanvas-close">{{submenu.title}}</a>
|
|
||||||
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0" routerLinkActive="uk-link"
|
|
||||||
href="{{submenu.url}}" target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
|
||||||
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
|
||||||
<ng-container *ngFor="let subsubmenu of submenu.items">
|
|
||||||
<li>
|
|
||||||
<a *ngIf="subsubmenu.route.length > 0" routerLinkActive="uk-link"
|
|
||||||
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
|
||||||
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
|
|
||||||
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0" routerLinkActive="uk-link"
|
|
||||||
href="{{subsubmenu.url}}" target="_blank">{{subsubmenu.title}}</a>
|
|
||||||
</li>
|
|
||||||
</ng-container>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li *ngIf="submenu.route.length == 0 && submenu.url.length == 0 && isEnabled(submenu.entitiesRequired,showEntity) && isEnabled(submenu.routeRequired, showPage)"
|
|
||||||
class="uk-nav-header">{{submenu.title}}</li>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
<ng-container *ngIf="userMenu">
|
|
||||||
<user-mini [user]="user" mobileView=true
|
|
||||||
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl
|
|
||||||
[logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain></user-mini>
|
|
||||||
</ng-container>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -161,12 +137,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
<div *ngIf="specialAnnouncementContent" class="uk-visible@m" [innerHTML]="specialAnnouncementContent">
|
<div *ngIf="specialAnnouncementContent" class="uk-visible@m" [innerHTML]="specialAnnouncementContent"></div>
|
||||||
|
<div class="uk-visible@m">
|
||||||
</div>
|
<div [class]="'uk-sticky uk-navbar-transparent '+portal+'-menu'"
|
||||||
<div class="tm-header uk-visible@m tm-header-transparent" uk-header="">
|
uk-sticky="show-on-up: true" media="768" cls-active="uk-active uk-navbar-sticky"
|
||||||
<div id="stickyNavbar" [class]="'uk-navbar-container uk-sticky uk-navbar-transparent '+portal+'-menu'" uk-sticky="show-on-up: true"
|
|
||||||
media="768" cls-active="uk-active uk-navbar-sticky"
|
|
||||||
[attr.animation]="(header.stickyAnimation != false ?'uk-animation-slide-top':null)"
|
[attr.animation]="(header.stickyAnimation != false ?'uk-animation-slide-top':null)"
|
||||||
top=".tm-header + [class*="uk-section"]" cls-inactive="uk-navbar-transparent" style="">
|
top=".tm-header + [class*="uk-section"]" cls-inactive="uk-navbar-transparent" style="">
|
||||||
<div
|
<div
|
||||||
|
@ -175,25 +149,39 @@
|
||||||
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
|
[src]="'assets/common-assets/'+(properties.environment =='beta'?'beta_flag.svg':'prototype_flag.svg')"
|
||||||
alt="BETA" style="height: 102px; width: 102px">
|
alt="BETA" style="height: 102px; width: 102px">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-container uk-container-expand">
|
<nav class="uk-navbar uk-navbar-container" uk-navbar>
|
||||||
<nav class="uk-navbar" uk-navbar="{"align":"center"}">
|
<div *ngIf="showLogo && header.position== 'left'" class="uk-navbar-left uk-visible@l">
|
||||||
<div *ngIf="showLogo && header.position== 'left'" class="uk-navbar-left uk-visible@l">
|
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="showLogo && header.position == 'left'" class="uk-navbar-left uk-visible@m uk-hidden@l">
|
||||||
|
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition != 'center' "
|
||||||
|
class="uk-margin-auto uk-visible@m">
|
||||||
|
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||||
|
</div>
|
||||||
|
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
||||||
|
<ng-container *ngIf="!onlyTop">
|
||||||
|
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition == 'center' "
|
||||||
|
class="uk-margin-large-right uk-visible@m">
|
||||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showLogo && header.position == 'left'" class="uk-navbar-left uk-visible@m uk-hidden@l">
|
<div class="uk-navbar-center">
|
||||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
<ng-container *ngIf="header.menuPosition === 'center'">
|
||||||
|
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition != 'center' " class="uk-margin-auto uk-visible@m">
|
<div class="uk-navbar-right">
|
||||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
<ng-container *ngIf="header.menuPosition === 'right'">
|
||||||
|
<ng-container *ngTemplateOutlet="mainMenu"></ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<user-mini *ngIf="userMenu" [user]="user" [dark]="dark"
|
||||||
|
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl [logOutUrl]=properties.logoutUrl
|
||||||
|
[cookieDomain]=properties.cookieDomain></user-mini>
|
||||||
|
<ng-content select="[after-login]"></ng-content>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
<ng-template #mainMenu>
|
||||||
<div *ngIf="!onlyTop" [class.uk-navbar-right]="header.menuPosition != 'center'"
|
<ul class="uk-navbar-nav" [class.uk-margin-right]="!userMenu">
|
||||||
[class.uk-navbar-center]="header.menuPosition == 'center'">
|
|
||||||
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition == 'center' "
|
|
||||||
class="uk-margin-large-right uk-visible@m">
|
|
||||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
|
||||||
</div>
|
|
||||||
<ul [class]="'uk-navbar-nav'+(!userMenu?' uk-margin-right':'')">
|
|
||||||
<li class="uk-parent" *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
|
<li class="uk-parent" *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
|
||||||
<a routerLinkActive="uk-link" routerLink="/">Home</a>
|
<a routerLinkActive="uk-link" routerLink="/">Home</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -205,12 +193,14 @@
|
||||||
routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}"
|
routerLinkActive="uk-link" routerLink="{{menu.rootItem.route}}"
|
||||||
[queryParams]="menu.rootItem.params"
|
[queryParams]="menu.rootItem.params"
|
||||||
[fragment]="menu.rootItem.fragment"> {{menu.rootItem.title}}</a>
|
[fragment]="menu.rootItem.fragment"> {{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="menu.rootItem.route.length == 0 && menu.rootItem.url.length > 0"
|
||||||
href="{{menu.rootItem.url}}" target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}" aria-expanded="false">{{menu.rootItem.title}}</a>
|
routerLinkActive="uk-link"
|
||||||
|
href="{{menu.rootItem.url}}" target="{{menu.rootItem.url.includes('http') ? '_blank' : '_self'}}"
|
||||||
|
aria-expanded="false">{{menu.rootItem.title}}</a>
|
||||||
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) || ( menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)) "
|
<a *ngIf="(menu.rootItem.route.length == 0 && menu.rootItem.url.length == 0) || ( menu.rootItem.route.length >0 && menu.rootItem.routeRequired && !isEnabled([menu.rootItem.route], showPage) && isAtleastOneEnabled(menu.rootItem.routeRequired, showPage)) "
|
||||||
class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a>
|
class="uk-offcanvas-close custom-offcanvas-close">{{menu.rootItem.title}}</a>
|
||||||
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
||||||
style="top: 80px; left: 0px;" id="{{menu.rootItem.id}}" uk-toggle>
|
style="top: 80px; left: 0px;" id="{{menu.rootItem._id}}" uk-toggle>
|
||||||
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
||||||
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav">
|
<ul class="uk-nav uk-navbar-dropdown-nav">
|
||||||
|
@ -222,15 +212,18 @@
|
||||||
<a *ngIf="submenu.route.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="submenu.route.length > 0" routerLinkActive="uk-link"
|
||||||
routerLink="{{submenu.route}}" [queryParams]="submenu.params"
|
routerLink="{{submenu.route}}" [queryParams]="submenu.params"
|
||||||
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
[fragment]="submenu.fragment">{{submenu.title}}</a>
|
||||||
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="submenu.route.length == 0 && submenu.url.length > 0"
|
||||||
href="{{submenu.url}}" target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
routerLinkActive="uk-link"
|
||||||
|
href="{{submenu.url}}"
|
||||||
|
target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{submenu.title}}</a>
|
||||||
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
<ul *ngIf="submenu.items && submenu.items.length > 0" class="uk-nav-sub">
|
||||||
<ng-container *ngFor="let subsubmenu of submenu.items">
|
<ng-container *ngFor="let subsubmenu of submenu.items">
|
||||||
<li>
|
<li>
|
||||||
<a *ngIf="subsubmenu.route.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="subsubmenu.route.length > 0" routerLinkActive="uk-link"
|
||||||
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
||||||
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
|
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
|
||||||
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0"
|
||||||
|
routerLinkActive="uk-link"
|
||||||
href="{{subsubmenu.url}}" target="_blank">{{subsubmenu.title}}</a>
|
href="{{subsubmenu.url}}" target="_blank">{{subsubmenu.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -246,76 +239,63 @@
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<!-- Custom menu items -->
|
<!-- Custom menu items -->
|
||||||
<ng-container *ngIf="customMenuItems?.length > 0 && properties.environment == 'development'">
|
<ng-container *ngIf="customMenuItems?.length > 0 && properties.environment == 'development'">
|
||||||
<ng-container *ngFor="let menu of customMenuItems">
|
<ng-container *ngFor="let menu of customMenuItems">
|
||||||
<li class="uk-parent">
|
<li class="uk-parent">
|
||||||
<!-- INTERNAL ROOT-->
|
<!-- INTERNAL ROOT-->
|
||||||
<a *ngIf="menu.type == 'internal' && menu.route && isEnabled([menu.route], showPage)" routerLinkActive="uk-link"
|
<a *ngIf="menu.type == 'internal' && menu.route && isEnabled([menu.route], showPage)"
|
||||||
routerLink="{{menu.route}}"
|
routerLinkActive="uk-link"
|
||||||
[queryParams]="menu.params"
|
routerLink="{{menu.route}}"
|
||||||
[fragment]="menu.fragment">
|
[queryParams]="menu.params"
|
||||||
{{menu.title}}
|
[fragment]="menu.fragment">
|
||||||
</a>
|
{{menu.title}}
|
||||||
<!-- EXTERNAL ROOT-->
|
</a>
|
||||||
<a *ngIf="menu.type == 'external' && menu.url"
|
<!-- EXTERNAL ROOT-->
|
||||||
href="{{menu.url}}"
|
<a *ngIf="menu.type == 'external' && menu.url"
|
||||||
target="_blank">
|
href="{{menu.url}}"
|
||||||
{{menu.title}}
|
target="_blank">
|
||||||
</a>
|
{{menu.title}}
|
||||||
<!-- NO ACTION ROOT-->
|
</a>
|
||||||
<a *ngIf="menu.type == 'noAction'">
|
<!-- NO ACTION ROOT-->
|
||||||
{{menu.title}}
|
<a *ngIf="menu.type == 'noAction'">
|
||||||
</a>
|
{{menu.title}}
|
||||||
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
</a>
|
||||||
style="top: 80px; left: 0px;" id="{{menu._id}}" uk-toggle>
|
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
||||||
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
style="top: 80px; left: 0px;" id="{{menu._id}}" uk-toggle>
|
||||||
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav">
|
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
||||||
<ng-container *ngFor="let submenu of menu.items">
|
<ul class="uk-nav uk-navbar-dropdown-nav">
|
||||||
<li>
|
<ng-container *ngFor="let submenu of menu.items">
|
||||||
<!-- INTERNAL CHILD -->
|
<li>
|
||||||
<a *ngIf="submenu.type == 'internal' && submenu.route && isEnabled([submenu.route], showPage)" routerLinkActive="uk-link"
|
<!-- INTERNAL CHILD -->
|
||||||
routerLink="{{submenu.route}}"
|
<a *ngIf="submenu.type == 'internal' && submenu.route && isEnabled([submenu.route], showPage)"
|
||||||
[queryParams]="submenu.params"
|
routerLinkActive="uk-link"
|
||||||
[fragment]="submenu.fragment"
|
routerLink="{{submenu.route}}"
|
||||||
[class.uk-active]="isTheActiveMenuItem(submenu)">
|
[queryParams]="submenu.params"
|
||||||
{{submenu.title}}
|
[fragment]="submenu.fragment"
|
||||||
</a>
|
[class.uk-active]="isTheActiveMenuItem(submenu)">
|
||||||
<!-- EXTERNAL CHILD -->
|
{{submenu.title}}
|
||||||
<a *ngIf="submenu.type == 'external' && submenu.url" routerLinkActive="uk-link"
|
</a>
|
||||||
href="{{submenu.url}}"
|
<!-- EXTERNAL CHILD -->
|
||||||
target="_blank">
|
<a *ngIf="submenu.type == 'external' && submenu.url" routerLinkActive="uk-link"
|
||||||
{{submenu.title}}
|
href="{{submenu.url}}"
|
||||||
</a>
|
target="_blank">
|
||||||
</li>
|
{{submenu.title}}
|
||||||
</ng-container>
|
</a>
|
||||||
</ul>
|
</li>
|
||||||
</div>
|
</ng-container>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</div>
|
||||||
</ng-container>
|
</div>
|
||||||
</ng-container>
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- </div> -->
|
</ng-template>
|
||||||
<!-- <div *ngIf="userMenu" class="uk-navbar-right"> -->
|
</ng-container>
|
||||||
<!-- <div *ngIf="userMenu" class="uk-navbar-right"> -->
|
</nav>
|
||||||
<user-mini *ngIf="userMenu" [user]="user" [dark]="dark"
|
|
||||||
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl [logOutUrl]=properties.logoutUrl
|
|
||||||
[cookieDomain]=properties.cookieDomain></user-mini>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
|
|
||||||
<div
|
|
||||||
class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid uk-grid-stack"
|
|
||||||
uk-grid="">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
|
import {Component, Input, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Session, User} from '../login/utils/helper.class';
|
import {Session, User} from '../login/utils/helper.class';
|
||||||
import {ConfigurationService} from '../utils/configuration/configuration.service';
|
import {ConfigurationService} from '../utils/configuration/configuration.service';
|
||||||
|
@ -7,6 +7,8 @@ import {EnvProperties} from '../utils/properties/env-properties';
|
||||||
import {Subscription} from 'rxjs';
|
import {Subscription} from 'rxjs';
|
||||||
import {HelpContentService} from '../services/help-content.service';
|
import {HelpContentService} from '../services/help-content.service';
|
||||||
|
|
||||||
|
declare var UIkit;
|
||||||
|
|
||||||
export interface Header {
|
export interface Header {
|
||||||
route?: string,
|
route?: string,
|
||||||
url?: string,
|
url?: string,
|
||||||
|
@ -68,6 +70,10 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
||||||
sub.unsubscribe();
|
sub.unsubscribe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeCanvas(element) {
|
||||||
|
UIkit.offcanvas(element).hide();
|
||||||
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
if ((['provide', 'develop']).indexOf(this.portal) != -1) {
|
if ((['provide', 'develop']).indexOf(this.portal) != -1) {
|
||||||
|
@ -88,13 +94,13 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
||||||
this.subs.push(this.config.communityInformationState.subscribe(data => {
|
this.subs.push(this.config.communityInformationState.subscribe(data => {
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data['entities']) {
|
if (data['entities']) {
|
||||||
for (var i = 0; i < data['entities'].length; i++) {
|
for (let i = 0; i < data['entities'].length; i++) {
|
||||||
|
|
||||||
this.showEntity['' + data['entities'][i]['pid'] + ''] = data['entities'][i]['isEnabled'];
|
this.showEntity['' + data['entities'][i]['pid'] + ''] = data['entities'][i]['isEnabled'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data['pages']) {
|
if (data['pages']) {
|
||||||
for (var i = 0; i < data['pages'].length; i++) {
|
for (let i = 0; i < data['pages'].length; i++) {
|
||||||
this.showPage[data['pages'][i]['route']] = data['pages'][i]['isEnabled'];
|
this.showPage[data['pages'][i]['route']] = data['pages'][i]['isEnabled'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -116,8 +122,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isEnabled(required, enabled) {
|
isEnabled(required, enabled) {
|
||||||
if (!required) {
|
if (!required) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -143,7 +148,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (count > 0) ? true : false;
|
return (count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleError(message: string, error) {
|
private handleError(message: string, error) {
|
||||||
|
|
Loading…
Reference in New Issue