resultLanding: remove numbers from FoS

FoS page: remove numbers from 3rd level only
This commit is contained in:
Alex Martzios 2023-04-25 13:02:33 +03:00
parent 7ef9869629
commit d69b0d0bb5
4 changed files with 14 additions and 12 deletions

View File

@ -113,7 +113,7 @@
<div *ngFor="let subChild of child.children" style="margin-bottom: 5px;">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="{'fos': urlEncodeAndQuote(subChild.id)}"
class="uk-link-text">
{{subChild.id}}
{{subChild.label}}
</a>
</div>
</div>
@ -139,7 +139,7 @@
</h3>
<div *ngFor="let subSubItem of subItem.children" style="margin-bottom: 5px;">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="{'fos': urlEncodeAndQuote(subSubItem.id)}"
class="uk-link-text" [innerHTML]="highlightKeyword(subSubItem.id)">
class="uk-link-text" [innerHTML]="highlightKeyword(subSubItem.label)">
</a>
</div>
</div>

View File

@ -32,8 +32,8 @@ import {StringUtils} from "../../utils/string-utils.class";
<div class="uk-margin-small-top">
<div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate">
<a [routerLink]="properties.searchLinkToResults"
[queryParams]="{'fos': urlEncodeAndQuote(subject)}">
{{subject}}
[queryParams]="{'fos': urlEncodeAndQuote(subject.id)}">
{{subject.label}}
</a>
</div>
</div>
@ -47,12 +47,12 @@ import {StringUtils} from "../../utils/string-utils.class";
<div class="uk-width-expand">
<div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate">
<a *ngIf="properties.adminToolsPortalType != 'eosc'"
[routerLink]="properties.searchLinkToResults" [queryParams]="{'fos': urlEncodeAndQuote(subject)}">
{{subject}}
[routerLink]="properties.searchLinkToResults" [queryParams]="{'fos': urlEncodeAndQuote(subject.id)}">
{{subject.label}}
</a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="custom-external" target="_blank"
[href]="'https://explore.openaire.eu'+properties.searchLinkToResults+'?fos='+urlEncodeAndQuote(subject)">
{{subject}}
[href]="'https://explore.openaire.eu'+properties.searchLinkToResults+'?fos='+urlEncodeAndQuote(subject.id)">
{{subject.label}}
</a>
</div>
</div>
@ -71,7 +71,7 @@ import {StringUtils} from "../../utils/string-utils.class";
})
export class FosComponent {
@Input() subjects: string[];
@Input() subjects: {"id": string, "label": string}[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
@Output() suggestClicked = new EventEmitter();

View File

@ -312,9 +312,11 @@ export class ResultLandingService {
this.resultLandingInfo.subjects = subjectResults[0];
this.resultLandingInfo.otherSubjects = subjectResults[1];
this.resultLandingInfo.classifiedSubjects = subjectResults[2];
this.resultLandingInfo.fos = subjectResults[3];
subjectResults[3].forEach(element => {
this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()});
});
if (this.resultLandingInfo.fos) {
this.resultLandingInfo.fos.sort((a, b) => a.localeCompare(b))
this.resultLandingInfo.fos.sort((a, b) => a.id.localeCompare(b.id));
}
this.resultLandingInfo.sdg = subjectResults[4];
if (this.resultLandingInfo.sdg) {

View File

@ -84,7 +84,7 @@ export class ResultLandingInfo {
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
fos: string[];
fos: {"id": string, "label": string}[] = [];
sdg: string[];
eoscSubjects: any[];