apply changes related to eosc/aggregator
This commit is contained in:
parent
ba1a141702
commit
66eed05597
|
@ -9,6 +9,9 @@ export class ConnectHelper {
|
|||
domain = "covid-19.openaire.eu"; //for testing
|
||||
}
|
||||
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
||||
if (domain.indexOf('eosc-portal.eu') != -1) {
|
||||
return "eosc";
|
||||
}
|
||||
if (domain.indexOf('openaire.eu') === -1) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -176,18 +176,23 @@
|
|||
alt="BETA" style="height: 102px; width: 102px">
|
||||
</div>
|
||||
<div class="uk-container uk-container-expand">
|
||||
<nav class="uk-navbar" uk-navbar="{"align":"left"}">
|
||||
<nav class="uk-navbar" uk-navbar="{"align":"center"}">
|
||||
<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'" class="uk-margin-auto uk-visible@m">
|
||||
<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"> -->
|
||||
<div *ngIf="!onlyTop" class="uk-navbar-right uk-position-top-right">
|
||||
<div *ngIf="!onlyTop" [class.uk-navbar-right]="header.menuPosition != 'center'"
|
||||
[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 !== '/'">
|
||||
<a routerLinkActive="uk-link" routerLink="/">Home</a>
|
||||
|
|
|
@ -16,6 +16,7 @@ export interface Header {
|
|||
position: 'left' | 'center' | 'right',
|
||||
badge: boolean
|
||||
stickyAnimation?: boolean
|
||||
menuPosition?: 'center' | 'right'
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
@ -49,9 +50,9 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
showEntity = {};
|
||||
showPage = {};
|
||||
specialAnnouncementContent: string = null;
|
||||
|
||||
|
||||
public customMenuItems: MenuItem[] = [];
|
||||
|
||||
|
||||
constructor(private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private config: ConfigurationService,
|
||||
|
@ -61,13 +62,13 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
ngOnInit() {
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
|
||||
ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
initialize() {
|
||||
if ((['provide', 'develop']).indexOf(this.portal) != -1) {
|
||||
this.header = {
|
||||
|
@ -77,6 +78,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
logoUrl: this.logoPath + 'logo-large-' + this.portal + '.png',
|
||||
logoSmallUrl: this.logoPath + 'logo-small-' + this.portal + '.png',
|
||||
position: 'left',
|
||||
menuPosition: 'right',
|
||||
badge: true
|
||||
};
|
||||
}
|
||||
|
@ -87,14 +89,14 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
if (data) {
|
||||
if (data['entities']) {
|
||||
for (var i = 0; i < data['entities'].length; i++) {
|
||||
|
||||
|
||||
this.showEntity['' + data['entities'][i]['pid'] + ''] = data['entities'][i]['isEnabled'];
|
||||
}
|
||||
}
|
||||
if (data['pages']) {
|
||||
for (var i = 0; i < data['pages'].length; i++) {
|
||||
this.showPage[data['pages'][i]['route']] = data['pages'][i]['isEnabled'];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,14 +116,14 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
isEnabled(required, enabled) {
|
||||
if (!required) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
for (let requiredEntity of required) {
|
||||
if (typeof enabled[requiredEntity] === 'undefined' || enabled[requiredEntity] == false) {
|
||||
return false;
|
||||
|
@ -129,12 +131,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
isAtleastOneEnabled(required, enabled) {
|
||||
if (!required || required.length == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
var count = required.length;
|
||||
for (let requiredEntity of required) {
|
||||
if (typeof enabled[requiredEntity] === 'undefined' || enabled[requiredEntity] == false) {
|
||||
|
@ -143,18 +145,18 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
return (count > 0) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error('NavigationBar (component): ' + message, error);
|
||||
}
|
||||
|
||||
|
||||
get currentRoute() {
|
||||
return {
|
||||
route: this.router.url.split('?')[0].split('#')[0],
|
||||
fragment: this.route.snapshot.fragment
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
isTheActiveMenu(menu: RootMenuItem): boolean {
|
||||
if (!menu.rootItem.markAsActive) {
|
||||
return false;
|
||||
|
@ -170,7 +172,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
isTheActiveMenuItem(menuItem: MenuItem): boolean {
|
||||
let currentRoute = this.currentRoute;
|
||||
return (menuItem.route == currentRoute.route || menuItem.route == (currentRoute.route + "/")) &&
|
||||
|
|
Loading…
Reference in New Issue