diff --git a/dashboard/divhelpcontent/class-help-content-form.component.html b/dashboard/divhelpcontent/class-help-content-form.component.html
index 619f4ad9..e791b398 100644
--- a/dashboard/divhelpcontent/class-help-content-form.component.html
+++ b/dashboard/divhelpcontent/class-help-content-form.component.html
@@ -13,13 +13,15 @@
-
-
+
+
+
+
@@ -56,7 +58,7 @@
- {
- this.pageId = params['pageId'];
- this.myForm = this.form;
- this.pageContentId = params['pageContentId'];
- if (!this.pageId) {
- this._router.navigate(['../'], {relativeTo: this.route});
- }
- this.getInfo(this.pageId);
- }));
+ this.pageId = params['pageId'];
+ this.myForm = this.form;
+ this.pageContentId = params['pageContentId'];
+ if (!this.pageId) {
+ this._router.navigate(['../'], {relativeTo: this.route});
+ }
+ this.getInfo(this.pageId);
+ }));
}
-
+
ngOnDestroy() {
this.subs.forEach(value => {
if (value instanceof Subscriber) {
@@ -53,7 +56,7 @@ export class ClassContentFormComponent implements OnInit {
}
});
}
-
+
getInfo(pageId: string) {
this.showLoading = true;
let obs = zip(this._helpContentService.getPageByPortal(pageId, this.properties.adminToolsAPIURL, this.portal),
@@ -66,25 +69,44 @@ export class ClassContentFormComponent implements OnInit {
}
this.setOptions(results[1]);
if (!this.pageContentId) {
- this.updateForm(null);
+ 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;
- if (this.properties.adminToolsPortalType != this.page.portalType) {
- this._router.navigate(['../'], {relativeTo: this.route});
- }
- this.updateForm(this.pageHelpContent);
- this.showLoading = false;
- },
+ this.subs.push(this._helpContentService.getDivHelpContent(this.pageContentId, this.properties.adminToolsAPIURL, this.portal).subscribe(pageHelpContent => {
+ this.pageHelpContent = pageHelpContent;
+ if (this.properties.adminToolsPortalType != this.page.portalType) {
+ this._router.navigate(['../'], {relativeTo: this.route});
+ }
+ this.updateForm(this.pageHelpContent);
+ this.showLoading = false;
+ this.initCKEditor();
+ },
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) {
this.pageHelpContent = pageHelpContent;
this.myForm = this.form;
@@ -93,48 +115,48 @@ export class ClassContentFormComponent implements OnInit {
this.myForm.get('divId').disable();
}
this.myForm.markAsPristine();
-
+
}
-
+
public setOptions(divIds) {
this.classOptions = [];
- for(let divid of divIds){
- this.classOptions.push({label:divid.name, value:divid._id});
+ for (let divid of divIds) {
+ this.classOptions.push({label: divid.name, value: divid._id});
}
}
-
+
public get form() {
return this._fb.group({
divId: ['', Validators.required],
content: ['', Validators.required],
isActive: true,
portal: this.portal,
- _id : '',
+ _id: '',
});
}
-
+
public reset() {
this.myForm.patchValue({
divId: ['', Validators.required],
content: ['', Validators.required],
isActive: true,
portal: '',
- _id : '',
+ _id: '',
});
this.myForm.markAsPristine();
}
-
+
handleError(message: string, error = null) {
- if(error) {
+ if (error) {
console.error('Server responded: ' + error);
}
NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
-
+
public saveCustom() {
if (this.myForm.valid) {
this.showLoading = true;
@@ -159,13 +181,13 @@ export class ClassContentFormComponent implements OnInit {
this.updateForm(this.pageHelpContent);
this.showLoading = false;
}
-
+
handleUpdateError(message: string, error) {
console.error('Server responded: ' + error);
NotificationHandler.rise(message, 'danger');
this.showLoading = false;
}
-
+
changeStatus() {
this.myForm.get('isActive').setValue(!this.myForm.get('isActive').value);
if (this.pageHelpContent && this.myForm.get('isActive').value != this.pageHelpContent.isActive || !this.pageHelpContent && !this.myForm.get('isActive').value) {
@@ -174,7 +196,7 @@ export class ClassContentFormComponent implements OnInit {
this.myForm.get('isActive').markAsPristine()
}
}
-
+
contentChanged() {
if (this.pageHelpContent && this.myForm.get('content').value != this.pageHelpContent.content || !this.pageHelpContent && this.myForm.get('content').value != '') {
this.myForm.get('content').markAsDirty();
diff --git a/dashboard/helpTexts/page-help-content-form.component.html b/dashboard/helpTexts/page-help-content-form.component.html
index 7cd9ff74..bae2f90b 100644
--- a/dashboard/helpTexts/page-help-content-form.component.html
+++ b/dashboard/helpTexts/page-help-content-form.component.html
@@ -13,13 +13,15 @@
-
-
+
+
+
+
@@ -60,7 +62,7 @@
- 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;
diff --git a/dashboard/sharedComponents/page-content/page-content.component.ts b/dashboard/sharedComponents/page-content/page-content.component.ts
index ec9f0f86..bc1b1da9 100644
--- a/dashboard/sharedComponents/page-content/page-content.component.ts
+++ b/dashboard/sharedComponents/page-content/page-content.component.ts
@@ -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();
}
});
diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts
index 4bd6bfa3..ed91e514 100644
--- a/dashboard/sharedComponents/sidebar/layout.service.ts
+++ b/dashboard/sharedComponents/sidebar/layout.service.ts
@@ -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();
}
})
diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html
index ab80b5bc..a20df43e 100644
--- a/landingPages/dataProvider/dataProvider.component.html
+++ b/landingPages/dataProvider/dataProvider.component.html
@@ -55,22 +55,19 @@
-
+
-
-
-
- Powered by
- OpenAIRE Research Graph
-
-
- . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
-
-
+
+
+
+
+ Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
+
+
-
-
See an issue?
-
Report it here
+
diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html
index f720c53c..426c44d4 100644
--- a/landingPages/organization/organization.component.html
+++ b/landingPages/organization/organization.component.html
@@ -54,22 +54,19 @@
-
+
-
-
-
- Powered by
- OpenAIRE Research Graph
-
-
- . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
-
-
+
+
+
+
+ Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
+
+
-
-
See an issue?
-
Report it here
+
diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html
index 6905df01..813953a2 100644
--- a/landingPages/project/project.component.html
+++ b/landingPages/project/project.component.html
@@ -94,22 +94,19 @@
-
+
-
-
-
- Powered by
- OpenAIRE Research Graph
-
-
- . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
-
-
+
+
+
+
+ Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
+
+
-
-
See an issue?
-
Report it here
+
diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html
index 3c5a5ee6..dd5d400c 100644
--- a/landingPages/result/resultLanding.component.html
+++ b/landingPages/result/resultLanding.component.html
@@ -94,7 +94,7 @@
-
+
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
@@ -102,7 +102,7 @@
diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html
index b2e4ed18..385ff5c0 100644
--- a/searchPages/searchUtils/newSearchPage.component.html
+++ b/searchPages/searchUtils/newSearchPage.component.html
@@ -326,16 +326,12 @@
[isDisabled]="disabled" [isMobile]="mobile">
-
+
-
-
+
+
+
+