@@ -53,7 +56,7 @@ export class FosComponent {
@Input() subjects: string[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
- @Output() feedbackClicked = new EventEmitter();
+ @Output() suggestClicked = new EventEmitter();
public lessBtn: boolean = false;
public threshold: number = 3; // was 2
public routerHelper: RouterHelper = new RouterHelper();
@@ -65,7 +68,7 @@ export class FosComponent {
// this.viewAll = true;
// this.lessBtn = true;
// } else {
- // this.viewAll = true;
+ this.viewAll = true;
this.viewAllClicked.emit('fos');
// }
}
@@ -75,8 +78,8 @@ export class FosComponent {
this.viewAllClicked.emit("");
}
- public feedbackClick() {
- this.feedbackClicked.emit("");
+ public suggestClick() {
+ this.suggestClicked.emit('fos');
}
public urlEncodeAndQuote(str: string): string {
diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts
index 6edc4d4e..3d012cb5 100644
--- a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts
+++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts
@@ -1,6 +1,7 @@
import {ChangeDetectorRef, Component, Input, ViewChild} from "@angular/core";
import {FormBuilder, UntypedFormGroup, Validators} from "@angular/forms";
import {SdgSelectionComponent} from "../../../sdg/sdg-selection/sdg-selection.component";
+import {FosSelectionComponent} from "../../../fos/fos-selection/fos-selection.component";
import {properties} from "../../../../../environments/environment";
import {EnvProperties} from "../../../utils/properties/env-properties";
import {EmailService} from "../../../utils/email/email.service";
@@ -15,9 +16,9 @@ import {StringUtils} from "../../../utils/string-utils.class";
-
-
+ [subjects]="subjects" [entityType]="entityType">
+
@@ -25,6 +26,7 @@ import {StringUtils} from "../../../utils/string-utils.class";
Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
+ (Optional)
@@ -51,7 +53,7 @@ export class SdgFosSuggestComponent {
public properties: EnvProperties = properties;
public selectionStep1: boolean = true;
@ViewChild("selectionModal") selectionModal: AlertModal;
- @ViewChild("selection") selection: SdgSelectionComponent;// | FosSelectionComponent;
+ @ViewChild("selection") selection: SdgSelectionComponent | FosSelectionComponent;
public form: UntypedFormGroup;
public url: string = null;
diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts
index 4707e909..4d327c9e 100644
--- a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts
+++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts
@@ -2,7 +2,8 @@ import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {FormsModule} from "@angular/forms";
import {RecaptchaModule} from "ng-recaptcha";
-import {SdgSelectionModule} from "src/app/openaireLibrary/sdg/sdg-selection/sdg-selection.module";
+import {SdgSelectionModule} from "../../../sdg/sdg-selection/sdg-selection.module";
+import {FosSelectionModule} from "../../../fos/fos-selection/fos-selection.module";
import {InputModule} from "../../../sharedComponents/input/input.module";
import {SdgFosSuggestComponent} from "./sdg-fos-suggest.component";
import {AlertModalModule} from "../../../utils/modal/alertModal.module";
@@ -10,7 +11,7 @@ import {IconsModule} from "../../../utils/icons/icons.module";
@NgModule({
imports: [
- CommonModule, FormsModule, InputModule, SdgSelectionModule, RecaptchaModule, AlertModalModule, IconsModule
+ CommonModule, FormsModule, InputModule, SdgSelectionModule, FosSelectionModule, RecaptchaModule, AlertModalModule, IconsModule
],
declarations: [
SdgFosSuggestComponent
diff --git a/landingPages/landing-utils/sdg.component.ts b/landingPages/landing-utils/sdg.component.ts
index 30253b64..d5f954ea 100644
--- a/landingPages/landing-utils/sdg.component.ts
+++ b/landingPages/landing-utils/sdg.component.ts
@@ -14,7 +14,10 @@ import {StringUtils} from "../../utils/string-utils.class";
{{title}}
- {{title}} ({{subjects.length}})
+
+ {{title}}
+ threshold && !viewAll">({{subjects.length}})
+
threshold && !viewAll"
(click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate">
diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html
index 24783faf..d79b1cf8 100644
--- a/landingPages/result/resultLanding.component.html
+++ b/landingPages/result/resultLanding.component.html
@@ -794,14 +794,15 @@
0 && (!viewAll || viewAll=='fos')">
-
+
0 && (!viewAll || viewAll=='fundedBy')">
- 0 && !noCommunities && (!viewAll || viewAll=='relatedTo')">
+
0 && !noCommunities && (!viewAll || viewAll=='relatedTo')"
+ class="uk-margin-bottom">
diff --git a/sdg/sdg-selection/sdg-selection.component.ts b/sdg/sdg-selection/sdg-selection.component.ts
index 7c8bb77b..2c42ff95 100644
--- a/sdg/sdg-selection/sdg-selection.component.ts
+++ b/sdg/sdg-selection/sdg-selection.component.ts
@@ -2,6 +2,7 @@ import {HttpClient} from "@angular/common/http";
import {Component, Input} from "@angular/core";
import {properties} from "../../../../environments/environment";
import {EnvProperties} from "../../utils/properties/env-properties";
+import {StringUtils} from "../../utils/string-utils.class";
@Component({
selector: 'sdg-selection',
@@ -11,6 +12,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
export class SdgSelectionComponent {
public properties: EnvProperties = properties;
@Input() subjects: string[];
+ @Input() entityType: string;
public loading: boolean;
public sdgs: any = [];
@@ -25,7 +27,7 @@ export class SdgSelectionComponent {
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: '18', id: 'No SDGs are relevant for this publication', label: 'Not relevant', html: 'Not relevant', checked: false});
+ this.sdgs.push({code: '18', id: 'No SDGs are relevant for this ' + this.getEntityName(this.entityType), label: 'Not relevant', html: 'Not relevant', checked: false});
});
this.loading = false;
}
@@ -40,5 +42,9 @@ export class SdgSelectionComponent {
public getSelectedSubjects() {
return this.sdgs.filter(sub => sub.checked == true);
+ }
+
+ private getEntityName (entityType:string) {
+ return StringUtils.getEntityName(entityType, false);
}
}
\ No newline at end of file
diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts
index 73d85d48..c808c786 100644
--- a/utils/modal/alert.ts
+++ b/utils/modal/alert.ts
@@ -15,7 +15,7 @@ declare var UIkit: any;
-
@@ -62,6 +62,7 @@ export class AlertModal {
@Input() classBody: string = "";
@Input() large: boolean = false;
@Input() overflowBody: boolean = true;
+ @ViewChild("bodyElement") bodyElement: ElementRef;
/**
* Caption for the title.
*/
@@ -209,4 +210,8 @@ export class AlertModal {
previous() {
this.cancelOutput.emit();
}
+
+ get bodyHeight() {
+ return (this.bodyElement) ? this.bodyElement.nativeElement.offsetHeight : 0;
+ }
}