[develop | DONE | CHANGED]: In search projects results, show funder name by default, and if not available, show funder short name.

1. searchResult.ts: Added field funderName: string; in class SearchResult.
2. result-preview.ts: Added field funderName: string; in class ResultPreview & in method "searchResultConvert()" set resultPreview.funderName = result.funderName;
3. searchProjects.service.ts: Added parsing of funderName.
4. result-preview.component.html: Show funderName and if not available, show funderShortname.
5. entity-metadata.component.ts: Added check for funders display.
This commit is contained in:
Konstantina Galouni 2024-04-16 11:47:12 +03:00
parent 4b3e805d31
commit eeb63a2de9
5 changed files with 9 additions and 5 deletions

View File

@ -295,7 +295,7 @@ export class EntityMetadataComponent {
return this.projects.map(project => {
let value = project.funderShortname ? project.funderShortname : project.funderName;
if (project.acronym || project.title) {
value = value + ' | ' + (project.acronym ? project.acronym :
value = (value ? value + ' | ' : '') + (project.acronym ? project.acronym :
(project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title));
}
// if(project.code) {

View File

@ -231,6 +231,7 @@ export class SearchProjectsService {
let fundingData = Array.isArray(resData['fundingtree']) ? resData['fundingtree'][z] : resData['fundingtree'];
if(fundingData.hasOwnProperty("funder")) {
result['funderShortname'] = fundingData['funder'].shortname;
result['funderName'] = fundingData['funder'].name;
result['funderId'] = fundingData['funder'].id;
result['jurisdiction'] = (fundingData['funder']['id']['jurisdiction'] )?fundingData['funder']['id']['jurisdiction']:"";

View File

@ -48,6 +48,7 @@ export class SearchResult {
acronym: string;
code: string;
// callIdentifier?: string; // currently not parsed
funderName: string;
funderShortname: string;
budget?: string;
contribution?: string;

View File

@ -95,12 +95,12 @@
<!-- 2nd section (funders, budget, authors, PIDs, publisher etc.) -->
<div class="uk-text-small uk-margin-small-bottom">
<!-- Funder -->
<div *ngIf="result.funderShortname || result.code" class="uk-margin-xsmall-bottom">
<span *ngIf="result.funderShortname">
<div *ngIf="(result.funderShortname || result.funderName) || result.code" class="uk-margin-xsmall-bottom">
<span *ngIf="result.funderShortname || result.funderName">
<span class="uk-text-meta">Funder: </span>
{{result.funderShortname}}
{{result.funderName ? result.funderName : result.funderShortname}}
</span>
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname">
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname || result.funderName">
<span class="uk-text-meta">{{openaireEntities.PROJECT}} Code: </span>
{{result.code}}
</span>

View File

@ -123,6 +123,7 @@ export class ResultPreview {
acronym: string;
code: string;
// callIdentifier: string; // currently not parsed
funderName: string;
funderShortname: string;
budget: string;
contribution: string;
@ -188,6 +189,7 @@ export class ResultPreview {
resultPreview.acronym = result.acronym;
resultPreview.code = result.code;
// resultPreview.callIdentifier = result.callIdentifier; // currently not parsed
resultPreview.funderName = result.funderName;
resultPreview.funderShortname = result.funderShortname;
resultPreview.budget = result.budget;
resultPreview.contribution = result.contribution;