[Library | Trunk]: Result Landing-References: Add all PIDS to UI.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58310 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-03-20 12:01:55 +00:00
parent ec517e5614
commit 2baf94682c
3 changed files with 37 additions and 6 deletions

View File

@ -586,9 +586,12 @@
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
<p *ngIf="item">
{{item.name}}
<!--<span *ngIf="item.url">
[<a href="{{item['url']}}" target="_blank">PubMed</a>]
</span>-->
<ng-container *ngIf="item.ids && item.ids.length > 0">
<span *ngFor="let id of item.ids">
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}" target="_blank">{{getReferenceIdName(id)}}</a>
<a *ngIf="id.type === 'openaire'" [routerLink]="'/search/result'" [queryParams]="{id: id.value}" target="_blank">OpenAIRE</a>]
</span>
</ng-container>
</p>
</div>
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"

View File

@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../utils/properties/env-properties';
import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
import {Id, ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
import {RouterHelper} from '../../utils/routerHelper.class';
import {PiwikService} from '../../utils/piwik/piwik.service';
@ -521,4 +521,32 @@ export class ResultLandingComponent {
}
this._location.go(this.linkToLandingPage + this.id);
}
public getReferenceUrl(id: Id): string {
if(id.type === "doi") {
return this.properties.doiURL + id.value;
} else if(id.type === "pmc") {
return this.properties.pmcURL + id.value;
} else if(id.type === "pmid") {
return this.properties.pmidURL + id.value;
} else if(id.type === "handle") {
return this.properties.handleURL + id.value;
} else {
return null;
}
}
public getReferenceIdName(id: Id): string {
if(id.type === "doi") {
return 'DOI'
} else if(id.type === "pmc") {
return 'Europe PMC'
} else if(id.type === "pmid") {
return 'PubMed';
} else if(id.type === "handle") {
return 'Handle.NET';
} else {
return null;
}
}
}

View File

@ -7,7 +7,7 @@ import {
RelationResult
} from "../result-preview/result-preview";
export interface id {
export interface Id {
type: "pmid" | "doi" | "pmc" | "handle" | "openaire";
value: string;
trust: number
@ -15,7 +15,7 @@ export interface id {
export interface Reference {
name?: string;
ids: id[];
ids: Id[];
}
export class ResultLandingInfo {