2019-10-02 16:17:31 +02:00
|
|
|
import {Component, Inject, Input, PLATFORM_ID} from '@angular/core';
|
2020-01-28 17:20:54 +01:00
|
|
|
import {ActivatedRoute} from "@angular/router";
|
|
|
|
import {HelperFunctions} from '../HelperFunctions.class';
|
|
|
|
import {RouterHelper} from "../routerHelper.class";
|
|
|
|
import {EnvProperties} from '../properties/env-properties';
|
2019-10-02 16:17:31 +02:00
|
|
|
import {isPlatformBrowser} from "@angular/common";
|
2020-03-13 12:42:57 +01:00
|
|
|
import {Author} from "../result-preview/result-preview";
|
2020-03-16 14:09:46 +01:00
|
|
|
import {AlertModal} from "../modal/alert";
|
2020-07-13 16:42:34 +02:00
|
|
|
import {properties} from "../../../../environments/environment";
|
2019-05-29 14:24:43 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'showAuthors',
|
|
|
|
template: `
|
2020-03-16 14:09:46 +01:00
|
|
|
<div *ngIf="authors" class="uk-height-max-medium uk-overflow-auto">
|
2020-01-28 17:20:54 +01:00
|
|
|
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
2021-02-20 10:20:05 +01:00
|
|
|
<span *ngIf="(!author.orcid && !author.orcid_pending) || !testBrowser"
|
2020-03-16 14:09:46 +01:00
|
|
|
[class.uk-text-small]="small">
|
2020-04-27 10:14:05 +02:00
|
|
|
{{author.fullName + "; "}}
|
2020-02-07 14:05:07 +01:00
|
|
|
</span>
|
2021-02-20 10:20:05 +01:00
|
|
|
<a *ngIf="(author.orcid || author.orcid_pending) && testBrowser" class="uk-display-inline-block space">
|
|
|
|
<span>
|
2021-08-11 12:59:50 +02:00
|
|
|
<img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="orcid" loading="lazy" style="width:16px; height:16px">{{" "}}
|
|
|
|
<img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="orcid bw" loading="lazy">{{" "}}
|
2021-02-20 10:20:05 +01:00
|
|
|
<span [class.uk-text-small]="small">
|
|
|
|
{{author.fullName + "; "}}
|
|
|
|
</span>
|
2020-02-07 14:05:07 +01:00
|
|
|
</span>
|
|
|
|
</a>
|
2021-02-20 10:20:05 +01:00
|
|
|
<div *ngIf="(author.orcid || author.orcid_pending) && testBrowser"
|
2020-05-25 20:58:13 +02:00
|
|
|
class="default-dropdown uk-margin-remove-top uk-padding-medium uk-dropdown"
|
2021-03-11 02:37:04 +01:00
|
|
|
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 465px !important;">
|
2019-05-29 14:24:43 +02:00
|
|
|
<b class="uk-margin-top">{{author.fullName}}</b>
|
|
|
|
<div>
|
2019-09-03 16:19:57 +02:00
|
|
|
<div class="uk-text-muted uk-margin-small-bottom uk-margin-small-top">ORCID</div>
|
2021-02-26 14:42:44 +01:00
|
|
|
|
|
|
|
<div class="uk-text-muted uk-text-small uk-margin-small-top uk-margin-small-bottom">
|
2021-07-14 13:19:57 +02:00
|
|
|
<img *ngIf="author.orcid" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">{{" "}}
|
|
|
|
<img *ngIf="!author.orcid && author.orcid_pending" src="assets/common-assets/common/ORCIDiD_iconbw16x16.png" alt="" loading="lazy">{{" "}}
|
2021-04-12 12:02:56 +02:00
|
|
|
|
2021-02-26 14:42:44 +01:00
|
|
|
<i *ngIf="author.orcid">Harvested from ORCID Public Data File</i>
|
2021-03-11 02:37:04 +01:00
|
|
|
<i *ngIf="!author.orcid && author.orcid_pending">Derived by OpenAIRE algorithms or harvested from 3d party repositories</i>
|
2021-02-26 14:42:44 +01:00
|
|
|
</div>
|
|
|
|
|
2020-07-27 12:48:05 +02:00
|
|
|
<div>
|
|
|
|
<div class="orcid uk-display-inline-block">
|
2021-02-20 10:20:05 +01:00
|
|
|
<input #element class="uk-padding-small uk-padding-remove-vertical uk-disabled"
|
2021-03-11 02:37:04 +01:00
|
|
|
style="min-height: 38px; min-width: 280px;" name="code" [value]="properties.orcidURL+(author.orcid ? author.orcid : author.orcid_pending)">
|
2020-07-27 12:48:05 +02:00
|
|
|
<button [class]="'uk-button uk-button-primary uk-button-small uk-icon copy orcid_clipboard_btn_auhtor_'+i" style="min-height: 40px"
|
|
|
|
(click)="copyToClipboard(element)" title="Copy to clipboard">
|
|
|
|
<span class="custom-icon custom-copy-white"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<a class="uk-button uk-button-primary custom-icon-button target uk-button-icon uk-margin-small-left"
|
2021-02-20 10:20:05 +01:00
|
|
|
title="Visit author in ORCID" [href]="properties.orcidURL+(author.orcid ? author.orcid : author.orcid_pending)" target="_blank">
|
2020-07-22 15:39:35 +02:00
|
|
|
<span class="custom-icon custom-external-white"></span>
|
2019-05-29 14:24:43 +02:00
|
|
|
</a>
|
2020-07-22 15:39:35 +02:00
|
|
|
</div>
|
2019-05-29 14:24:43 +02:00
|
|
|
</div>
|
2021-02-20 10:20:05 +01:00
|
|
|
|
2019-05-29 14:24:43 +02:00
|
|
|
<hr>
|
|
|
|
<div class="uk-margin-top">
|
2020-07-22 15:39:35 +02:00
|
|
|
Search <b>{{author.fullName}}</b> in OpenAIRE
|
2019-05-29 14:24:43 +02:00
|
|
|
</div>
|
2020-07-27 12:48:05 +02:00
|
|
|
<div class="uk-text-center uk-margin-top uk-margin-large-left uk-margin-large-right">
|
|
|
|
<a class="uk-button uk-text-bold portal-button uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
2020-03-16 15:22:37 +01:00
|
|
|
(click)="onClick()"
|
2021-02-20 10:20:05 +01:00
|
|
|
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[(author['orcid'] ? author['orcid'] : author['orcid_pending']),'and'])"
|
2020-07-13 16:42:34 +02:00
|
|
|
routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults">
|
2020-07-22 15:39:35 +02:00
|
|
|
<span class="space">Search</span>
|
2019-05-29 14:24:43 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2020-03-16 14:09:46 +01:00
|
|
|
</div>
|
2019-05-29 14:24:43 +02:00
|
|
|
</span>
|
2020-01-28 17:20:54 +01:00
|
|
|
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span>
|
|
|
|
</div>
|
2020-07-22 15:39:35 +02:00
|
|
|
<div *ngIf="authors && showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit"
|
|
|
|
class="uk-width-1-1 uk-text-right">
|
2020-03-16 14:09:46 +01:00
|
|
|
<a (click)="numberOfAuthors = authors.length;">
|
|
|
|
View all {{authors.length | number}} authors
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div *ngIf="authors && showAll && numberOfAuthors > authorsLimit" class="uk-width-1-1 uk-text-right">
|
2020-01-28 17:20:54 +01:00
|
|
|
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
|
|
|
</div>
|
|
|
|
`
|
2020-02-07 14:05:07 +01:00
|
|
|
|
2019-05-29 14:24:43 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export class ShowAuthorsComponent {
|
2020-02-07 14:05:07 +01:00
|
|
|
@Input() authors: Author[];
|
2019-05-29 14:24:43 +02:00
|
|
|
@Input() authorsLimit: number = 30;
|
|
|
|
@Input() showAll: boolean = true;
|
2020-03-16 14:09:46 +01:00
|
|
|
@Input() small: boolean = true;
|
|
|
|
@Input() modal: AlertModal;
|
2020-02-07 14:05:07 +01:00
|
|
|
|
2019-05-29 14:24:43 +02:00
|
|
|
public numberOfAuthors: number;
|
2020-07-13 16:42:34 +02:00
|
|
|
public properties: EnvProperties = properties;
|
2020-02-07 14:05:07 +01:00
|
|
|
public routerHelper: RouterHelper = new RouterHelper();
|
|
|
|
|
2019-10-02 16:17:31 +02:00
|
|
|
testBrowser: boolean;
|
2020-02-07 14:05:07 +01:00
|
|
|
|
|
|
|
constructor(private route: ActivatedRoute, @Inject(PLATFORM_ID) private platformId: string) {
|
2019-10-02 16:17:31 +02:00
|
|
|
this.testBrowser = isPlatformBrowser(platformId);
|
|
|
|
}
|
2020-02-07 14:05:07 +01:00
|
|
|
|
2019-05-29 14:24:43 +02:00
|
|
|
ngOnInit() {
|
|
|
|
this.numberOfAuthors = this.authorsLimit;
|
2020-01-28 17:20:54 +01:00
|
|
|
}
|
|
|
|
|
2020-02-07 14:05:07 +01:00
|
|
|
copyToClipboard(element: HTMLInputElement) {
|
2020-01-28 17:20:54 +01:00
|
|
|
element.select();
|
2020-02-07 14:05:07 +01:00
|
|
|
if (typeof document !== 'undefined') {
|
2020-01-28 17:20:54 +01:00
|
|
|
document.execCommand('copy');
|
2019-05-29 14:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
2020-02-07 14:05:07 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
public onClick() {
|
2020-07-22 15:39:35 +02:00
|
|
|
if (this.modal) {
|
2020-03-16 14:09:46 +01:00
|
|
|
this.modal.cancel();
|
|
|
|
}
|
|
|
|
}
|
2019-05-29 14:24:43 +02:00
|
|
|
}
|