Show properly researchers in DMP and Dataset Overview

This commit is contained in:
George Kalampokis 2020-09-25 17:49:19 +03:00
parent 410583a5f2
commit 5a5043f432
4 changed files with 28 additions and 6 deletions

View File

@ -74,11 +74,17 @@
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
<div class="row">
<div *ngFor="let researcher of researchers; let last = last">
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
<div class="id-btn">&nbsp;</div>
<span *ngIf="isOrcid(researcher.reference)">
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
<div class="id-btn">&nbsp;</div>
<div *ngIf="!last">{{ researcher.name }}, </div>
<div *ngIf="last">{{ researcher.name }}</div>
</a>
</span>
<span *ngIf="!isOrcid(researcher.reference)">
<div *ngIf="!last">{{ researcher.name }}, </div>
<div *ngIf="last">{{ researcher.name }}</div>
</a>
</span>
</div>
<span *ngIf="!researchers || researchers.length === 0" class="material-icons">horizontal_rule</span>
</div>

View File

@ -302,6 +302,11 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
return this.configurationService.orcidPath;
}
isOrcid(reference: string) {
const head = reference.split(':')[0];
return head === 'orcid';
}
getOrcidPathForResearcher(reference: string): string {
const path = this.getOrcidPath();
const userId = reference.split(':')[1];

View File

@ -66,11 +66,17 @@
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
<div class="row">
<div *ngFor="let researcher of dmp.researchers; let last = last">
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
<div class="id-btn">&nbsp;</div>
<span *ngIf="isOrcid(researcher.reference)">
<a href="{{ getOrcidPathForResearcher(researcher.reference) }}" target="blank" class="researcher">
<div class="id-btn">&nbsp;</div>
<div *ngIf="!last">{{ researcher.name }}, </div>
<div *ngIf="last">{{ researcher.name }}</div>
</a>
</span>
<span *ngIf="!isOrcid(researcher.reference)">
<div *ngIf="!last">{{ researcher.name }}, </div>
<div *ngIf="last">{{ researcher.name }}</div>
</a>
</span>
</div>
<span *ngIf="!dmp.researchers || dmp.researchers.length === 0" class="material-icons">horizontal_rule</span>
</div>

View File

@ -751,6 +751,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
return this.configurationService.orcidPath;
}
isOrcid(reference: string) {
const head = reference.split(':')[0];
return head === 'orcid';
}
getOrcidPathForResearcher(reference: string): string {
const path = this.getOrcidPath();
const userId = reference.split(':')[1];