Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
3fd2616445
|
@ -13,6 +13,7 @@
|
|||
</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
|
||||
|
@ -23,6 +24,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div inner>
|
||||
<div class="uk-container">
|
||||
<div *ngIf="myForm" style="min-height: 60vh"
|
||||
|
@ -56,7 +58,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div [ngClass]="parentClass">
|
||||
<ckeditor (change)="contentChanged()"
|
||||
<ckeditor #ckEditor (change)="contentChanged()"
|
||||
[readonly]="false"
|
||||
debounce="500"
|
||||
[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 {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
||||
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 {NotificationHandler} from "../../utils/notification-handler";
|
||||
import {ClearCacheService} from "../../services/clear-cache.service";
|
||||
import {CKEditorComponent} from "ng2-ckeditor";
|
||||
|
||||
@Component({
|
||||
selector: 'class-content-form',
|
||||
|
@ -27,9 +28,11 @@ export class ClassContentFormComponent implements OnInit {
|
|||
public showLoading: boolean = true;
|
||||
private subs: Subscription[] = [];
|
||||
public pageHelpContent: DivHelpContent;
|
||||
@ViewChild('ckEditor') ckEditor: CKEditorComponent;
|
||||
|
||||
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() {
|
||||
|
@ -68,6 +71,7 @@ export class ClassContentFormComponent implements OnInit {
|
|||
if (!this.pageContentId) {
|
||||
this.updateForm(null);
|
||||
this.showLoading = false;
|
||||
this.initCKEditor();
|
||||
} else {
|
||||
this.subs.push(this._helpContentService.getDivHelpContent(this.pageContentId, this.properties.adminToolsAPIURL, this.portal).subscribe(pageHelpContent => {
|
||||
this.pageHelpContent = pageHelpContent;
|
||||
|
@ -76,6 +80,7 @@ export class ClassContentFormComponent implements OnInit {
|
|||
}
|
||||
this.updateForm(this.pageHelpContent);
|
||||
this.showLoading = false;
|
||||
this.initCKEditor();
|
||||
},
|
||||
error => {
|
||||
this.handleError('System error retrieving content by id ' + this.pageContentId, error)
|
||||
|
@ -85,6 +90,23 @@ export class ClassContentFormComponent implements OnInit {
|
|||
|
||||
}
|
||||
|
||||
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) {
|
||||
this.pageHelpContent = pageHelpContent;
|
||||
this.myForm = this.form;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
</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
|
||||
|
@ -23,6 +24,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div inner>
|
||||
<div class="uk-container">
|
||||
<div *ngIf="myForm" style="min-height: 60vh"
|
||||
|
@ -60,7 +62,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div [ngClass]="parentClass">
|
||||
<ckeditor (change)="contentChanged()"
|
||||
<ckeditor #ckEditor (change)="contentChanged()"
|
||||
[readonly]="false"
|
||||
debounce="500"
|
||||
[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 {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
||||
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 {ClearCacheService} from "../../services/clear-cache.service";
|
||||
import {NotificationHandler} from "../../utils/notification-handler";
|
||||
import {CKEditorComponent} from "ng2-ckeditor";
|
||||
|
||||
@Component({
|
||||
selector: 'page-content-form',
|
||||
|
@ -29,9 +30,11 @@ export class PageContentFormComponent implements OnInit {
|
|||
public showLoading: boolean = true;
|
||||
private subs: Subscription[] = [];
|
||||
public pageHelpContent: PageHelpContent;
|
||||
@ViewChild('ckEditor') ckEditor: CKEditorComponent;
|
||||
|
||||
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() {
|
||||
|
@ -80,12 +83,30 @@ export class PageContentFormComponent implements OnInit {
|
|||
this.updateForm(this.pageHelpContent);
|
||||
}
|
||||
this.showLoading = false;
|
||||
this.initCKEditor();
|
||||
},
|
||||
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) {
|
||||
this.pageHelpContent = pageHelpContent;
|
||||
this.myForm = this.form;
|
||||
|
|
|
@ -122,7 +122,9 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
ngOnDestroy() {
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -85,7 +85,7 @@ export class LayoutService {
|
|||
this.subscriptions.forEach(subscription => {
|
||||
if (subscription instanceof Subscriber) {
|
||||
subscription.unsubscribe();
|
||||
} else if (subscription instanceof ResizeObserver) {
|
||||
} else if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) {
|
||||
subscription.disconnect();
|
||||
}
|
||||
})
|
||||
|
|
|
@ -55,22 +55,19 @@
|
|||
</div>
|
||||
|
||||
<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-->
|
||||
<div class="uk-width-2-3@m uk-width-1-2">
|
||||
<icon name="graph" customClass="text-graph"></icon>
|
||||
<span class="uk-margin-small-left uk-text-baseline">
|
||||
<span class="uk-text-meta">Powered by </span>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||
</a>
|
||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</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-->
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -54,22 +54,19 @@
|
|||
|
||||
<!-- Graph and feedback -->
|
||||
<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-->
|
||||
<div class="uk-width-2-3@m uk-width-1-2">
|
||||
<icon name="graph" customClass="text-graph"></icon>
|
||||
<span class="uk-margin-small-left uk-text-baseline">
|
||||
<span class="uk-text-meta">Powered by </span>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||
</a>
|
||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</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-->
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -94,22 +94,19 @@
|
|||
</div>
|
||||
|
||||
<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-->
|
||||
<div class="uk-width-2-3@m uk-width-1-2">
|
||||
<icon name="graph" customClass="text-graph"></icon>
|
||||
<span class="uk-margin-small-left uk-text-baseline">
|
||||
<span class="uk-text-meta">Powered by </span>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||
</a>
|
||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</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-->
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-expand uk-text-right">
|
||||
<span class="uk-text-meta uk-text-xsmall">See an issue?</span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall"> Report it here</a>
|
||||
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
|
||||
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
|
||||
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<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-->
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 14px;">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
|
||||
</a>
|
||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
|
@ -102,7 +102,7 @@
|
|||
|
||||
<!--Feedback-->
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -326,16 +326,12 @@
|
|||
[isDisabled]="disabled" [isMobile]="mobile">
|
||||
</search-paging>
|
||||
</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-->
|
||||
<div>
|
||||
<icon name="graph" customClass="text-graph"></icon>
|
||||
<span class="uk-margin-small-left uk-text-baseline">
|
||||
<span class="uk-text-meta">Powered by </span>
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="text-graph">OpenAIRE Research Graph</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="uk-text-right">
|
||||
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@m">
|
||||
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 17px;">
|
||||
</a>
|
||||
<div class="uk-width-1-1 uk-width-auto@m">
|
||||
<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>
|
||||
<span *ngIf="!(properties.showLastIndexInformationLink)">Last update</span>
|
||||
|
|
Loading…
Reference in New Issue