Add organizations in entity-metadata

This commit is contained in:
Konstantinos Triantafyllou 2023-02-20 18:17:30 +02:00
parent 6947890c20
commit 3d296f3234
2 changed files with 37 additions and 41 deletions

View File

@ -2,7 +2,7 @@ import {Component, Input} from "@angular/core";
import {EnvProperties} from "../../utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {Project} from "../../utils/result-preview/result-preview";
import {Organization, Project} from "../../utils/result-preview/result-preview";
@Component({
selector: 'entity-metadata',
@ -132,35 +132,6 @@ import {Project} from "../../utils/result-preview/result-preview";
<span>{{programmingLanguage}}</span>
</ng-container>
</ng-container>
<!-- Projects -->
<ng-container *ngIf="projects && projects.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span uk-tooltip="Projects">
<span *ngFor="let project of projects.slice(0,10) let i=index">
<span>
{{project.funderShortname ? project.funderShortname : project.funderName}}
</span>
<span *ngIf="project.acronym || project.title">
| {{ project.acronym ? project.acronym : (project.title.length > 25 ?
project.title.substring(0, 25) + '...' : project.title)}}
</span>
<span *ngIf="project.code"> ({{project.code}})</span>
<span *ngIf="i < projects.length-1">,</span>
</span>
<span *ngIf="projects.length > 10">...</span>
</span>
</ng-container>
<!-- Subjects -->
<ng-container *ngIf="subjects && subjects.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span uk-tooltip="Subjects">
<span *ngFor="let subject of subjects.slice(0,10) let i = index">
<span>{{subject}}</span>
<span>{{(i < (subjects.slice(0, 10).length - 1)) ? ", " : ""}}</span>
<span>{{(i == subjects.slice(0, 10).length - 1 && subjects.length > 10) ? "..." : ""}}</span>
</span>
</span>
</ng-container>
<!-- published info -->
<showPublisher [publisher]="publisher" [journal]="journal" [properties]="properties"></showPublisher>
<!-- data provider labels -->
@ -198,6 +169,40 @@ import {Project} from "../../utils/result-preview/result-preview";
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>Thematic</span>
</ng-container>
<!-- Projects -->
<ng-container *ngIf="projects && projects.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span uk-tooltip="Project" *ngFor="let project of projects.slice(0,10) let i=index">
<span class="space">
{{project.funderShortname ? project.funderShortname : project.funderName}}
</span>
<span *ngIf="project.acronym || project.title">
| {{ project.acronym ? project.acronym : (project.title.length > 25 ?
project.title.substring(0, 25) + '...' : project.title)}}
</span>
<span *ngIf="project.code"> ({{project.code}})</span>
<span *ngIf="i < projects.length-1">, </span>
</span>
<span *ngIf="projects.length > 10">...</span>
</ng-container>
<!-- Organizations -->
<ng-container *ngIf="organizations && organizations.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span uk-tooltip="Partner" *ngFor="let organization of organizations.slice(0,10) let i=index">
<span class="space">{{organization.name}}</span>
<span *ngIf="(i < organizations.length-1) && (i < 9)">,</span>
</span>
<span *ngIf="organizations.length > 10">...</span>
</ng-container>
<!-- Subjects -->
<ng-container *ngIf="subjects && subjects.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span uk-tooltip="Subject" *ngFor="let subject of subjects.slice(0,10) let i = index">
<span class="space">{{subject}}</span>
<span>{{(i < (subjects.slice(0, 10).length - 1)) ? "," : ""}}</span>
</span>
<span *ngIf="subjects.length > 10">...</span>
</ng-container>
<ng-container *ngIf="provenanceAction">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{provenanceAction}}</span>
@ -237,6 +242,7 @@ export class EntityMetadataComponent {
@Input() provenanceAction: string; // search result
@Input() relationName: string; // search result
@Input() projects: Project[];
@Input() organizations: Organization[];
@Input() subjects: string[];
properties: EnvProperties = properties;

View File

@ -76,7 +76,7 @@
[publisher]="result.publisher" [countries]="result.countries"
[languages]="result.languages" [programmingLanguages]="result.programmingLanguages"
[compatibilityString]="result.compatibility" [type]="type" [projects]="result.projects"
[subjects]="result.subjects"
[subjects]="showSubjects?result.subjects:null" [organizations]="showOrganizations?result.organizations:null"
></entity-metadata>
</div>
</div>
@ -120,16 +120,6 @@
<div *ngIf="result.identifiers && result.identifiers.size > 0" class="uk-margin-xsmall-bottom">
<showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
</div>
<!-- Organizations -->
<div *ngIf="showOrganizations && result.organizations && result.organizations.length > 0"
class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">Partners: </span>
<span *ngFor="let organization of result.organizations.slice(0,10) let i=index">
<span>{{organization.name}}</span>
<span *ngIf="(i < result.organizations.length-1) && (i < 9)">, </span>
</span>
<span *ngIf="result.organizations.length > 10">...</span>
</div>
<!-- Website URL -->
<div *ngIf="result.websiteURL && result.websiteURL != '' && !promoteWebsiteURL"
class="uk-margin-xsmall-bottom">