Merge from Develop for Monitor production release #3
|
@ -1,11 +1,5 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
|
||||||
<div>
|
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">Manage Classes</div>
|
|
||||||
<h1 class="uk-h6 uk-margin-remove">Super Admin</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<admin-tabs tab="class"></admin-tabs>
|
<admin-tabs tab="class"></admin-tabs>
|
||||||
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
||||||
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
|
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
<div class="uk-section-xsmall uk-margin-top uk-container">
|
||||||
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-button uk-button-link uk-margin-medium-right">
|
<div class="uk-flex-middle uk-grid" uk-grid>
|
||||||
<icon name="west" ratio="2" [flex]="true"></icon>
|
<div class="uk-width-expand">
|
||||||
</a>
|
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-flex uk-flex-middle uk-h5 uk-link-reset">
|
||||||
<div>
|
<span class="uk-margin-right">
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">
|
<icon name="west" ratio="1.7" [flex]="true"></icon>
|
||||||
Admin Dashboard - {{pageHelpContent ? 'Update ' : 'Add new '}} class help text
|
</span>
|
||||||
|
<h1 *ngIf="page" class="uk-h5 uk-margin-remove">
|
||||||
|
{{page.name}} - {{pageHelpContent ? 'Update ' : 'Add new '}} class help text
|
||||||
|
<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span>
|
||||||
|
</h1>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-auto">
|
||||||
|
<button class="uk-button uk-button-default uk-margin-right"
|
||||||
|
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
|
||||||
|
[disabled]="!myForm.dirty || showLoading">Reset
|
||||||
|
</button>
|
||||||
|
<button class="uk-button uk-button-primary" [class.uk-disabled]="myForm.invalid || !myForm.dirty || myForm.disabled"
|
||||||
|
(click)="saveCustom()" [disabled]="myForm.invalid ||!myForm.dirty || myForm.disabled || showLoading">Save
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h1 *ngIf="page" class="uk-h6 uk-margin-remove">{{page.name}}<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span></h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div actions>
|
|
||||||
<div class="uk-section-xsmall uk-container">
|
|
||||||
<div class="uk-flex uk-flex-center uk-flex-right@m">
|
|
||||||
<button class="uk-button uk-button-default uk-margin-right"
|
|
||||||
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
|
|
||||||
[disabled]="!myForm.dirty || showLoading">Reset
|
|
||||||
</button>
|
|
||||||
<button class="uk-button uk-button-primary" [class.uk-disabled]="myForm.invalid || !myForm.dirty || myForm.disabled"
|
|
||||||
(click)="saveCustom()" [disabled]="myForm.invalid ||!myForm.dirty || myForm.disabled || showLoading">Save
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="parentClass">
|
<div [ngClass]="parentClass">
|
||||||
<ckeditor (change)="contentChanged()"
|
<ckeditor #ckEditor (change)="contentChanged()"
|
||||||
[readonly]="false"
|
[readonly]="false"
|
||||||
debounce="500"
|
debounce="500"
|
||||||
[formControl]="myForm.get('content')"
|
[formControl]="myForm.get('content')"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {Page} from '../../utils/entities/adminTool/page';
|
import {Page} from '../../utils/entities/adminTool/page';
|
||||||
|
@ -9,6 +9,7 @@ import {Subscriber, Subscription, zip} from 'rxjs';
|
||||||
import {DivHelpContent} from '../../utils/entities/adminTool/div-help-content';
|
import {DivHelpContent} from '../../utils/entities/adminTool/div-help-content';
|
||||||
import {NotificationHandler} from "../../utils/notification-handler";
|
import {NotificationHandler} from "../../utils/notification-handler";
|
||||||
import {ClearCacheService} from "../../services/clear-cache.service";
|
import {ClearCacheService} from "../../services/clear-cache.service";
|
||||||
|
import {CKEditorComponent} from "ng2-ckeditor";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'class-content-form',
|
selector: 'class-content-form',
|
||||||
|
@ -27,23 +28,25 @@ export class ClassContentFormComponent implements OnInit {
|
||||||
public showLoading: boolean = true;
|
public showLoading: boolean = true;
|
||||||
private subs: Subscription[] = [];
|
private subs: Subscription[] = [];
|
||||||
public pageHelpContent: DivHelpContent;
|
public pageHelpContent: DivHelpContent;
|
||||||
|
@ViewChild('ckEditor') ckEditor: CKEditorComponent;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder,
|
constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder,
|
||||||
private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) {
|
private cdr: ChangeDetectorRef, private _helpContentService: HelpContentService,
|
||||||
|
private _clearCacheService: ClearCacheService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
|
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
|
||||||
this.parentClass = this.route.snapshot.data.parentClass;
|
this.parentClass = this.route.snapshot.data.parentClass;
|
||||||
this.subs.push(this.route.queryParams.subscribe(params => {
|
this.subs.push(this.route.queryParams.subscribe(params => {
|
||||||
this.pageId = params['pageId'];
|
this.pageId = params['pageId'];
|
||||||
this.myForm = this.form;
|
this.myForm = this.form;
|
||||||
this.pageContentId = params['pageContentId'];
|
this.pageContentId = params['pageContentId'];
|
||||||
if (!this.pageId) {
|
if (!this.pageId) {
|
||||||
this._router.navigate(['../'], {relativeTo: this.route});
|
this._router.navigate(['../'], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
this.getInfo(this.pageId);
|
this.getInfo(this.pageId);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -66,25 +69,44 @@ export class ClassContentFormComponent implements OnInit {
|
||||||
}
|
}
|
||||||
this.setOptions(results[1]);
|
this.setOptions(results[1]);
|
||||||
if (!this.pageContentId) {
|
if (!this.pageContentId) {
|
||||||
this.updateForm(null);
|
this.updateForm(null);
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
|
this.initCKEditor();
|
||||||
} else {
|
} else {
|
||||||
this.subs.push(this._helpContentService.getDivHelpContent( this.pageContentId, this.properties.adminToolsAPIURL, this.portal).subscribe(pageHelpContent=>{
|
this.subs.push(this._helpContentService.getDivHelpContent(this.pageContentId, this.properties.adminToolsAPIURL, this.portal).subscribe(pageHelpContent => {
|
||||||
this.pageHelpContent = pageHelpContent;
|
this.pageHelpContent = pageHelpContent;
|
||||||
if (this.properties.adminToolsPortalType != this.page.portalType) {
|
if (this.properties.adminToolsPortalType != this.page.portalType) {
|
||||||
this._router.navigate(['../'], {relativeTo: this.route});
|
this._router.navigate(['../'], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
this.updateForm(this.pageHelpContent);
|
this.updateForm(this.pageHelpContent);
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
},
|
this.initCKEditor();
|
||||||
|
},
|
||||||
error => {
|
error => {
|
||||||
this.handleError('System error retrieving content by id '+ this.pageContentId, error)
|
this.handleError('System error retrieving content by id ' + this.pageContentId, error)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private initCKEditor() {
|
||||||
|
this.cdr.detectChanges();
|
||||||
|
if (this.ckEditor) {
|
||||||
|
this.ckEditor.instance.on('mode', () => {
|
||||||
|
let editor = this.ckEditor.instance;
|
||||||
|
if (editor.mode === 'source') {
|
||||||
|
let editable = editor.editable();
|
||||||
|
editable.attachListener(editable, 'input', () => {
|
||||||
|
this.myForm.get('content').setValue(editor.getData());
|
||||||
|
this.myForm.get('content').markAsDirty();
|
||||||
|
this.cdr.detectChanges();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private updateForm(pageHelpContent: DivHelpContent) {
|
private updateForm(pageHelpContent: DivHelpContent) {
|
||||||
this.pageHelpContent = pageHelpContent;
|
this.pageHelpContent = pageHelpContent;
|
||||||
this.myForm = this.form;
|
this.myForm = this.form;
|
||||||
|
@ -99,8 +121,8 @@ export class ClassContentFormComponent implements OnInit {
|
||||||
|
|
||||||
public setOptions(divIds) {
|
public setOptions(divIds) {
|
||||||
this.classOptions = [];
|
this.classOptions = [];
|
||||||
for(let divid of divIds){
|
for (let divid of divIds) {
|
||||||
this.classOptions.push({label:divid.name, value:divid._id});
|
this.classOptions.push({label: divid.name, value: divid._id});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -111,7 +133,7 @@ export class ClassContentFormComponent implements OnInit {
|
||||||
content: ['', Validators.required],
|
content: ['', Validators.required],
|
||||||
isActive: true,
|
isActive: true,
|
||||||
portal: this.portal,
|
portal: this.portal,
|
||||||
_id : '',
|
_id: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,13 +144,13 @@ export class ClassContentFormComponent implements OnInit {
|
||||||
content: ['', Validators.required],
|
content: ['', Validators.required],
|
||||||
isActive: true,
|
isActive: true,
|
||||||
portal: '',
|
portal: '',
|
||||||
_id : '',
|
_id: '',
|
||||||
});
|
});
|
||||||
this.myForm.markAsPristine();
|
this.myForm.markAsPristine();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleError(message: string, error = null) {
|
handleError(message: string, error = null) {
|
||||||
if(error) {
|
if (error) {
|
||||||
console.error('Server responded: ' + error);
|
console.error('Server responded: ' + error);
|
||||||
}
|
}
|
||||||
NotificationHandler.rise(message, 'danger');
|
NotificationHandler.rise(message, 'danger');
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
<div class="uk-section-xsmall uk-margin-top">
|
||||||
<a routerLink="../pages" class="uk-button uk-button-link uk-margin-medium-right">
|
<div class="uk-flex-middle uk-grid" uk-grid>
|
||||||
<icon name="west" ratio="2" [flex]="true"></icon>
|
<div class="uk-width-expand">
|
||||||
</a>
|
<a routerLink="../pages" class="uk-flex uk-flex-middle uk-h5 uk-link-reset">
|
||||||
<div>
|
<span class="uk-margin-right">
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">
|
<icon name="west" ratio="1.7" [flex]="true"></icon>
|
||||||
Admin Dashboard - Manage class help texts
|
</span>
|
||||||
|
<h1 *ngIf="page" class="uk-h5 uk-margin-remove">{{page.name}}</h1>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h1 *ngIf="page" class="uk-h6 uk-margin-remove">{{page.name}}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div actions>
|
|
||||||
<div class="uk-section-xsmall">
|
|
||||||
<div class="uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
|
|
||||||
<div search-input [disabled]="showLoading" [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
<div search-input [disabled]="showLoading" [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
|
||||||
<div>
|
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">Manage Entities</div>
|
|
||||||
<h1 class="uk-h6 uk-margin-remove">{{name?name:'Super Admin'}}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<admin-tabs tab="entity" [portal]="portal" [type]="type"></admin-tabs>
|
<admin-tabs tab="entity" [portal]="portal" [type]="type"></admin-tabs>
|
||||||
<ul *ngIf="!isPortalAdministrator" class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
<ul *ngIf="!isPortalAdministrator" class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
||||||
<li [class.uk-active]="filterForm.get('status').value === 'all'"><a
|
<li [class.uk-active]="filterForm.get('status').value === 'all'"><a
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
<div class="uk-section-xsmall uk-margin-top uk-container">
|
||||||
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-button uk-button-link uk-margin-right">
|
<div class="uk-flex-middle uk-grid" uk-grid>
|
||||||
<icon name="west" ratio="2" [flex]="true"></icon>
|
<div class="uk-width-expand">
|
||||||
</a>
|
<a routerLink="../" [queryParams]=" { 'pageId': pageId }" class="uk-flex uk-flex-middle uk-h5 uk-link-reset">
|
||||||
<div>
|
<span class="uk-margin-right">
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">
|
<icon name="west" ratio="1.7" [flex]="true"></icon>
|
||||||
Admin Dashboard - {{pageHelpContent ? 'Update ' : 'Add new '}} page help text
|
</span>
|
||||||
|
<h1 *ngIf="page" class="uk-h5 uk-margin-remove">
|
||||||
|
{{page.name}} - {{pageHelpContent ? 'Update ' : 'Add new '}} page help text
|
||||||
|
<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span>
|
||||||
|
</h1>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-auto">
|
||||||
|
<button class="uk-button uk-button-default uk-margin-right"
|
||||||
|
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
|
||||||
|
[disabled]="!myForm.dirty || showLoading">Reset
|
||||||
|
</button>
|
||||||
|
<button class="uk-button uk-button-primary" [class.uk-disabled]="myForm.invalid || !myForm.dirty || myForm.disabled"
|
||||||
|
(click)="saveCustom()" [disabled]="myForm.invalid ||!myForm.dirty || myForm.disabled || showLoading">Save
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h1 *ngIf="page" class="uk-h6 uk-margin-remove">{{page.name}}<span *ngIf="myForm.dirty" class="uk-text-large"> (unsaved changes)</span></h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div actions>
|
|
||||||
<div class="uk-section-xsmall uk-container">
|
|
||||||
<div class="uk-flex uk-flex-center uk-flex-right@m">
|
|
||||||
<button class="uk-button uk-button-default uk-margin-right"
|
|
||||||
(click)="resetCustom()" [class.uk-disabled]="!myForm.dirty"
|
|
||||||
[disabled]="!myForm.dirty || showLoading">Reset
|
|
||||||
</button>
|
|
||||||
<button class="uk-button uk-button-primary" [class.uk-disabled]="myForm.invalid || !myForm.dirty || myForm.disabled"
|
|
||||||
(click)="saveCustom()" [disabled]="myForm.invalid || !myForm.dirty || myForm.disabled || showLoading">Save
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div [ngClass]="parentClass">
|
<div [ngClass]="parentClass">
|
||||||
<ckeditor (change)="contentChanged()"
|
<ckeditor #ckEditor (change)="contentChanged()"
|
||||||
[readonly]="false"
|
[readonly]="false"
|
||||||
debounce="500"
|
debounce="500"
|
||||||
[formControl]="myForm.get('content')"
|
[formControl]="myForm.get('content')"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {Page} from '../../utils/entities/adminTool/page';
|
import {Page} from '../../utils/entities/adminTool/page';
|
||||||
|
@ -10,6 +10,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
|
||||||
import {PageHelpContent} from '../../utils/entities/adminTool/page-help-content';
|
import {PageHelpContent} from '../../utils/entities/adminTool/page-help-content';
|
||||||
import {ClearCacheService} from "../../services/clear-cache.service";
|
import {ClearCacheService} from "../../services/clear-cache.service";
|
||||||
import {NotificationHandler} from "../../utils/notification-handler";
|
import {NotificationHandler} from "../../utils/notification-handler";
|
||||||
|
import {CKEditorComponent} from "ng2-ckeditor";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-content-form',
|
selector: 'page-content-form',
|
||||||
|
@ -29,9 +30,11 @@ export class PageContentFormComponent implements OnInit {
|
||||||
public showLoading: boolean = true;
|
public showLoading: boolean = true;
|
||||||
private subs: Subscription[] = [];
|
private subs: Subscription[] = [];
|
||||||
public pageHelpContent: PageHelpContent;
|
public pageHelpContent: PageHelpContent;
|
||||||
|
@ViewChild('ckEditor') ckEditor: CKEditorComponent;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder,
|
constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder,
|
||||||
private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) {
|
private cdr: ChangeDetectorRef, private _helpContentService: HelpContentService,
|
||||||
|
private _clearCacheService: ClearCacheService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -80,12 +83,30 @@ export class PageContentFormComponent implements OnInit {
|
||||||
this.updateForm(this.pageHelpContent);
|
this.updateForm(this.pageHelpContent);
|
||||||
}
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
|
this.initCKEditor();
|
||||||
},
|
},
|
||||||
error => this.handleError('System error retrieving page with id: ' + pageId, error)
|
error => this.handleError('System error retrieving page with id: ' + pageId, error)
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private initCKEditor() {
|
||||||
|
this.cdr.detectChanges();
|
||||||
|
if(this.ckEditor) {
|
||||||
|
this.ckEditor.instance.on('mode', () => {
|
||||||
|
let editor = this.ckEditor.instance;
|
||||||
|
if (editor.mode === 'source') {
|
||||||
|
let editable = editor.editable();
|
||||||
|
editable.attachListener(editable, 'input', () => {
|
||||||
|
this.myForm.get('content').setValue(editor.getData());
|
||||||
|
this.myForm.get('content').markAsDirty();
|
||||||
|
this.cdr.detectChanges();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private updateForm(pageHelpContent: PageHelpContent) {
|
private updateForm(pageHelpContent: PageHelpContent) {
|
||||||
this.pageHelpContent = pageHelpContent;
|
this.pageHelpContent = pageHelpContent;
|
||||||
this.myForm = this.form;
|
this.myForm = this.form;
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
<div class="uk-section-xsmall uk-margin-top">
|
||||||
<a routerLink="../pages" class="uk-button uk-button-link uk-margin-medium-right">
|
<div class="uk-flex-middle uk-grid" uk-grid>
|
||||||
<icon name="west" ratio="2" [flex]="true"></icon>
|
<div class="uk-width-expand">
|
||||||
</a>
|
<a routerLink="../pages" class="uk-flex uk-flex-middle uk-h5 uk-link-reset">
|
||||||
<div>
|
<span class="uk-margin-right">
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">
|
<icon name="west" ratio="1.7" [flex]="true"></icon>
|
||||||
Admin Dashboard - Manage page help texts
|
</span>
|
||||||
|
<h1 *ngIf="page" class="uk-h5 uk-margin-remove">{{page.name}}</h1>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h1 *ngIf="page" class="uk-h6 uk-margin-remove">{{page.name}}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div actions>
|
|
||||||
<div class="uk-section-xsmall">
|
|
||||||
<div class="uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
|
|
||||||
<div search-input [disabled]="showLoading" [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
<div search-input [disabled]="showLoading" [expandable]="true" [searchControl]="filterForm" searchInputClass="outer" placeholder="Search helptext" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
|
||||||
<ng-container *ngIf="showLogo">
|
|
||||||
<img [src]="entity | logoUrl" class="uk-margin-right uk-blend-multiply">
|
|
||||||
</ng-container>
|
|
||||||
<div>
|
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Menus</div>
|
|
||||||
<h1 class="uk-h6 uk-margin-remove">{{name ? name : 'Super Admin'}}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<admin-tabs tab="menu" [portal]="portal" [type]="type"></admin-tabs>
|
<admin-tabs tab="menu" [portal]="portal" [type]="type"></admin-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div actions>
|
<div actions>
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
|
||||||
<div>
|
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">Manage Pages</div>
|
|
||||||
<h1 class="uk-h6 uk-margin-remove">{{name ? name : 'Super Admin'}}</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<admin-tabs tab="page" [portal]="portal" [type]="type"></admin-tabs>
|
<admin-tabs tab="page" [portal]="portal" [type]="type"></admin-tabs>
|
||||||
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
||||||
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
|
<li [class.uk-active]="filterForm.get('type').value === 'all'"><a
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<div page-content>
|
<div page-content>
|
||||||
<div header>
|
<div header>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
|
||||||
<div>
|
|
||||||
<div class="uk-text-background uk-text-bold uk-text-small">Manage Portals</div>
|
|
||||||
<h1 class="uk-h6 uk-margin-remove">Super Admin</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<admin-tabs tab="portal"></admin-tabs>
|
<admin-tabs tab="portal"></admin-tabs>
|
||||||
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
<ul class="uk-subnav uk-subnav-pill uk-margin-medium-top">
|
||||||
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
|
<li [class.uk-active]="filterForm.get('type').value === 'all'" class="uk-margin-small-bottom"><a
|
||||||
|
|
|
@ -122,7 +122,9 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof (ResizeObserver || IntersectionObserver)) {
|
if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) {
|
||||||
|
subscription.disconnect();
|
||||||
|
} else if (typeof ResizeObserver !== "undefined" && subscription instanceof IntersectionObserver) {
|
||||||
subscription.disconnect();
|
subscription.disconnect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class LayoutService {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscriber) {
|
if (subscription instanceof Subscriber) {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
} else if (subscription instanceof ResizeObserver) {
|
} else if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) {
|
||||||
subscription.disconnect();
|
subscription.disconnect();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,10 +5,14 @@
|
||||||
</aside>
|
</aside>
|
||||||
<div class="uk-hidden@m">
|
<div class="uk-hidden@m">
|
||||||
<div id="sidebar_offcanvas" #sidebar_offcanvas [attr.uk-offcanvas]="'overlay: true'">
|
<div id="sidebar_offcanvas" #sidebar_offcanvas [attr.uk-offcanvas]="'overlay: true'">
|
||||||
<div class="uk-offcanvas-bar uk-padding-remove-horizontal">
|
<div class="uk-offcanvas-bar uk-padding-remove">
|
||||||
<button class="uk-offcanvas-close uk-icon uk-close">
|
<nav class="uk-navbar uk-background-default" uk-sticky>
|
||||||
<icon name="close" ratio="1.5" visuallyHidden="close menu"></icon>
|
<div class="uk-navbar-right">
|
||||||
</button>
|
<button class="uk-navbar-toggle uk-icon uk-close" (click)="closeOffcanvas()">
|
||||||
|
<icon name="close" ratio="1.5" visuallyHidden="close menu"></icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
<ng-container *ngTemplateOutlet="menu; context: {mobile: true}"></ng-container>
|
<ng-container *ngTemplateOutlet="menu; context: {mobile: true}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,10 +29,10 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="items.length > 0" class="menu_section uk-margin-large-top" [class.mobile]="mobile" style="min-height: 30vh">
|
<div *ngIf="items.length > 0" class="menu_section uk-margin-large-top" [class.mobile]="mobile" style="min-height: 30vh">
|
||||||
<ul #nav class="uk-list uk-nav uk-nav-parent-icon"
|
<ul #nav class="uk-list uk-nav uk-nav-parent-icon" [class.uk-list-large]="mobile"
|
||||||
[class.uk-nav-default]="!mobile" [class.uk-nav-primary]="mobile" uk-nav="duration: 400">
|
[class.uk-nav-default]="!mobile" [class.uk-nav-primary]="mobile" uk-nav="duration: 400">
|
||||||
<ng-template ngFor [ngForOf]="items" let-item>
|
<ng-template ngFor [ngForOf]="items" let-item>
|
||||||
<li [class.uk-active]="item.isActive"
|
<li [class.uk-active]="item.isActive" [ngClass]="item.customClass"
|
||||||
[class.uk-parent]="item.items.length > 0">
|
[class.uk-parent]="item.items.length > 0">
|
||||||
<a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null"
|
<a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null"
|
||||||
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
|
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
|
||||||
|
@ -38,7 +42,7 @@
|
||||||
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
|
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul *ngIf="item.items?.length > 0 && (isBrowser || item.isActive)" class="uk-nav-sub">
|
<ul *ngIf="item.items?.length > 0 && (isBrowser || item.isActive)" class="uk-nav-sub">
|
||||||
<li *ngFor="let subItem of item.items"
|
<li *ngFor="let subItem of item.items" [ngClass]="subItem.customClass"
|
||||||
[class.uk-active]="subItem.isActive">
|
[class.uk-active]="subItem.isActive">
|
||||||
<a [routerLink]="subItem.route?subItem.route:null" [title]="subItem.title" (click)="closeOffcanvas()"
|
<a [routerLink]="subItem.route?subItem.route:null" [title]="subItem.title" (click)="closeOffcanvas()"
|
||||||
[queryParams]="subItem.route?subItem.params:null" [queryParamsHandling]="subItem.route?queryParamsHandling:null">
|
[queryParams]="subItem.route?subItem.params:null" [queryParamsHandling]="subItem.route?queryParamsHandling:null">
|
||||||
|
|
|
@ -32,6 +32,7 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
|
||||||
@ViewChild("sidebar_offcanvas") sidebar_offcanvas: ElementRef;
|
@ViewChild("sidebar_offcanvas") sidebar_offcanvas: ElementRef;
|
||||||
public properties = properties;
|
public properties = properties;
|
||||||
private subscriptions: any[] = [];
|
private subscriptions: any[] = [];
|
||||||
|
private init: boolean = false;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private router: Router,
|
constructor(private route: ActivatedRoute, private router: Router,
|
||||||
private sanitizer: DomSanitizer, private layoutService: LayoutService,
|
private sanitizer: DomSanitizer, private layoutService: LayoutService,
|
||||||
|
@ -48,18 +49,15 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
if(this.nav && typeof UIkit !== "undefined") {
|
this.toggle(true);
|
||||||
setTimeout(() => {
|
|
||||||
if(this.items[this.activeIndex]?.items?.length > 0) {
|
|
||||||
UIkit.nav(this.nav.nativeElement).toggle(this.activeIndex, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
if(changes.activeItem || changes.activeSubItem || changes.items) {
|
if(changes.activeItem || changes.activeSubItem || changes.items) {
|
||||||
this.setActiveMenuItem();
|
this.setActiveMenuItem();
|
||||||
|
if(this.init && changes.items) {
|
||||||
|
this.toggle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +70,17 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggle(init: boolean = false) {
|
||||||
|
this.init = this.init || init;
|
||||||
|
if(this.nav && typeof UIkit !== "undefined") {
|
||||||
|
setTimeout(() => {
|
||||||
|
if(this.items[this.activeIndex]?.items?.length > 0) {
|
||||||
|
UIkit.nav(this.nav.nativeElement).toggle(this.activeIndex, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get isBrowser() {
|
get isBrowser() {
|
||||||
return this.platformId === 'browser';
|
return this.platformId === 'browser';
|
||||||
}
|
}
|
||||||
|
@ -143,10 +152,6 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isTheActiveUrl(menuItemURL): boolean {
|
|
||||||
return (menuItemURL == this.router.url.split('?')[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
public get open() {
|
public get open() {
|
||||||
return this.layoutService.open;
|
return this.layoutService.open;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,16 +5,16 @@ import {Subscription} from "rxjs";
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sidebar-mobile-toggle',
|
selector: 'sidebar-mobile-toggle',
|
||||||
template: `
|
template: `
|
||||||
<a *ngIf="activeSidebarItem" href="#sidebar_offcanvas" class="sidebar_mobile_toggle uk-link-reset uk-width-2-3 uk-flex uk-flex-middle" uk-toggle>
|
<a *ngIf="activeSidebarItem" href="#sidebar_offcanvas" class="sidebar_mobile_toggle uk-link-reset uk-width-3-5 uk-flex uk-flex-middle" uk-toggle>
|
||||||
<div *ngIf="activeSidebarItem.icon && (activeSidebarItem.icon.svg || activeSidebarItem.icon.name)" class="uk-width-auto">
|
<div *ngIf="activeSidebarItem.icon && (activeSidebarItem.icon.svg || activeSidebarItem.icon.name)" class="uk-width-auto">
|
||||||
<icon class="menu-icon" [customClass]="activeSidebarItem.icon.class" [name]="activeSidebarItem.icon.name" ratio="0.9" [svg]="activeSidebarItem.icon.svg" [flex]="true"></icon>
|
<icon class="menu-icon" [customClass]="activeSidebarItem.icon.class" [name]="activeSidebarItem.icon.name" ratio="0.8" [svg]="activeSidebarItem.icon.svg" [flex]="true"></icon>
|
||||||
</div>
|
</div>
|
||||||
<span class="uk-width-expand uk-text-truncate uk-margin-small-left uk-text-bolder">
|
<span class="uk-width-expand uk-text-truncate uk-margin-small-left uk-text-bolder">
|
||||||
{{activeSidebarItem.name}}
|
{{activeSidebarItem.name}}
|
||||||
<span *ngIf="activeSidebarItem.subItem">- {{activeSidebarItem.subItem.name}}</span>
|
<span *ngIf="activeSidebarItem.subItem">- {{activeSidebarItem.subItem.name}}</span>
|
||||||
</span>
|
</span>
|
||||||
<div class="uk-width-auto uk-margin-small-left">
|
<div class="uk-width-auto uk-margin-small-left">
|
||||||
<icon name="arrow_drop_down" ratio="1.5" [flex]="true"></icon>
|
<icon name="arrow_right" ratio="1.4" [flex]="true"></icon>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
`
|
`
|
||||||
|
|
|
@ -77,7 +77,6 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
this.updateLists();
|
this.updateLists();
|
||||||
this.userManagementService.getUserInfo().subscribe(user => {
|
this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
console.log(this.canDelete)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import {HttpClient} from "@angular/common/http";
|
|
||||||
import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from "@angular/core";
|
import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from "@angular/core";
|
||||||
import {FormBuilder, FormControl, UntypedFormArray} from "@angular/forms";
|
import {FormBuilder, FormControl, UntypedFormArray} from "@angular/forms";
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
|
@ -8,6 +7,7 @@ import {properties} from "../../../../environments/environment";
|
||||||
import {StringUtils} from "../../utils/string-utils.class";
|
import {StringUtils} from "../../utils/string-utils.class";
|
||||||
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
|
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
|
||||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||||
|
import {ISVocabulariesService} from "../../utils/staticAutoComplete/ISVocabularies.service";
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
@ -44,7 +44,7 @@ export class FosSelectionComponent {
|
||||||
public sliderInit: boolean = false;
|
public sliderInit: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpClient: HttpClient,
|
private vocabulariesService: ISVocabulariesService,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private cdr: ChangeDetectorRef,
|
private cdr: ChangeDetectorRef,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
@ -53,7 +53,7 @@ export class FosSelectionComponent {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.httpClient.get(this.properties.domain+'/assets/common-assets/vocabulary/fos.json').subscribe(data => {
|
this.vocabulariesService.getFos(properties).subscribe(data => {
|
||||||
this.fos = data['fos'];
|
this.fos = data['fos'];
|
||||||
this.convertFosToOptions();
|
this.convertFosToOptions();
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
||||||
import {PiwikService} from "../utils/piwik/piwik.service";
|
import {PiwikService} from "../utils/piwik/piwik.service";
|
||||||
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
|
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
|
||||||
import Timeout = NodeJS.Timeout;
|
import Timeout = NodeJS.Timeout;
|
||||||
|
import {ISVocabulariesService} from "../utils/staticAutoComplete/ISVocabularies.service";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ export class FosComponent implements OnInit, OnDestroy {
|
||||||
public sliderInit: boolean = false;
|
public sliderInit: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpClient: HttpClient,
|
private vocabulariesService: ISVocabulariesService,
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
@ -70,7 +71,7 @@ export class FosComponent implements OnInit, OnDestroy {
|
||||||
this.updateUrl(this.url);
|
this.updateUrl(this.url);
|
||||||
this.updateTitle(this.pageTitle);
|
this.updateTitle(this.pageTitle);
|
||||||
this.updateDescription(this.pageDescription);
|
this.updateDescription(this.pageDescription);
|
||||||
this.httpClient.get(properties.domain+'/assets/common-assets/vocabulary/fos.json').subscribe(data => {
|
this.vocabulariesService.getFos(properties).subscribe(data => {
|
||||||
this.fos = data['fos'];
|
this.fos = data['fos'];
|
||||||
this.convertFosToOptions();
|
this.convertFosToOptions();
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
|
|
|
@ -55,22 +55,19 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #graph_and_feedback_template>
|
<ng-template #graph_and_feedback_template>
|
||||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!dataProviderInfo">
|
<div class="uk-flex uk-flex-between uk-flex-wrap uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!dataProviderInfo">
|
||||||
<!-- Last Index Info-->
|
<!-- Last Index Info-->
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<icon name="graph" customClass="text-graph"></icon>
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||||
<span class="uk-margin-small-left uk-text-baseline">
|
</a>
|
||||||
<span class="uk-text-meta">Powered by </span>
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<!--Feedback-->
|
<!--Feedback-->
|
||||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -54,22 +54,19 @@
|
||||||
|
|
||||||
<!-- Graph and feedback -->
|
<!-- Graph and feedback -->
|
||||||
<ng-template #graph_and_feedback_template>
|
<ng-template #graph_and_feedback_template>
|
||||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!organizationInfo">
|
<div class="uk-flex uk-flex-between uk-flex-wrap uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!organizationInfo">
|
||||||
<!-- Last Index Info-->
|
<!-- Last Index Info-->
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<icon name="graph" customClass="text-graph"></icon>
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||||
<span class="uk-margin-small-left uk-text-baseline">
|
</a>
|
||||||
<span class="uk-text-meta">Powered by </span>
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<!--Feedback-->
|
<!--Feedback-->
|
||||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -94,22 +94,19 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #graph_and_feedback_template>
|
<ng-template #graph_and_feedback_template>
|
||||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!projectInfo">
|
<div class="uk-flex uk-flex-between uk-flex-wrap uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!projectInfo">
|
||||||
<!-- Last Index Info-->
|
<!-- Last Index Info-->
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<icon name="graph" customClass="text-graph"></icon>
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||||
<span class="uk-margin-small-left uk-text-baseline">
|
</a>
|
||||||
<span class="uk-text-meta">Powered by </span>
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<!--Feedback-->
|
<!--Feedback-->
|
||||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -91,21 +91,18 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #graph_and_feedback_template>
|
<ng-template #graph_and_feedback_template>
|
||||||
<div class="uk-flex uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!resultLandingInfo">
|
<div class="uk-flex uk-flex-between uk-flex-wrap uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!resultLandingInfo">
|
||||||
<!-- Last Index Info-->
|
<!-- Last Index Info-->
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<icon name="graph" customClass="text-graph"></icon>
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||||
<span class="uk-margin-small-left uk-text-baseline">
|
</a>
|
||||||
<span class="uk-text-meta">Powered by </span>
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<!--Feedback-->
|
<!--Feedback-->
|
||||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||||
<span class="uk-text-meta uk-text-xsmall">See an issue? </span>
|
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||||
<a (click)="feedbackClicked()" class="uk-text-xsmall">Give us feedback</a>
|
<a (click)="feedbackClicked()" class="uk-text-xsmall">Give us feedback</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,8 +43,8 @@ export class UserComponent {
|
||||||
this.loginUrl = this.properties.loginUrl;
|
this.loginUrl = this.properties.loginUrl;
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
this.server = false;
|
this.server = false;
|
||||||
this.userManagementsService.getUserInfo().subscribe( user => {
|
this.userManagementsService.updateUserInfo( () => {
|
||||||
this.user = user;
|
this.user = this.userManagementsService.user;
|
||||||
this.loggedIn = !!this.user;
|
this.loggedIn = !!this.user;
|
||||||
this.errorMessage = "";
|
this.errorMessage = "";
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
|
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} 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';
|
||||||
import {Subscriber} from "rxjs";
|
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";
|
||||||
|
import {
|
||||||
|
NotificationConfiguration,
|
||||||
|
NotificationsSidebarComponent
|
||||||
|
} from "../notifications/notifications-sidebar/notifications-sidebar.component";
|
||||||
|
|
||||||
|
declare var UIkit;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'user-mini',
|
selector: 'user-mini',
|
||||||
|
@ -25,6 +31,7 @@ import {UserManagementService} from "../services/user-management.service";
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav">
|
<ul class="uk-nav uk-navbar-dropdown-nav">
|
||||||
<ng-container *ngFor="let item of userMenuItems ">
|
<ng-container *ngFor="let item of userMenuItems ">
|
||||||
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization"
|
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization"
|
||||||
|
[ngClass]="item.customClass"
|
||||||
[class.uk-active]="isTheActiveSubMenu(item)">
|
[class.uk-active]="isTheActiveSubMenu(item)">
|
||||||
<a *ngIf="item.route" [routerLink]="item.route"
|
<a *ngIf="item.route" [routerLink]="item.route"
|
||||||
[queryParams]="item.params">{{item.title}}</a>
|
[queryParams]="item.params">{{item.title}}</a>
|
||||||
|
@ -41,42 +48,67 @@ import {UserManagementService} from "../services/user-management.service";
|
||||||
<icon name="login" ratio="1.5" [flex]="true"></icon>
|
<icon name="login" ratio="1.5" [flex]="true"></icon>
|
||||||
</a>
|
</a>
|
||||||
<a *ngIf="loggedIn && mobileView" href="#account" class="login uk-icon" uk-toggle>
|
<a *ngIf="loggedIn && mobileView" href="#account" class="login uk-icon" uk-toggle>
|
||||||
<svg height="30" width="30">
|
<span class="uk-position-relative">
|
||||||
<circle cx="15" cy="15" r="15" stroke-width="2"></circle>
|
<svg height="30" width="30">
|
||||||
<text x="50%" y="50%" text-anchor="middle" dy=".35em" font-size="14">
|
<circle cx="15" cy="15" r="15" stroke-width="2"></circle>
|
||||||
{{firstLetters ? firstLetters : 'AN'}}
|
<text x="50%" y="50%" text-anchor="middle" dy=".35em" font-size="14">
|
||||||
</text>
|
{{firstLetters ? firstLetters : 'AN'}}
|
||||||
</svg>
|
</text>
|
||||||
|
</svg>
|
||||||
|
<span *ngIf="notificationsSidebar?.unreadCount > 0" class="uk-text-secondary notification">
|
||||||
|
<icon name="circle" ratio="0.8"></icon>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="loggedIn" id="account" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true">
|
<div *ngIf="loggedIn" #account id="account" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true;">
|
||||||
<div class="uk-offcanvas-bar uk-padding-remove-horizontal">
|
<div class="uk-offcanvas-bar uk-padding-remove">
|
||||||
<button class="uk-offcanvas-close uk-icon uk-close">
|
<nav class="uk-navbar uk-background-default" uk-sticky>
|
||||||
<icon name="close" ratio="1.5" visuallyHidden="close menu"></icon>
|
<div class="uk-navbar-right">
|
||||||
</button>
|
<button class="uk-navbar-toggle uk-icon uk-close" (click)="closeCanvas(account)">
|
||||||
<div class="uk-padding uk-flex uk-flex-middle">
|
<icon name="close" ratio="1.5" visuallyHidden="close account"></icon>
|
||||||
<div class="login">
|
</button>
|
||||||
<svg height="60" width="60" style="max-width: 60px; height: 60px;">
|
|
||||||
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
|
||||||
<text x="50%" y="50%" text-anchor="middle" dy=".4em" font-size="16">
|
|
||||||
{{firstLetters ? firstLetters : 'AN'}}
|
|
||||||
</text>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
<h5 class="uk-margin-small-left uk-margin-remove-bottom uk-margin-remove-top uk-text-truncate">
|
</nav>
|
||||||
{{user.fullname}}
|
<ng-container *ngIf="!showNotifications">
|
||||||
</h5>
|
<div class="uk-padding uk-padding-remove-top uk-flex uk-flex-middle">
|
||||||
</div>
|
<div class="login">
|
||||||
<ul class="uk-nav uk-nav-primary uk-list uk-margin-top uk-nav-parent-icon" uk-nav>
|
<svg height="60" width="60" style="max-width: 60px; height: 60px;">
|
||||||
<ng-container *ngFor="let item of userMenuItems ">
|
<circle cx="30" cy="30" r="20" stroke-width="2"></circle>
|
||||||
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization">
|
<text x="50%" y="50%" text-anchor="middle" dy=".4em" font-size="16">
|
||||||
<a *ngIf="item.route" [routerLink]="item.route" (click)="closeCanvas()">{{item.title}}</a>
|
{{firstLetters ? firstLetters : 'AN'}}
|
||||||
<a *ngIf="!item.route && item.url" (click)="closeCanvas()" [href]="item.url" [class.custom-external]="item.target != '_self'"
|
</text>
|
||||||
[target]="item.target">{{item.title}}</a>
|
</svg>
|
||||||
</li>
|
</div>
|
||||||
</ng-container>
|
<h5 class="uk-margin-small-left uk-margin-remove-bottom uk-margin-remove-top uk-text-truncate">
|
||||||
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
{{user.fullname}}
|
||||||
<li><a (click)="logOut()">Log out</a></li>
|
</h5>
|
||||||
</ul>
|
</div>
|
||||||
|
<ul class="uk-nav uk-nav-primary uk-list uk-margin-top uk-nav-parent-icon" uk-nav>
|
||||||
|
<ng-container *ngFor="let item of userMenuItems ">
|
||||||
|
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization" [ngClass]="item.customClass">
|
||||||
|
<a *ngIf="item.route" [routerLink]="item.route" (click)="closeCanvas(account)">{{item.title}}</a>
|
||||||
|
<a *ngIf="!item.route && item.url" (click)="closeCanvas(account)" [href]="item.url" [class.custom-external]="item.target != '_self'"
|
||||||
|
[target]="item.target">{{item.title}}</a>
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="notificationConfiguration">
|
||||||
|
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
||||||
|
<li *ngIf="notificationConfiguration">
|
||||||
|
<a (click)="toggleNotifications()">
|
||||||
|
<div class="uk-flex uk-flex-middle uk-width-1-1">
|
||||||
|
<span class="uk-width-expand">Notifications</span>
|
||||||
|
<icon *ngIf="notificationsSidebar?.unreadCount > 0" class="uk-margin-small-left uk-text-secondary uk-margin-right" name="circle" [flex]="true" ratio="0.8"></icon>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
<li *ngIf="userMenuItems.length > 0" class="uk-nav-divider"></li>
|
||||||
|
<li><a (click)="logOut()">Log out</a></li>
|
||||||
|
</ul>
|
||||||
|
</ng-container>
|
||||||
|
<notification-sidebar [class.uk-hidden]="!showNotifications" #notificationsSidebar *ngIf="notificationConfiguration" [mobile]="true"
|
||||||
|
(showNotificationsEmitter)="showNotifications = $event"
|
||||||
|
[configuration]="notificationConfiguration" [user]="user"></notification-sidebar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -95,7 +127,9 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
@Input() logInUrl;
|
@Input() logInUrl;
|
||||||
@Input() logOutUrl;
|
@Input() logOutUrl;
|
||||||
@Input() cookieDomain;
|
@Input() cookieDomain;
|
||||||
@Output() closeCanvasEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
|
@Input() notificationConfiguration: NotificationConfiguration;
|
||||||
|
@ViewChild('notificationsSidebar') notificationsSidebar: NotificationsSidebarComponent;
|
||||||
|
public showNotifications = false;
|
||||||
private subscriptions = [];
|
private subscriptions = [];
|
||||||
|
|
||||||
constructor(private router: Router, private route: ActivatedRoute, private userManagementService: UserManagementService) {
|
constructor(private router: Router, private route: ActivatedRoute, private userManagementService: UserManagementService) {
|
||||||
|
@ -122,8 +156,8 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
closeCanvas() {
|
closeCanvas(canvas) {
|
||||||
this.closeCanvasEmitter.emit(true);
|
UIkit.offcanvas(canvas).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
initUser() {
|
initUser() {
|
||||||
|
@ -166,4 +200,8 @@ export class UserMiniComponent implements OnInit, OnChanges {
|
||||||
this.firstLetters += matches.join('');
|
this.firstLetters += matches.join('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleNotifications() {
|
||||||
|
this.showNotifications = !this.showNotifications;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,11 @@ import {UserMiniComponent} from "./userMini.component";
|
||||||
import {IconsModule} from "../utils/icons/icons.module";
|
import {IconsModule} from "../utils/icons/icons.module";
|
||||||
import {IconsService} from "../utils/icons/icons.service";
|
import {IconsService} from "../utils/icons/icons.service";
|
||||||
import {login} from "../utils/icons/icons";
|
import {login} from "../utils/icons/icons";
|
||||||
|
import {NotificationsSidebarModule} from "../notifications/notifications-sidebar/notifications-sidebar.module";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule, IconsModule
|
CommonModule, FormsModule, RouterModule, IconsModule, NotificationsSidebarModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
UserMiniComponent
|
UserMiniComponent
|
||||||
|
|
|
@ -165,6 +165,7 @@ export class Indicator {
|
||||||
visibility: Visibility;
|
visibility: Visibility;
|
||||||
defaultId: string;
|
defaultId: string;
|
||||||
indicatorPaths: IndicatorPath[];
|
indicatorPaths: IndicatorPath[];
|
||||||
|
descriptionOverlay: boolean = false;
|
||||||
|
|
||||||
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
|
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
|
||||||
this._id = null;
|
this._id = null;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications .notification-list {
|
#notifications .notification-list {
|
||||||
padding: @global-medium-gutter 0 @global-medium-gutter @global-medium-gutter;
|
padding: 0 @global-medium-gutter;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications .notification-list:not(:last-child) {
|
#notifications .notification-list:not(:last-child) {
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
#notifications .notification-list ul {
|
#notifications .notification-list ul {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 20px @global-medium-gutter 20px 0;
|
padding: 20px @global-medium-gutter 20px 0;
|
||||||
height: calc(100% - 104px);
|
height: calc(100% - 150px);
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications .notification-list ul > li:nth-child(n+2){
|
#notifications .notification-list ul > li:nth-child(n+2){
|
||||||
|
@ -29,6 +29,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#notifications .notification {
|
#notifications .notification {
|
||||||
padding: @global-medium-gutter @global-medium-gutter;
|
padding: 0 @global-medium-gutter @global-medium-gutter @global-medium-gutter;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
import {Component, Input, OnDestroy, OnInit, ViewEncapsulation} from "@angular/core";
|
import {
|
||||||
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
ViewChild,
|
||||||
|
ViewEncapsulation
|
||||||
|
} from "@angular/core";
|
||||||
import {Notification} from "../notifications";
|
import {Notification} from "../notifications";
|
||||||
import {NotificationService} from "../notification.service";
|
import {NotificationService} from "../notification.service";
|
||||||
import {Subscription} from "rxjs";
|
import {Subscription} from "rxjs";
|
||||||
|
@ -8,71 +18,92 @@ import {Option} from "../../sharedComponents/input/input.component";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
export class NotificationConfiguration {
|
||||||
|
availableGroups: Option[] = [];
|
||||||
|
entities: string[] = [];
|
||||||
|
service: string;
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'notification-sidebar',
|
selector: 'notification-sidebar',
|
||||||
template: `
|
template: `
|
||||||
<div id="notifications-switcher" uk-toggle="" href="#notifications" class="uk-offcanvas-switcher uk-flex uk-flex-middle uk-flex-center">
|
<div *ngIf="!mobile" id="notifications-switcher" uk-toggle="" href="#notifications" class="uk-offcanvas-switcher uk-flex uk-flex-middle uk-flex-center">
|
||||||
<icon name="mail" ratio="1.5" customClass="uk-text-background" flex="true" visuallyHidden="Notifications"></icon>
|
<icon name="mail" ratio="1.5" customClass="uk-text-background" flex="true" visuallyHidden="Notifications"></icon>
|
||||||
<span [class.uk-hidden]="unreadCount === 0" class="uk-offcanvas-count uk-flex uk-flex-middle uk-flex-center">
|
<span [class.uk-hidden]="unreadCount === 0" class="uk-offcanvas-count uk-flex uk-flex-middle uk-flex-center">
|
||||||
{{unreadCount}}
|
{{unreadCount}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="notifications" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true;">
|
<ng-template #main>
|
||||||
<div class="uk-offcanvas-bar uk-padding-remove">
|
<ng-container *ngIf="!notification">
|
||||||
<button class="uk-offcanvas-close uk-close uk-icon" type="button">
|
<div class="notification-list uk-position-relative">
|
||||||
<icon name="close" ratio="1.5" visuallyHidden="close"></icon>
|
<h4 class="uk-flex uk-flex-middle clickable uk-margin-remove-top uk-margin-medium-bottom" (click)="showNotificationsEmitter.emit(false)">
|
||||||
</button>
|
<span *ngIf="mobile" class="uk-margin-right">
|
||||||
<ng-template [ngIf]="!notification">
|
<icon ratio="1.5" name="west" visuallyHidden="back" [flex]="true"></icon>
|
||||||
<div class="notification-list uk-position-relative">
|
|
||||||
<h4>Notifications</h4>
|
|
||||||
<div class="uk-flex uk-flex-right@m uk-flex-center uk-padding uk-padding-remove-vertical">
|
|
||||||
<button [disabled]="unreadCount === 0" (click)="readAll()" class="uk-button uk-button-link">Mark As Read ({{unreadCount}})</button>
|
|
||||||
</div>
|
|
||||||
<h6 *ngIf="notifications.length == 0" class="uk-position-center uk-margin-remove">No notifications</h6>
|
|
||||||
<ul *ngIf="notifications.length > 0" class="uk-list">
|
|
||||||
<li *ngFor="let notification of notifications; let i=index" class="clickable" (click)="select(notification)">
|
|
||||||
<div class="uk-grid uk-grid-small" uk-grid>
|
|
||||||
<notification-user [name]="notification.name" [surname]="notification.surname" [outline]="true"
|
|
||||||
colorClass="uk-text-secondary"></notification-user>
|
|
||||||
<div class="uk-width-expand">
|
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
|
||||||
<div class="uk-width-expand multi-line-ellipsis lines-2">
|
|
||||||
<p class="uk-margin-remove" [class.uk-text-light-grey]="notification.read">
|
|
||||||
{{notification.preview}}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="uk-margin-left uk-flex uk-flex-center uk-text-secondary">
|
|
||||||
<icon *ngIf="!notification.read" name="circle" ratio="0.6" visuallyHidden="unread"></icon>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<span class="uk-text-secondary uk-text-small">{{getDate(notification.date)}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="availableGroups.length > 0" [availableGroups]="availableGroups" [entities]="entities" [service]="service" notify-form class="notify"></div>
|
|
||||||
</ng-template>
|
|
||||||
<div *ngIf="notification" class="notification">
|
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-bottom">
|
|
||||||
<span class="uk-text-secondary clickable" (click)="back($event)">
|
|
||||||
<icon ratio="1.5" name="west" visuallyHidden="back"></icon>
|
|
||||||
</span>
|
</span>
|
||||||
<h4 *ngIf="notification.title" class="uk-text-bold uk-margin-left">{{notification.title}}</h4>
|
<div class="uk-text-bold">Notifications</div>
|
||||||
|
</h4>
|
||||||
|
<div class="uk-flex uk-flex-right@m uk-flex-center uk-padding uk-padding-remove-vertical">
|
||||||
|
<button [disabled]="unreadCount === 0" (click)="readAll()" class="uk-button uk-button-link">Mark As Read ({{unreadCount}})</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-flex uk-flex-middle uk-margin-medium-bottom">
|
<h6 *ngIf="notifications.length == 0" class="uk-position-center uk-margin-remove">No notifications</h6>
|
||||||
<notification-user [name]="notification.name" [surname]="notification.surname" colorClass="uk-text-secondary" [outline]="true"></notification-user>
|
<ul *ngIf="notifications.length > 0" class="uk-list">
|
||||||
<div class="uk-margin-left">
|
<li *ngFor="let notification of notifications; let i=index" class="clickable" (click)="select(notification)">
|
||||||
{{notification.name + ' ' + notification.surname}}<br>
|
<div class="uk-grid uk-grid-small" uk-grid>
|
||||||
<span style="opacity: 0.8;" class="uk-text-small uk-margin-small-top">
|
<notification-user [name]="notification.name" [surname]="notification.surname" [outline]="true"
|
||||||
|
colorClass="uk-text-secondary"></notification-user>
|
||||||
|
<div class="uk-width-expand">
|
||||||
|
<div class="uk-width-1-1 uk-flex uk-flex-middle">
|
||||||
|
<div class="uk-width-expand multi-line-ellipsis lines-2">
|
||||||
|
<p class="uk-margin-remove" [class.uk-text-light-grey]="notification.read">
|
||||||
|
{{notification.preview}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-left uk-flex uk-flex-center uk-text-secondary">
|
||||||
|
<icon *ngIf="!notification.read" name="circle" ratio="0.6" visuallyHidden="unread"></icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="uk-text-secondary uk-text-small">{{getDate(notification.date)}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="configuration.availableGroups.length > 0" [availableGroups]="configuration.availableGroups" [entities]="configuration.entities" [service]="configuration.service" notify-form class="notify"></div>
|
||||||
|
</ng-container>
|
||||||
|
<div *ngIf="notification" class="notification">
|
||||||
|
<h4 class="uk-flex uk-flex-middle clickable uk-margin-remove-top uk-margin-medium-bottom" (click)="back($event)">
|
||||||
|
<span class="uk-margin-right">
|
||||||
|
<icon ratio="1.5" name="west" visuallyHidden="back" [flex]="true"></icon>
|
||||||
|
</span>
|
||||||
|
<div *ngIf="notification.title" class="uk-text-bold">{{notification.title}}</div>
|
||||||
|
</h4>
|
||||||
|
<div class="uk-flex uk-flex-middle uk-margin-medium-bottom">
|
||||||
|
<notification-user [name]="notification.name" [surname]="notification.surname" colorClass="uk-text-secondary" [outline]="true"></notification-user>
|
||||||
|
<div class="uk-margin-left">
|
||||||
|
{{notification.name + ' ' + notification.surname}}<br>
|
||||||
|
<span style="opacity: 0.8;" class="uk-text-small uk-margin-small-top">
|
||||||
{{notification.date | date:'medium'}} ({{getDate(notification.date)}})
|
{{notification.date | date:'medium'}} ({{getDate(notification.date)}})
|
||||||
</span>
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div [innerHTML]="notification.message | safeHtml">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div [innerHTML]="notification.message | safeHtml">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<div *ngIf="!mobile" #canvas id="notifications" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true;">
|
||||||
|
<div class="uk-offcanvas-bar uk-padding-remove">
|
||||||
|
<nav class="uk-navbar uk-background-default" uk-sticky>
|
||||||
|
<div class="uk-navbar-right">
|
||||||
|
<button class="uk-navbar-toggle uk-icon uk-close" (click)="closeCanvas(canvas)">
|
||||||
|
<icon name="close" ratio="1.5" visuallyHidden="close account"></icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<ng-container *ngTemplateOutlet="main"></ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="mobile" id="notifications">
|
||||||
|
<ng-container *ngTemplateOutlet="main"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
styleUrls: ['notification-sidebar.component.less'],
|
styleUrls: ['notification-sidebar.component.less'],
|
||||||
|
@ -81,13 +112,13 @@ declare var UIkit;
|
||||||
export class NotificationsSidebarComponent implements OnInit, OnDestroy {
|
export class NotificationsSidebarComponent implements OnInit, OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
public user: User;
|
public user: User;
|
||||||
|
@Input()
|
||||||
|
public mobile: boolean = false;
|
||||||
|
@Input()
|
||||||
|
public configuration: NotificationConfiguration;
|
||||||
|
@Output()
|
||||||
|
public showNotificationsEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||||
public notifications: Notification[] = [];
|
public notifications: Notification[] = [];
|
||||||
@Input()
|
|
||||||
public availableGroups: Option[] = [];
|
|
||||||
@Input()
|
|
||||||
public entities: string[] = [];
|
|
||||||
@Input()
|
|
||||||
public service: string;
|
|
||||||
public notification: Notification;
|
public notification: Notification;
|
||||||
private subscriptions: any[] = [];
|
private subscriptions: any[] = [];
|
||||||
|
|
||||||
|
@ -95,7 +126,7 @@ export class NotificationsSidebarComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.subscriptions.push(this.notificationService.getNotifications(this.service).subscribe(notifications => {
|
this.subscriptions.push(this.notificationService.getNotifications(this.configuration.service).subscribe(notifications => {
|
||||||
this.notifications = notifications;
|
this.notifications = notifications;
|
||||||
}, error => {
|
}, error => {
|
||||||
this.notifications = [];
|
this.notifications = [];
|
||||||
|
@ -141,8 +172,12 @@ export class NotificationsSidebarComponent implements OnInit, OnDestroy {
|
||||||
this.notification = null;
|
this.notification = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeCanvas(canvas) {
|
||||||
|
UIkit.offcanvas(canvas).hide();
|
||||||
|
}
|
||||||
|
|
||||||
readAll() {
|
readAll() {
|
||||||
this.notificationService.markAllAsRead(this.service).subscribe(() => {
|
this.notificationService.markAllAsRead(this.configuration.service).subscribe(() => {
|
||||||
this.notifications.forEach(notification => {
|
this.notifications.forEach(notification => {
|
||||||
notification.read = true;
|
notification.read = true;
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {UntypedFormArray, UntypedFormBuilder} from "@angular/forms";
|
||||||
import {properties} from "../../../../environments/environment";
|
import {properties} from "../../../../environments/environment";
|
||||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||||
import {StringUtils} from "../../utils/string-utils.class";
|
import {StringUtils} from "../../utils/string-utils.class";
|
||||||
|
import {ISVocabulariesService} from "../../utils/staticAutoComplete/ISVocabularies.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sdg-selection',
|
selector: 'sdg-selection',
|
||||||
|
@ -20,14 +21,14 @@ export class SdgSelectionComponent {
|
||||||
public sdgs: UntypedFormArray;
|
public sdgs: UntypedFormArray;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpClient: HttpClient,
|
private vocabulariesService: ISVocabulariesService,
|
||||||
private fb: UntypedFormBuilder
|
private fb: UntypedFormBuilder
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.sdgs = this.fb.array([]);
|
this.sdgs = this.fb.array([]);
|
||||||
this.httpClient.get(this.properties.domain+'/assets/common-assets/vocabulary/sdg.json').subscribe(data => {
|
this.vocabulariesService.getSDGs(properties).subscribe(data => {
|
||||||
data['sdg'].forEach(element => {
|
data['sdg'].forEach(element => {
|
||||||
// this.sdgs.push({code: element.code, id: element.id, label: element.label, html: element.html, checked: this.subjects?.includes(element.id)});
|
// this.sdgs.push({code: element.code, id: element.id, label: element.label, html: element.html, checked: this.subjects?.includes(element.id)});
|
||||||
this.sdgs.push(this.fb.group({
|
this.sdgs.push(this.fb.group({
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {Router} from '@angular/router';
|
||||||
import {Meta, Title} from "@angular/platform-browser";
|
import {Meta, Title} from "@angular/platform-browser";
|
||||||
import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
import {SEOService} from "../sharedComponents/SEO/SEO.service";
|
||||||
import {PiwikService} from "../utils/piwik/piwik.service";
|
import {PiwikService} from "../utils/piwik/piwik.service";
|
||||||
|
import {ISVocabulariesService} from "../utils/staticAutoComplete/ISVocabularies.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sdg',
|
selector: 'sdg',
|
||||||
|
@ -36,7 +37,7 @@ export class SdgComponent implements OnInit, OnDestroy {
|
||||||
subscriptions: Subscription[] = [];
|
subscriptions: Subscription[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpClient: HttpClient, private refineFieldResultsService: RefineFieldResultsService,
|
private vocabulariesService: ISVocabulariesService, private refineFieldResultsService: RefineFieldResultsService,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title,
|
private _title: Title,
|
||||||
|
@ -54,7 +55,7 @@ export class SdgComponent implements OnInit, OnDestroy {
|
||||||
this.updateUrl(this.url);
|
this.updateUrl(this.url);
|
||||||
this.updateTitle(this.pageTitle);
|
this.updateTitle(this.pageTitle);
|
||||||
this.updateDescription(this.pageDescription);
|
this.updateDescription(this.pageDescription);
|
||||||
this.httpClient.get(properties.domain+'/assets/common-assets/vocabulary/sdg.json').subscribe(data => {
|
this.vocabulariesService.getSDGs(properties).subscribe(data => {
|
||||||
this.sdgs = data['sdg'];
|
this.sdgs = data['sdg'];
|
||||||
});
|
});
|
||||||
let refineParams = null;
|
let refineParams = null;
|
||||||
|
|
|
@ -326,16 +326,12 @@
|
||||||
[isDisabled]="disabled" [isMobile]="mobile">
|
[isDisabled]="disabled" [isMobile]="mobile">
|
||||||
</search-paging>
|
</search-paging>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showIndexInfo && searchUtils.status !== errorCodes.LOADING" class="uk-margin-large-top uk-grid uk-child-width-1-2 uk-text-small">
|
<div *ngIf="showIndexInfo && searchUtils.status !== errorCodes.LOADING" class="uk-margin-large-top uk-flex uk-flex-between uk-flex-wrap uk-text-small">
|
||||||
<!-- Last Index Info-->
|
<!-- Last Index Info-->
|
||||||
<div>
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@m">
|
||||||
<icon name="graph" customClass="text-graph"></icon>
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 17px;">
|
||||||
<span class="uk-margin-small-left uk-text-baseline">
|
</a>
|
||||||
<span class="uk-text-meta">Powered by </span>
|
<div class="uk-width-1-1 uk-width-auto@m">
|
||||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="uk-text-right">
|
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta">
|
||||||
<a *ngIf="properties.showLastIndexInformationLink" class="uk-link" [href]="properties.lastIndexInformationLink" target="_blank">Last update</a>
|
<a *ngIf="properties.showLastIndexInformationLink" class="uk-link" [href]="properties.lastIndexInformationLink" target="_blank">Last update</a>
|
||||||
<span *ngIf="!(properties.showLastIndexInformationLink)">Last update</span>
|
<span *ngIf="!(properties.showLastIndexInformationLink)">Last update</span>
|
||||||
|
|
|
@ -219,7 +219,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
|
||||||
public searchControl: UntypedFormControl;
|
public searchControl: UntypedFormControl;
|
||||||
public activeElement: BehaviorSubject<ElementRef> = new BehaviorSubject<ElementRef>(null);
|
public activeElement: BehaviorSubject<ElementRef> = new BehaviorSubject<ElementRef>(null);
|
||||||
/** Use modifier's class(es) to change view of your Input */
|
/** Use modifier's class(es) to change view of your Input */
|
||||||
@Input() inputClass: string = 'inner';
|
@Input() inputClass: string = 'flat';
|
||||||
/** Icon on the input */
|
/** Icon on the input */
|
||||||
@Input() icon: string = null;
|
@Input() icon: string = null;
|
||||||
/** Chip options */
|
/** Chip options */
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!onlyTop || userMenu" class="uk-navbar-right" [class.uk-light]='activeHeader.darkBg'>
|
<div *ngIf="!onlyTop || userMenu" class="uk-navbar-right" [class.uk-light]='activeHeader.darkBg'>
|
||||||
<ng-container *ngIf="userMenu">
|
<ng-container *ngIf="userMenu">
|
||||||
<user-mini [user]="user" mobileView=true (closeCanvasEmitter)="closeCanvas(canvas)"
|
<user-mini [user]="user" mobileView=true
|
||||||
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl
|
[userMenuItems]=userMenuItems [logInUrl]=properties.loginUrl [notificationConfiguration]="notificationConfiguration"
|
||||||
[logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain></user-mini>
|
[logOutUrl]=properties.logoutUrl [cookieDomain]=properties.cookieDomain></user-mini>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {Subscription} from 'rxjs';
|
||||||
import {HelpContentService} from '../services/help-content.service';
|
import {HelpContentService} from '../services/help-content.service';
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from "../../../environments/environment";
|
||||||
import {LayoutService} from "../dashboard/sharedComponents/sidebar/layout.service";
|
import {LayoutService} from "../dashboard/sharedComponents/sidebar/layout.service";
|
||||||
|
import {NotificationConfiguration} from "../notifications/notifications-sidebar/notifications-sidebar.component";
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
|
|
||||||
|
@ -48,6 +49,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
@Input() searchRoute: string = '/search/find';
|
@Input() searchRoute: string = '/search/find';
|
||||||
@Input() searchPlaceHolder: string = 'Search for research results';
|
@Input() searchPlaceHolder: string = 'Search for research results';
|
||||||
@Input() showLogo: boolean = true;
|
@Input() showLogo: boolean = true;
|
||||||
|
@Input() notificationConfiguration: NotificationConfiguration;
|
||||||
replaceHeader: boolean = false;
|
replaceHeader: boolean = false;
|
||||||
public activeHeader: Header;
|
public activeHeader: Header;
|
||||||
keyword: string = '';
|
keyword: string = '';
|
||||||
|
|
|
@ -27,21 +27,21 @@ declare var UIkit;
|
||||||
[attr.uk-switcher]="type === 'static'?('connect:' + connect):null"
|
[attr.uk-switcher]="type === 'static'?('connect:' + connect):null"
|
||||||
[ngClass]="'uk-flex-' + flexPosition + ' ' + tabsClass">
|
[ngClass]="'uk-flex-' + flexPosition + ' ' + tabsClass">
|
||||||
<ng-container *ngIf="type === 'static'">
|
<ng-container *ngIf="type === 'static'">
|
||||||
<li *ngFor="let tab of leftTabs" style="max-width: 50%" class="uk-text-capitalize uk-text-truncate uk-display-block">
|
<li *ngFor="let tab of leftTabs" [ngStyle]="" [style.max-width]="(position === 'horizontal')?'50%':null" class="uk-text-capitalize uk-text-truncate uk-display-block">
|
||||||
<a>{{tab.title}}</a>
|
<a>{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngFor="let tab of rightTabs; let i=index;" style="max-width: 50%" [ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
<li *ngFor="let tab of rightTabs; let i=index;" [style.max-width]="(position === 'horizontal')?'50%':null" [ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
||||||
class="uk-text-capitalize uk-text-truncate uk-display-block">
|
class="uk-text-capitalize uk-text-truncate uk-display-block">
|
||||||
<a [ngClass]="tab.customClass">{{tab.title}}</a>
|
<a [ngClass]="tab.customClass">{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="type === 'dynamic'">
|
<ng-container *ngIf="type === 'dynamic'">
|
||||||
<li *ngFor="let tab of leftTabs; let i=index;" [class.uk-active]="tab.active" style="max-width: 50%">
|
<li *ngFor="let tab of leftTabs; let i=index;" [class.uk-active]="tab.active" [style.max-width]="(position === 'horizontal')?'50%':null">
|
||||||
<a [routerLink]="tab.routerLink" [queryParams]="tab.queryParams" [ngClass]="tab.customClass"
|
<a [routerLink]="tab.routerLink" [queryParams]="tab.queryParams" [ngClass]="tab.customClass"
|
||||||
(click)="showActive(i)"
|
(click)="showActive(i)"
|
||||||
class="uk-text-capitalize uk-text-truncate uk-display-block">{{tab.title}}</a>
|
class="uk-text-capitalize uk-text-truncate uk-display-block">{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngFor="let tab of rightTabs; let i=index;" style="max-width: 50%" [class.uk-active]="tab.active"
|
<li *ngFor="let tab of rightTabs; let i=index;" [style.max-width]="(position === 'horizontal')?'50%':null" [class.uk-active]="tab.active"
|
||||||
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''">
|
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''">
|
||||||
<a [routerLink]="tab.routerLink" [queryParams]="tab.queryParams" [ngClass]="tab.customClass"
|
<a [routerLink]="tab.routerLink" [queryParams]="tab.queryParams" [ngClass]="tab.customClass"
|
||||||
(click)="showActive(i)"
|
(click)="showActive(i)"
|
||||||
|
@ -49,10 +49,10 @@ declare var UIkit;
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="type === 'scrollable'">
|
<ng-container *ngIf="type === 'scrollable'">
|
||||||
<li *ngFor="let tab of leftTabs" style="max-width: 50%" class="uk-text-capitalize uk-text-truncate uk-display-block" [class.uk-active]="tab.active">
|
<li *ngFor="let tab of leftTabs" [style.max-width]="(position === 'horizontal')?'50%':null" class="uk-text-capitalize uk-text-truncate uk-display-block" [class.uk-active]="tab.active">
|
||||||
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge" [ngClass]="tab.customClass">{{tab.title}}</a>
|
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge" [ngClass]="tab.customClass">{{tab.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
<li *ngFor="let tab of rightTabs; let i=index;" style="max-width: 50%" class="uk-text-capitalize uk-text-truncate uk-display-block"
|
<li *ngFor="let tab of rightTabs; let i=index;" [style.max-width]="(position === 'horizontal')?'50%':null" class="uk-text-capitalize uk-text-truncate uk-display-block"
|
||||||
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
|
||||||
[class.uk-active]="tab.active">
|
[class.uk-active]="tab.active">
|
||||||
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge" [ngClass]="tab.customClass">{{tab.title}}</a>
|
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge" [ngClass]="tab.customClass">{{tab.title}}</a>
|
||||||
|
@ -206,6 +206,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
public showActive(index) {
|
public showActive(index) {
|
||||||
this.activeIndex = index;
|
this.activeIndex = index;
|
||||||
|
this.activeEmitter.emit(this.tabs.get(this.activeIndex).id);
|
||||||
if(this.slider) {
|
if(this.slider) {
|
||||||
this.slider.show(this.activeIndex);
|
this.slider.show(this.activeIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,10 @@ import {FullPageSliderComponent} from "./full-page-slider.component";
|
||||||
import {SlideComponent} from "./slide.component";
|
import {SlideComponent} from "./slide.component";
|
||||||
import {BottomModule} from '../../sharedComponents/bottom.module';
|
import {BottomModule} from '../../sharedComponents/bottom.module';
|
||||||
import {IconsModule} from '../icons/icons.module';
|
import {IconsModule} from '../icons/icons.module';
|
||||||
import {IconsService} from '../icons/icons.service';
|
|
||||||
import {arrow_down, arrow_up} from '../icons/icons';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, BottomModule, IconsModule],
|
imports: [CommonModule, BottomModule, IconsModule],
|
||||||
declarations: [FullPageSliderComponent, SlideComponent],
|
declarations: [FullPageSliderComponent, SlideComponent],
|
||||||
exports: [FullPageSliderComponent, SlideComponent],
|
exports: [FullPageSliderComponent, SlideComponent],
|
||||||
})
|
})
|
||||||
export class FullPageSliderModule {
|
export class FullPageSliderModule {}
|
||||||
constructor(private iconsService: IconsService) {
|
|
||||||
this.iconsService.registerIcons([arrow_up, arrow_down]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
if(this.element) {
|
if(this.element && typeof document !== "undefined") {
|
||||||
this.subscriptions.push(UIkit.util.on(document, 'hide', '#' + this.id, () => {
|
this.subscriptions.push(UIkit.util.on(document, 'hide', '#' + this.id, () => {
|
||||||
this.cancelOutput.emit(true);
|
this.cancelOutput.emit(true);
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export enum Level {
|
export enum Level {
|
||||||
NONE,
|
ALL,
|
||||||
K,
|
K,
|
||||||
M,
|
M,
|
||||||
B
|
B
|
||||||
|
@ -14,7 +14,8 @@ export interface NumberSize {
|
||||||
|
|
||||||
export class NumberUtils {
|
export class NumberUtils {
|
||||||
|
|
||||||
public static roundNumber(num: number, level: Level = Level.NONE, decimal = 0): any {
|
public static roundNumber(num: number | string, level: Level = Level.ALL, decimal = 0): any {
|
||||||
|
num = Number.parseFloat(num.toString());
|
||||||
let roundNum: NumberSize;
|
let roundNum: NumberSize;
|
||||||
let initialNum = num;
|
let initialNum = num;
|
||||||
let variance = Math.pow(10, decimal);
|
let variance = Math.pow(10, decimal);
|
||||||
|
@ -30,11 +31,6 @@ export class NumberUtils {
|
||||||
num = num / 1000;
|
num = num / 1000;
|
||||||
num = Math.round(num * variance) / variance;
|
num = Math.round(num * variance) / variance;
|
||||||
roundNum = {number: num, size: "K", count: initialNum};
|
roundNum = {number: num, size: "K", count: initialNum};
|
||||||
} else if (num >= 100) {
|
|
||||||
num = num / 100;
|
|
||||||
num = Math.round(num * variance) / variance;
|
|
||||||
num = num * 100;
|
|
||||||
roundNum = {number: num, size: "", count: initialNum};
|
|
||||||
} else {
|
} else {
|
||||||
roundNum = {number: num, size: "", count: initialNum};
|
roundNum = {number: num, size: "", count: initialNum};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,23 @@ import {DecimalPipe} from "@angular/common";
|
||||||
export class NumberRoundPipe implements PipeTransform {
|
export class NumberRoundPipe implements PipeTransform {
|
||||||
decimalPipe: DecimalPipe = new DecimalPipe("en");
|
decimalPipe: DecimalPipe = new DecimalPipe("en");
|
||||||
|
|
||||||
constructor() {}
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
transform(value: number, ...args: any[]): any {
|
/**
|
||||||
let level = Level.NONE;
|
* Args: Level: 0 (default): ALL, 1: K, 2: M, 3:B
|
||||||
|
* Decimal: how many decimals should be shown (e.g 1 -> 62.1)
|
||||||
|
* */
|
||||||
|
transform(value: number | string, ...args: any[]): any {
|
||||||
|
let level = Level.ALL;
|
||||||
let decimal = 0;
|
let decimal = 0;
|
||||||
if(args[0]) {
|
if (args[0]) {
|
||||||
level = args[0];
|
level = args[0];
|
||||||
}
|
}
|
||||||
if(args[1]) {
|
if (args[1]) {
|
||||||
decimal = args[1];
|
decimal = args[1];
|
||||||
}
|
}
|
||||||
let size: NumberSize = NumberUtils.roundNumber(value, level, decimal);
|
let size: NumberSize = NumberUtils.roundNumber(value, level, decimal);
|
||||||
return this.decimalPipe.transform(size.number) + (size.size?'<span class="number-size">' + size.size + '</span>':'');
|
return this.decimalPipe.transform(size.number) + (size.size ? '<span class="number-size">' + size.size + '</span>' : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,22 +107,29 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
|
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
|
||||||
if(vocabularyName == "sdg"){
|
if(vocabularyName == "sdg"){
|
||||||
let url = properties.domain+"/assets/common-assets/vocabulary/sdg.json";
|
return this.getSDGs(properties)
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
|
||||||
//.map(res => <any> res.json())
|
|
||||||
.pipe(map(res => res['sdg']))
|
.pipe(map(res => res['sdg']))
|
||||||
.pipe(map(res => this.parseSDGs(res)))
|
.pipe(map(res => this.parseSDGs(res)))
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}else if( vocabularyName == "fos"){
|
}else if( vocabularyName == "fos"){
|
||||||
let url = properties.domain+"/assets/common-assets/vocabulary/fos.json";
|
return this.getFos(properties)
|
||||||
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
|
||||||
//.map(res => <any> res.json())
|
|
||||||
.pipe(map(res => res['fos']))
|
.pipe(map(res => res['fos']))
|
||||||
.pipe(map(res => this.parseFOS(res)))
|
.pipe(map(res => this.parseFOS(res)))
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getFos(properties: EnvProperties): Observable<any> {
|
||||||
|
let url = "/assets/common-assets/vocabulary/fos.json";
|
||||||
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
|
}
|
||||||
|
|
||||||
|
getSDGs(properties: EnvProperties): Observable<any> {
|
||||||
|
let url = "/assets/common-assets/vocabulary/sdg.json";
|
||||||
|
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
|
}
|
||||||
|
|
||||||
parseSDGs(data: any): AutoCompleteValue[] {
|
parseSDGs(data: any): AutoCompleteValue[] {
|
||||||
var array: AutoCompleteValue[] = []
|
var array: AutoCompleteValue[] = []
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
@ -160,6 +167,7 @@ export class ISVocabulariesService {
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
parse(data: any, vocabularyName: string): AutoCompleteValue[] {
|
parse(data: any, vocabularyName: string): AutoCompleteValue[] {
|
||||||
var array: AutoCompleteValue[] = []
|
var array: AutoCompleteValue[] = []
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
|
|
@ -261,9 +261,9 @@ export class Identifier {
|
||||||
|
|
||||||
export class StringUtils {
|
export class StringUtils {
|
||||||
|
|
||||||
public static urlRegex = 'https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.' +
|
public static urlRegex = 'https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www(2?)\\.' +
|
||||||
'[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.' +
|
'[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9]+\\.[^\\s]{2,}|www(2?)\\.' +
|
||||||
'[a-zA-Z0-9]+\.[^\s]{2,}';
|
'[a-zA-Z0-9]+\\.[^\\s]{2,}';
|
||||||
|
|
||||||
public static routeRegex = '^[a-zA-Z0-9\/][a-zA-Z0-9\/-]*$';
|
public static routeRegex = '^[a-zA-Z0-9\/][a-zA-Z0-9\/-]*$';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue