Merging explore-redesign branch into develop for Explore July release #7

Merged
konstantina.galouni merged 112 commits from explore-redesign into develop 2023-07-05 11:11:53 +02:00
20 changed files with 894 additions and 933 deletions
Showing only changes of commit 238aafd552 - Show all commits

View File

@ -2,7 +2,7 @@ import {
ChangeDetectorRef,
Component,
EventEmitter,
Inject,
Inject, Input,
OnInit,
Output,
RendererFactory2,
@ -28,18 +28,22 @@ declare var addthis: addthis;
@Component({
selector: 'addThis',
template: `
<div id="addThis" class="addthis_inline_share_toolbox_lcx9_8cfy"></div>
<div *ngIf="showWarning" class="uk-alert uk-alert-warning uk-animation-fade" >
Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page.
</div>
<div id="addThis" class="addthis_inline_share_toolbox_lcx9_8cfy" [attr.data-url]="url"></div>
<div *ngIf="showWarning" class="uk-alert uk-alert-warning uk-animation-fade">
Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page.
</div>
`
})
export class AddThisComponent implements OnInit {
subs=[];
subs = [];
showWarning = false;
constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) {}
@Input() url: string = null;
constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) {
}
public ngOnDestroy() {
for(let value of this.subs){
for (let value of this.subs) {
if (value instanceof Subscriber) {
value.unsubscribe();
} else if (value instanceof Function) {
@ -47,12 +51,13 @@ export class AddThisComponent implements OnInit {
}
}
}
ngOnInit() {
this.subs.push(this.route.queryParams.subscribe(data => {
this.showWarning = false;
try {
if (!this.document.getElementById('addThisScript') && typeof document !== 'undefined') {
if (!this.document.getElementById('addThisScript') && typeof document !== 'undefined') {
// console.log(" create script AddThis");
const renderer = this.rendererFactory.createRenderer(this.document, {
id: '-1',
@ -71,20 +76,20 @@ export class AddThisComponent implements OnInit {
renderer.appendChild(head, script);
}
if (typeof document !== 'undefined') {
if(typeof addthis !== 'undefined' && addthis.layers && addthis.layers.refresh) {
if (typeof addthis !== 'undefined' && addthis.layers && addthis.layers.refresh) {
// console.log("Add This: Call Refresh")
addthis.layers.refresh();
}
}
this.subs.push(setTimeout(() => {
if(this.document.getElementById('addThis') && !this.document.getElementById('addThis').innerText){
if (this.document.getElementById('addThis') && !this.document.getElementById('addThis').innerText) {
this.showWarning = true;
}
}, 4000));
}catch (e) {
// console.error(e)
} catch (e) {
// console.error(e)
}
}));
}
}

View File

@ -4,58 +4,64 @@ import {properties} from "../../../../environments/environment";
import {StringUtils} from '../../utils/string-utils.class';
declare var UIkit;
@Component({
selector: 'availableOn',
template: `
<ng-container *ngIf="availableOn">
<div class="uk-flex uk-flex-middle uk-flex-center">
<div class="uk-flex uk-flex-middle">
<ng-container *ngIf="availableOn[0].downloadUrl">
<span class="uk-margin-xsmall-right">Source: </span>
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'uk-text-meta')"
uk-tooltip [title]="availableOn[0].accessRight ? availableOn[0].accessRight : 'Not available'">
<span *ngIf="source" class="uk-margin-xsmall-right">Source: </span>
<span
[class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
uk-tooltip [title]="availableOn[0].accessRight ? availableOn[0].accessRight : 'Not available'">
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="0.8"></icon>
</span>
<a [href]="availableOn[0].downloadUrl" target="_blank"
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder custom-external">
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder custom-external">
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
</a>
</ng-container>
<a class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
<icon [flex]="true" [name]="'expand_' + (isOpen?'less':'more')"></icon>
</a>
<div #dropElement uk-drop="mode: click; pos: bottom-left;" class="download-drop uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small">
<div #dropElement uk-drop="mode: click; pos: bottom-left;"
class="download-drop uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small">
<div *ngFor="let instance of availableOn let i=index" class="download-drop-item uk-flex uk-flex-top">
<span [class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'open_access' ? 'open-access' : 'uk-text-meta')"
uk-tooltip [title]="instance.accessRight ? instance.accessRight : 'Not available'">
<span
[class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
uk-tooltip [title]="instance.accessRight ? instance.accessRight : 'Not available'">
<icon [name]="instance.accessRightIcon" [flex]="true"></icon>
</span>
<div class="uk-width-expand uk-padding-small uk-padding-remove-left uk-padding-remove-vertical">
<span class="uk-text-emphasis">
<a *ngIf="instance.downloadUrl" [href]="instance.downloadUrl" target="_blank"
class="title uk-link-text uk-text-bold custom-external uk-display-inline-block">
class="title uk-link-text uk-text-bold custom-external uk-display-inline-block">
{{instance.downloadNames.join("; ")}}
</a>
</span>
<div *ngIf="instance.types?.length > 0 || instance.years?.length > 0" class="uk-text-meta">
<span *ngIf="instance.types?.length > 0" class="uk-text-capitalize">{{instance.types.join(" . ")}}</span>
<span *ngIf="instance.types?.length > 0"
class="uk-text-capitalize">{{instance.types.join(" . ")}}</span>
<span *ngIf="instance.types?.length > 0 && instance.years?.length > 0"> . </span>
<span *ngIf="instance.years?.length > 0">{{instance.years.join(" . ")}}</span>
</div>
<div *ngIf="instance.license" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.license">
License:
<a *ngIf="isUrl(instance.license); else elseBlock"
[href]="instance.license" target="_blank" class="custom-external uk-link-text">
[href]="instance.license" target="_blank" class="custom-external uk-link-text">
{{instance.license}}
</a>
<ng-template #elseBlock> {{instance.license}}</ng-template>
</div>
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
<span>Providers: </span>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}" class="uk-link-text">
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index"
[routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}"
class="uk-link-text">
{{collectedName}}
<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">;</ng-container>
</a>
</div>
</div>
@ -63,134 +69,38 @@ declare var UIkit;
</div>
</div>
</ng-container>
<!-- <div class="uk-margin-small-bottom uk-flex uk-flex-between">
<span *ngIf="viewAll && !lessBtn" class="clickable uk-h6 uk-flex uk-flex-middle" (click)="viewLessClick()">
<icon class="uk-margin-small-right" name="arrow_back" [flex]="true" ratio="1.2"></icon>
{{title}}
</span>
<span *ngIf="!viewAll || lessBtn" class="uk-margin-small-bottom uk-flex uk-flex-middle">
<span class="uk-text-light-grey uk-margin-small-right">Download from</span>
</span>
<a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;" class="view-more-less-link">View less</a>
<a *ngIf="availableOn && availableOn.length > threshold && !viewAll" class="view-more-less-link"
(click)="viewAllClick();">View all {{availableOn.length}} sources</a>
</div>
<div *ngIf="availableOn" class="download-from uk-margin-small-bottom">
<div *ngFor="let instance of availableOn.slice(0, viewAll?availableOn.length:threshold) let i=index"
class="uk-flex uk-flex-top uk-padding-small uk-margin-small-bottom"
uk-tooltip [title]="instance.accessRight ? instance.accessRight : 'Not available'">
<span [class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'lock_open' ? 'uk-text-success' : 'uk-text-meta')"
uk-tooltip [title]="instance.accessRight ? instance.accessRight : 'Not available'">
<icon [name]="instance.accessRightIcon" [flex]="true" type="outlined"></icon>
</span>
<div class="uk-width-expand uk-padding-small uk-padding-remove-left uk-padding-remove-vertical">
<span class="uk-text-emphasis">
<a *ngIf="instance.downloadUrl" [href]="instance.downloadUrl" target="_blank"
class="title uk-link-text uk-text-bold custom-external uk-display-inline-block">
{{instance.downloadNames.join("; ")}}
</a>
</span>
<div *ngIf="instance.types?.length > 0 || instance.years?.length > 0" class="uk-text-meta">
<span *ngIf="instance.types?.length > 0" class="uk-text-capitalize">{{instance.types.join(" . ")}}</span>
<span *ngIf="instance.types?.length > 0 && instance.years?.length > 0"> . </span>
<span *ngIf="instance.years?.length > 0">{{instance.years.join(" . ")}}</span>
</div>
<div *ngIf="instance.license" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.license">
License:
<a *ngIf="isUrl(instance.license); else elseBlock"
[href]="instance.license" target="_blank" class="custom-external uk-link-text">
{{instance.license}}
</a>
<ng-template #elseBlock> {{instance.license}}</ng-template>
</div>
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
<span>Providers: </span>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}" class="uk-link-text">
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
</a>
</div>
</div>
</div>
</div> -->
<!-- <div *ngIf="showNum > threshold" class="uk-margin-bottom">-->
<!-- <a (click)="showNum = threshold;" class="uk-flex uk-flex-middle uk-flex-center">-->
<!-- <span>View less</span>-->
<!-- <span class="space uk-icon">-->
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="chevron-up">-->
<!-- <polyline fill="none" stroke="#000" stroke-width="1.03" points="4 13 10 7 16 13"></polyline>-->
<!-- </svg>-->
<!-- </span>-->
<!-- </a>-->
<!-- </div>-->
<!-- <div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-margin-bottom">-->
<!-- <a (click)="showNum = availableOn.length;" class="uk-flex uk-flex-middle uk-flex-center">-->
<!-- <span>View more</span>-->
<!-- <span class="space uk-icon">-->
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="chevron-down">-->
<!-- <polyline fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline>-->
<!-- </svg>-->
<!-- </span>-->
<!-- </a>-->
<!-- </div>-->
`
})
export class AvailableOnComponent {
@Input() availableOn: HostedByCollectedFrom[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
@ViewChild("dropElement") dropElement: ElementRef;
public lessBtn: boolean = false;
@Input() source: boolean = true;
/** @deprecated */
@Output() viewAllClicked = new EventEmitter();
@ViewChild("dropElement") dropElement: ElementRef;
public threshold: number = 1;
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
public title: string = "Download from";
constructor() {
}
ngOnInit() {
}
public removeUnknown(value: string): string {
if (value.toLowerCase() === 'unknown') {
return null;
}
return value;
}
public getKeys( map) {
public getKeys(map) {
return Array.from(map.keys());
}
public viewAllClick() {
if(this.availableOn.length <= this.threshold*2) {
this.viewAll = true;
this.lessBtn = true;
} else {
this.viewAll = true;
this.viewAllClicked.emit('availableOn');
}
}
public viewLessClick() {
this.viewAll = false;
this.viewAllClicked.emit("");
}
public isUrl(str: string): boolean {
return str.startsWith('http://') || str.startsWith('https://') || str.startsWith('//') || str.startsWith('www.');
}
get isOpen() {
get isOpen() {
return (typeof document !== 'undefined') && this.dropElement && UIkit.drop(this.dropElement.nativeElement).isActive();
}
public sliceString(str: string, size: number) {
return StringUtils.sliceString(str, size)
}
public sliceString(str: string, size: number) {
return StringUtils.sliceString(str, size)
}
}

View File

@ -13,6 +13,7 @@ import {DOCUMENT} from "@angular/common";
import {EnvProperties} from "../../../utils/properties/env-properties";
import {properties} from "../../../../../environments/environment";
import {PiwikService} from "../../../utils/piwik/piwik.service";
import {ResultPreview} from "../../../utils/result-preview/result-preview";
declare var Cite: any;
// Based on https://citation.js.org/api/tutorial-getting_started.html browser release
@ -53,7 +54,7 @@ export class CiteThisComponent implements OnInit, OnDestroy {
properties:EnvProperties;
public citationText: string;
public citation: Citation = new Citation();
@Input() result: ResultLandingInfo;
@Input() result: any;
@Input() id: string;
@Input() type: string = "article";
@Input() piwikSiteId;

View File

@ -0,0 +1,228 @@
import {Component, Input} from "@angular/core";
import {EnvProperties} from "../../utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
@Component({
selector: 'entity-metadata',
template: `
<div class="uk-text-xsmall uk-text-emphasis uk-flex uk-flex-middle uk-flex-wrap">
<!-- oa -->
<ng-container *ngIf="(openAccessMandatePublications != undefined && openAccessMandatePublications) || (openAccessMandateDatasets != undefined && openAccessMandateDatasets)">
<span class="uk-margin-xsmall-right open-access">
<icon name="open_access" [flex]="true" [ratio]="0.8"></icon>
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandatePublications != undefined && openAccessMandatePublications && openAccessMandateDatasets != undefined && openAccessMandateDatasets">
Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}}
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandatePublications != undefined && openAccessMandatePublications && (openAccessMandateDatasets == undefined || !openAccessMandateDatasets)">
Open Access Mandate for {{openaireEntities.PUBLICATIONS}}
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandateDatasets != undefined && openAccessMandateDatasets && (openAccessMandatePublications == undefined || !openAccessMandatePublications)">
Open Access Mandate for {{openaireEntities.DATASETS}}
</span>
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
</ng-container>
<!-- types -->
<span *ngIf="entityType" class="uk-margin-xsmall-right">
<icon *ngIf="entityType.toLowerCase() == 'publication'" name="description" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'research data'" name="database" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'research software'" name="integration_instructions"
type="outlined" [flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'other research product'" name="apps" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'project'" name="assignment_turned_in" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'data source'" name="note_add" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'organization'" name="corporate_fare" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
</span>
<u *ngIf="entityType" class="uk-text-capitalize uk-text-bolder">{{entityType}}</u>
<span *ngIf="entityType && types && removeUnknown(types, true).length > 0">
<icon name="keyboard_double_arrow_right" [flex]="true" [ratio]="0.8"></icon>
</span>
<span *ngIf="types && removeUnknown(types, true).length > 0" class="uk-text-italic">
{{removeUnknown(types, true).join(' , ')}}
</span>
<!-- years -->
<ng-container *ngIf="year">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{year}}</span>
</ng-container>
<ng-container *ngIf="startYear && !endYear">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{startYear}}</span>
</ng-container>
<ng-container *ngIf="!startYear && endYear">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{endYear}}</span>
</ng-container>
<ng-container *ngIf="startYear && endYear">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<ng-container *ngIf="startDate">
<span>{{startYear}} - {{endYear}}</span>
</ng-container>
</ng-container>
<!-- dates -->
<ng-container *ngIf="startDate && !endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span class="uk-margin-xsmall-right">From</span>
<span>{{startDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<ng-container *ngIf="!startDate && endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span class="uk-margin-xsmall-right">Until</span>
<span>{{endDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<ng-container *ngIf="startDate && endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<ng-container *ngIf="startDate">
<span>{{startDate | date: 'dd MMM yyyy'}}</span>
<span class="uk-margin-xsmall-left">(Started)</span>
</ng-container>
<span *ngIf="startDate && endDate" class="uk-margin-xsmall-left uk-margin-xsmall-right">-</span>
<ng-container *ngIf="endDate">
<span>{{endDate | date: 'dd MMM yyyy'}}</span>
<span class="uk-margin-xsmall-left">{{currentDate >= endDate ? '(Ended)' : '(Ending)'}}</span>
</ng-container>
</ng-container>
<ng-container *ngIf="status && status != ''">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{status}}</span>
</ng-container>
<ng-container *ngIf="date">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{date | date: 'dd MMM yyyy': 'UTC'}}</span>
</ng-container>
<ng-container *ngIf="embargoEndDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<span *ngIf="underCuration">
. <span title="{{buildCurationTooltip()}}"
uk-tooltip="pos:bottom-right; delay:10;"
class="uk-text-primary">Under curation</span>
</span>
<!-- countries -->
<ng-container *ngIf="countries && removeUnknown(countries).length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<ng-container *ngFor="let country of removeUnknown(countries)">
<span>{{country}}</span>
</ng-container>
</ng-container>
<!-- languages -->
<ng-container *ngIf="languages && removeUnknown(languages).length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<ng-container *ngFor="let language of removeUnknown(languages)">
<span>{{language}}</span>
</ng-container>
</ng-container>
<!-- programming languages -->
<ng-container *ngIf="programmingLanguages && programmingLanguages.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<ng-container *ngFor="let programmingLanguage of programmingLanguages">
<span>{{programmingLanguage}}</span>
</ng-container>
</ng-container>
<!-- published info -->
<showPublisher [publisher]="publisher" [journal]="journal" [properties]="properties"></showPublisher>
<!-- data provider labels -->
<ng-container *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span title="Compatibility">
<a *ngIf="compatibility.id"
[queryParams]="{datasourceId: compatibility.id}" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{compatibility.info}}
<ng-container *ngIf="compatibility.name">{{compatibility.name}}</ng-container>
</a>
<span *ngIf="!compatibility.id && compatibility.info">
<ng-container
*ngIf="compatibility.info.toLowerCase() != 'not yet registered'">{{compatibility.info}}</ng-container>
<ng-container *ngIf="compatibility.info.toLowerCase() == 'not yet registered'">
{{compatibility.info}} <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
</ng-container>
</span>
<span *ngIf="compatibility.name && !compatibility.id">
{{compatibility.name}}
</span>
</span>
</ng-container>
<ng-container
*ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>OpenAIRE Text Mining</span>
</ng-container>
<ng-container *ngIf="thematic">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>Thematic</span>
</ng-container>
<ng-container *ngIf="provenanceAction">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{provenanceAction}}</span>
</ng-container>
<ng-container *ngIf="relationName">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
<span>{{relationName}}</span>
</ng-container>
</div>
`
})
export class EntityMetadataComponent {
@Input() entityType: string;
@Input() types: string[];
@Input() year: string; // search result
@Input() startDate: number; // project landing
@Input() startYear: string; // search result
@Input() endDate: number; // project landing
@Input() endYear: string; // search result
@Input() currentDate: number; // project landing
@Input() status: string; // project landing
@Input() openAccessMandatePublications: boolean // project landing
@Input() openAccessMandateDatasets: boolean // project landing
@Input() date: Date;
@Input() embargoEndDate: Date | string;
@Input() underCuration: boolean = false;
@Input() publisher; // showPublisher component
@Input() journal; // showPublisher component
@Input() countries;
@Input() languages;
@Input() programmingLanguages;
@Input() compatibility; // data provider landing
@Input() aggregationStatus; // data provider landing
@Input() thematic: boolean; // data provider landing
@Input() type; // data provider landing
@Input() provenanceAction: string; // search result
@Input() relationName: string; // search result
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public removeUnknown(array: string[], type: boolean = false): string[] {
if (type) {
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');
} else {
return array.filter(value => value.toLowerCase() !== 'unknown');
}
}
public removeDuplicates(array: string[]): string[] {
return array.filter(value => value.toLowerCase() !== this.entityType);
}
public buildCurationTooltip(): string {
let tooltipContent: string = "<div class='uk-padding-small'>";
tooltipContent += "<h5>Record in preview</h5>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
tooltipContent += "</div>";
return tooltipContent;
}
}

View File

@ -2,7 +2,6 @@ import {Component, Input} from "@angular/core";
import {EnvProperties} from "../../../utils/properties/env-properties";
import {Author} from "../../../utils/result-preview/result-preview";
import {AlertModal} from "../../../utils/modal/alert";
import {OpenaireEntities} from "src/app/openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'landing-header',
@ -14,140 +13,15 @@ import {OpenaireEntities} from "src/app/openaireLibrary/utils/properties/searchF
<span class="uk-text-meta uk-text-small" [innerHTML]="subTitle"></span>
</div>
</div>
<div class="uk-margin-bottom uk-text-xsmall uk-text-emphasis uk-flex uk-flex-middle uk-flex-wrap">
<!-- oa -->
<ng-container
*ngIf="(openAccessMandatePublications != undefined && openAccessMandatePublications) || (openAccessMandateDatasets != undefined && openAccessMandateDatasets)">
<span class="uk-margin-xsmall-right open-access">
<icon name="open_access" [flex]="true" [ratio]="0.8"></icon>
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandatePublications != undefined && openAccessMandatePublications && openAccessMandateDatasets != undefined && openAccessMandateDatasets">
Open Access Mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}}
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandatePublications != undefined && openAccessMandatePublications && (openAccessMandateDatasets == undefined || !openAccessMandateDatasets)">
Open Access Mandate for {{openaireEntities.PUBLICATIONS}}
</span>
<span class="uk-text-bolder"
*ngIf="openAccessMandateDatasets != undefined && openAccessMandateDatasets && (openAccessMandatePublications == undefined || !openAccessMandatePublications)">
Open Access Mandate for {{openaireEntities.DATASETS}}
</span>
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
</ng-container>
<!-- types -->
<span *ngIf="entityType" class="uk-margin-xsmall-right">
<icon *ngIf="entityType.toLowerCase() == 'publication'" name="description" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'research data'" name="database" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'research software'" name="integration_instructions"
type="outlined" [flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'other research product'" name="apps" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'project'" name="assignment_turned_in" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'data source'" name="note_add" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
<icon *ngIf="entityType.toLowerCase() == 'organization'" name="corporate_fare" type="outlined"
[flex]="true" [ratio]="0.8"></icon>
</span>
<span *ngIf="entityType" class="uk-text-capitalize uk-text-bolder" style="text-decoration: underline;">
{{entityType}}
</span>
<span *ngIf="entityType && types && removeUnknown(types, true).length > 0">
<icon name="keyboard_double_arrow_right" [flex]="true" [ratio]="0.8"></icon>
</span>
<span *ngIf="types && removeUnknown(types, true).length > 0" class="uk-text-italic">
{{removeUnknown(types, true).join(' , ')}}
</span>
<!-- dates -->
<ng-container *ngIf="startDate && !endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span class="uk-margin-xsmall-right">From</span>
<span>{{startDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<ng-container *ngIf="!startDate && endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span class="uk-margin-xsmall-right">Until</span>
<span>{{endDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<ng-container *ngIf="startDate && endDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<ng-container *ngIf="startDate">
<span>{{startDate | date: 'dd MMM yyyy'}}</span>
<span class="uk-margin-xsmall-left">(Started)</span>
</ng-container>
<span *ngIf="startDate && endDate" class="uk-margin-xsmall-left uk-margin-xsmall-right">-</span>
<ng-container *ngIf="endDate">
<span>{{endDate | date: 'dd MMM yyyy'}}</span>
<span class="uk-margin-xsmall-left">{{currentDate >= endDate ? '(Ended)' : '(Ending)'}}</span>
</ng-container>
</ng-container>
<ng-container *ngIf="status && status != ''">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span>{{status}}</span>
</ng-container>
<ng-container *ngIf="date">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span>{{date | date: 'dd MMM yyyy': 'UTC'}}</span>
</ng-container>
<ng-container *ngIf="embargoEndDate">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span>Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}</span>
</ng-container>
<span *ngIf="underCuration">
. <span title="{{buildCurationTooltip()}}"
uk-tooltip="pos:bottom-right; delay:10;"
class="uk-text-primary">Under curation</span>
</span>
<!-- languages -->
<ng-container *ngIf="languages && removeUnknown(languages).length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<ng-container *ngFor="let language of removeUnknown(languages)">
<span>{{language}}</span>
</ng-container>
</ng-container>
<!-- programming languages -->
<ng-container *ngIf="programmingLanguages && programmingLanguages.length > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<ng-container *ngFor="let programmingLanguage of programmingLanguages">
<span>{{programmingLanguage}}</span>
</ng-container>
</ng-container>
<!-- published info -->
<showPublisher [publisher]="publisher" [journal]="journal" [properties]="properties"></showPublisher>
<!-- data provider labels -->
<ng-container *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span title="Compatibility">
<a *ngIf="compatibility.id"
[queryParams]="{datasourceId: compatibility.id}" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{compatibility.info}}
<ng-container *ngIf="compatibility.name">{{compatibility.name}}</ng-container>
</a>
<span *ngIf="!compatibility.id">
<ng-container
*ngIf="compatibility.info.toLowerCase() != 'not yet registered'">{{compatibility.info}}</ng-container>
<ng-container *ngIf="compatibility.info.toLowerCase() == 'not yet registered'">
{{compatibility.info}} <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
</ng-container>
</span>
<span *ngIf="compatibility.name && !compatibility.id">
{{compatibility.name}}
</span>
</span>
</ng-container>
<ng-container
*ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span>OpenAIRE Text Mining</span>
</ng-container>
<ng-container *ngIf="thematic">
<span class="uk-margin-xsmall-left uk-margin-xsmall-right">&#x2022;</span>
<span>Thematic</span>
</ng-container>
<div class="uk-margin-bottom">
<entity-metadata [entityType]="entityType" [types]="types" [startDate]="startDate" [endDate]="endDate"
[currentDate]="currentDate" [status]="status" [openAccessMandatePublications]="openAccessMandatePublications"
[openAccessMandateDatasets]="openAccessMandateDatasets" [date]="date" [embargoEndDate]="embargoEndDate"
[underCuration]="underCuration" [publisher]="publisher" [journal]="journal"
[languages]="languages" [programmingLanguages]="programmingLanguages"
[compatibility]="compatibility" [aggregationStatus]="aggregationStatus"
[thematic]="thematic" [type]="type"
></entity-metadata>
</div>
<div *ngIf="authors">
<showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors"
@ -176,7 +50,6 @@ export class LandingHeaderComponent {
@Input() underCuration: boolean = false;
@Input() modal: AlertModal;
@Input() titleClass: string = null;
@Input() isTitleH1: boolean = true;
@Input() isSticky: boolean = false;
@Input() publisher; // showPublisher component
@Input() journal; // showPublisher component
@ -186,28 +59,4 @@ export class LandingHeaderComponent {
@Input() aggregationStatus; // data provider landing
@Input() thematic: boolean; // data provider landing
@Input() type; // data provider landing
public openaireEntities = OpenaireEntities;
public removeUnknown(array: string[], type: boolean = false): string[] {
if (type) {
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');
} else {
return array.filter(value => value.toLowerCase() !== 'unknown');
}
}
public removeDuplicates(array: string[]): string[] {
return array.filter(value => value.toLowerCase() !== this.entityType);
}
public buildCurationTooltip(): string {
let tooltipContent: string = "<div class='uk-padding-small'>";
tooltipContent += "<h5>Record in preview</h5>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
tooltipContent += "</div>";
return tooltipContent;
}
}

View File

@ -6,10 +6,11 @@ import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
import {IconsModule} from "src/app/openaireLibrary/utils/icons/icons.module";
import {ShowPublisherModule} from "../showPublisher.module";
import {RouterModule} from "@angular/router";
import {ResultLandingUtilsModule} from "../resultLandingUtils.module";
@NgModule({
imports: [CommonModule, LandingModule, ShowAuthorsModule, IconsModule, ShowPublisherModule, RouterModule],
imports: [CommonModule, LandingModule, ShowAuthorsModule, IconsModule, ShowPublisherModule, RouterModule, ResultLandingUtilsModule],
declarations: [LandingHeaderComponent],
exports: [LandingHeaderComponent]
})
export class LandingHeaderModule {}
export class LandingHeaderModule {}

View File

@ -1,5 +1,5 @@
import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview";
import {Context, Measure, Reference} from "../../utils/entities/resultLandingInfo";
import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview";
import {Context, Measure, Metric, Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core';
import {properties} from "../../../../environments/environment";
import {StringUtils} from "../../utils/string-utils.class";
@ -30,35 +30,35 @@ export class ParsingFunctions {
value: 'Twitter Data'
}
]
public notebookInSubjects: boolean = false;
private notebookKeyword: string = "eosc jupyter notebook";
private notebook_label: string = "EOSC";
private notebook_value: string = "EOSC Jupyter Notebook";
public open = 'open_access';
public closed = 'closed_access';
public unknown = 'question_mark';
private instanceWithDoiExists: boolean = false;
constructor() {
}
public ngOnDestroy() {
}
public parseFundingByProjects(fundedByProjects: Project[], relation: any): Project[] {
if (fundedByProjects == undefined) {
fundedByProjects = [];
}
let fundedByProject: Project = {
"id": "", "acronym": "", "title": "",
"funderShortname": "", "funderName": "",
"funding": "", "code": "", "provenanceAction": "", "validated": false
};
if (relation.title != 'unidentified') {
fundedByProject['id'] = relation['to'].content;
fundedByProject['acronym'] = relation.acronym;
@ -75,11 +75,11 @@ export class ParsingFunctions {
fundedByProject['code'] = "";
fundedByProject['provenanceAction'] = "";
}
if (relation.hasOwnProperty("funding")) {
let funding: { "funderName": string, "funderShortname": string, "stream": string };
funding = this.parseFundingTrees(relation.funding);
if (funding.funderName) {
fundedByProject['funderName'] = funding.funderName;
}
@ -93,7 +93,7 @@ export class ParsingFunctions {
fundedByProjects.push(fundedByProject);
return fundedByProjects;
}
// publication & research data : for fundedByProjects | project landing : for funding
public parseFundingTrees(fundingTree: any): { "funderName": string, "funderShortname": string, "stream": string } {
let funding: { "funderName": string, "funderShortname": string, "stream": string } = {
@ -102,64 +102,64 @@ export class ParsingFunctions {
"stream": ""
};
let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
for (let i = 0; i < length; i++) {
let fundingData = Array.isArray(fundingTree) ? fundingTree[i] : fundingTree;
if (fundingData.hasOwnProperty("funder")) {
funding.funderShortname = fundingData['funder'].shortname;
funding.funderName = fundingData['funder'].name;
}
funding.stream = this.addFundingLevel0(fundingData, funding.stream);
funding.stream = this.addFundingLevel1(fundingData, funding.stream);
funding.stream = this.addFundingLevel2(fundingData, funding.stream);
}
return funding;
}
addFundingLevel0(parent: string, fundingStream: string): string {
if (parent.hasOwnProperty("funding_level_0")) {
let level0 = parent['funding_level_0'];
fundingStream += (fundingStream) ? " ; " : "";
fundingStream += level0.name;
}
return fundingStream;
}
addFundingLevel1(parent: string, fundingStream: string): string {
if (parent.hasOwnProperty("funding_level_1")) {
let level1 = parent['funding_level_1'];
// For projects' parsing
if (level1.hasOwnProperty("parent")) {
fundingStream = this.addFundingLevel0(level1.parent, fundingStream);
}
fundingStream += (fundingStream) ? " | " : "";
fundingStream += level1.name;
}
return fundingStream;
}
addFundingLevel2(parent: string, fundingStream: string): string {
if (parent.hasOwnProperty("funding_level_2")) {
let level2 = parent['funding_level_2'];
// For projects' parsing
if (level2.hasOwnProperty("parent")) {
fundingStream = this.addFundingLevel1(level2.parent, fundingStream);
}
fundingStream += (fundingStream) ? " | " : "";
fundingStream += level2.name;
}
return fundingStream;
}
// publication & dataset landing : for collectedFrom
parseCollectedFrom(collectedFrom: { "name": string, "id": string }[],
_collectedFrom: any) {
@ -168,7 +168,7 @@ export class ParsingFunctions {
collectedFrom[length]['name'] = _collectedFrom.name;
collectedFrom[length]['id'] = _collectedFrom.id;
}
// publication & dataset landing : for downloadFrom
addPublisherToHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[],
publisher: string, journal: string,
@ -186,13 +186,13 @@ export class ParsingFunctions {
years: [],
accessRightIcon: ""
};
if (journal) {
available.downloadNames.push(publisher + "/ " + journal['journal']);
} else {
available.downloadNames.push(publisher);
}
available.downloadUrl = properties.doiURL + identifiers.get("doi")[0];
available.accessRightIcon = this.unknown;
/*
@ -204,16 +204,16 @@ export class ParsingFunctions {
}
return hostedBy_collectedFrom;
}
// publication & dataset landing : for downloadFrom
parseDownloadFrom(downloadFrom: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, url: string) {
let key: string = instance['hostedby'].name;
if (key) {
this.addUrlAndAccessMode(downloadFrom, instance, key, url);
}
}
// publication & dataset landing : for publishedIn
parsePublishedIn(publishedIn: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, result: any, url: string, counter: number): number {
if (result != null && result.hasOwnProperty("source")) {
@ -226,7 +226,7 @@ export class ParsingFunctions {
} else {
key = result['source'];
}
if (key) {
this.addUrlAndAccessMode(publishedIn, instance, key, url);
counter++;
@ -234,30 +234,30 @@ export class ParsingFunctions {
}
return counter;
}
// publication & dataset landing : for downloadFrom and publishedIn
addUrlAndAccessMode(mapStructure: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, key: string, url: string) {
if (!mapStructure.has(key)) {
mapStructure.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
}
if (mapStructure.get(key)['url'] == null) {
mapStructure.get(key)['url'] = new Array<string>();
}
if (url) {
mapStructure.get(key)['url'].push(url);
}
if (mapStructure.get(key)['accessMode'] == null) {
mapStructure.get(key)['accessMode'] = new Array<string>();
}
if (instance.hasOwnProperty("accessright")) {
if (url) {
mapStructure.get(key)['accessMode'].push(instance['accessright'].classname);
}
if (this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['accessright'])) {
mapStructure.get(key)['bestAccessMode'] = instance['accessright'].classname;
}
@ -265,13 +265,13 @@ export class ParsingFunctions {
mapStructure.get(key)['accessMode'].push("");
}
}
parseHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[],
instance: any, url: string, globalAccessRight: string) {
if (!url) {
return;
}
let available: HostedByCollectedFrom = {
"downloadNames": [],
"downloadUrl": null,
@ -282,7 +282,7 @@ export class ParsingFunctions {
"years": [],
"license": ""
};
if (instance.hasOwnProperty("hostedby")) {
let downloadNames: Set<string> = new Set();
let length = Array.isArray(instance['hostedby']) ? instance['hostedby'].length : 1;
@ -293,12 +293,12 @@ export class ParsingFunctions {
}
}
available.downloadNames = Array.from(downloadNames);
if (available.downloadNames.length == 0) {
available.downloadNames.push(url.substring(0, 30) + '...'); // substring(from, to);
}
}
if (instance.hasOwnProperty("collectedfrom")) {
let length = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'].length : 1;
for (let i = 0; i < length; i++) {
@ -308,7 +308,7 @@ export class ParsingFunctions {
}
}
}
if (instance.hasOwnProperty("instancetype")) {
let types: Set<string> = new Set();
let length = Array.isArray(instance['instancetype']) ? instance['instancetype'].length : 1;
@ -320,7 +320,7 @@ export class ParsingFunctions {
}
available.types = Array.from(types);
}
if (instance.hasOwnProperty("dateofacceptance")) {
let years: Set<string> = new Set();
let length = Array.isArray(instance['dateofacceptance']) ? instance['dateofacceptance'].length : 1;
@ -331,17 +331,17 @@ export class ParsingFunctions {
}
available.years = Array.from(years);
}
available['downloadUrl'] = url;
if (url.includes("doi.org/")) {
this.instanceWithDoiExists = true;
}
if (instance.hasOwnProperty("accessright")) {
let length = Array.isArray(instance['accessright']) ? instance['accessright'].length : 1;
for (let i = 0; i < length; i++) {
let accessRight = Array.isArray(instance['accessright']) ? instance['accessright'][i] : instance['accessright'];
if (this.changeBestAccessMode(available.accessRight, accessRight)) {
available.accessRight = accessRight.classname;
if (this.changeBestAccessMode(globalAccessRight, accessRight)) {
@ -349,9 +349,9 @@ export class ParsingFunctions {
}
}
}
}
if (available.accessRight) {
if (available.accessRight.toLowerCase().indexOf('open') !== -1) {
available.accessRightIcon = this.open;
@ -363,18 +363,18 @@ export class ParsingFunctions {
} else {
available.accessRightIcon = this.unknown;
}
if (instance.hasOwnProperty("license")) {
available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license'];
}
hostedBy_collectedFrom.push(available);
}
compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) {
let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null);
let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null);
if (firstAccessRight === secondAccessRight) {
return 0;
} else {
@ -406,14 +406,14 @@ export class ParsingFunctions {
}
return 0;
}
// publication & dataset landing : for downloadFrom and publishedIn
changeBestAccessMode(currentAccessMode: string, accessMode: any): boolean {
if (!accessMode) {
return false;
}
accessMode = accessMode.classid;
switch (currentAccessMode) {
case null:
if (accessMode != "UNKNOWN") {
@ -422,22 +422,22 @@ export class ParsingFunctions {
return false;
case "CLOSED":
if (accessMode == "OPEN" ||
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO" ||
accessMode == "RESTRICTED") {
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO" ||
accessMode == "RESTRICTED") {
return true;
}
return false;
case "RESTRICTED":
if (accessMode == "OPEN" ||
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO") {
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO") {
return true;
}
return false;
case "EMBARGO":
if (accessMode == "OPEN" ||
accessMode == "OPEN SOURCE") {
accessMode == "OPEN SOURCE") {
return true;
}
return false;
@ -449,13 +449,13 @@ export class ParsingFunctions {
}
return false;
}
// publication & dataset & software & orp landing : for relatedResearchResults
parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] {
if (researchResults == undefined) {
researchResults = [];
}
let researchResult: RelationResult = {
name: "",
id: "",
@ -466,9 +466,9 @@ export class ParsingFunctions {
provenanceAction: provenanceAction,
relationName: relationName
};
// researchResult.relationName = relation.to.class;
if (relation['resulttype']) {
if (relation['resulttype'].classname == "publication") {
researchResult['class'] = "publication";
@ -513,7 +513,7 @@ export class ParsingFunctions {
researchResults.push(researchResult);
return researchResults;
}
sortByPercentage(results: RelationResult[]): RelationResult[] {
if (results) {
return results.sort(function (a, b) {
@ -522,11 +522,11 @@ export class ParsingFunctions {
}
return results;
}
// publication & dataset landing : for identifiers
parseIdentifiers(pid: any): Map<string, string[]> {
let identifiers = new Map<string, string[]>();
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") {
if (!identifiers.has(pid.classid)) {
@ -546,15 +546,15 @@ export class ParsingFunctions {
}
return identifiers;
}
// publication & dataset landing : for subjects and otherSubjects and classifiedSubjects
parseEoscSubjects(_subjects: any): any[] {
let eoscSubjectsFound = [];
let setOfEoscSubjects: Set<string> = new Set();
let subject;
let length = Array.isArray(_subjects) ? _subjects.length : 1;
for (let i = 0; i < length; i++) {
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
let content: string = subject.code + "";
@ -565,10 +565,10 @@ export class ParsingFunctions {
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
}
}
return eoscSubjectsFound;
}
// publication & dataset landing : for subjects and otherSubjects and classifiedSubjects
parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map<string, string[]>, Map<string, string[]>, string[], string[],] {
// let eoscSubjectsFound = [];
@ -577,12 +577,12 @@ export class ParsingFunctions {
let classifiedSubjects: Map<string, string[]>;
let fos: string[];
let sdg: string[];
let setOfEoscSubjects: Set<string> = new Set();
let subject;
let length = Array.isArray(_subjects) ? _subjects.length : 1;
for (let i = 0; i < length; i++) {
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
if (subject.classid != "") {
@ -615,7 +615,7 @@ export class ParsingFunctions {
if (classifiedSubjects == undefined) {
classifiedSubjects = new Map<string, string[]>();
}
let content: string = subject.content + "";
// let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
// let found: boolean = checkAndAddEoscSubjectResp["found"];
@ -648,10 +648,10 @@ export class ParsingFunctions {
}
return [subjects, otherSubjects, classifiedSubjects, fos, sdg];
}
checkAndAddEoscSubject(setOfEoscSubjects: Set<string>, eoscSubjectsFound, subject, content) {
let found: boolean = false;
if (!setOfEoscSubjects.has(content)) {
// looping through our declared array
this.eoscSubjects.forEach(item => {
@ -664,10 +664,10 @@ export class ParsingFunctions {
}
return {"found": found, "setOfEoscSubject": setOfEoscSubjects, "eoscSubjectsFound": eoscSubjectsFound};
}
parseContexts(_contexts: any): Context[] {
let contexts = new Array<Context>();
let position = 0;
let labels = "";
let context;
@ -675,7 +675,7 @@ export class ParsingFunctions {
for (let i = 0; i < length; i++) {
let numOfCategories: number = 0; // count categories with label
context = Array.isArray(_contexts) ? _contexts[i] : _contexts;
if (context.label && context.hasOwnProperty("type") && (context['type'] == "community" || context['type'] == "ri")) {
if (context.hasOwnProperty("category")) {
let category;
@ -688,7 +688,7 @@ export class ParsingFunctions {
let length1 = Array.isArray(category['concept']) ? category['concept'].length : 1;
for (let j = 0; j < length1; j++) {
categoryConcept = Array.isArray(category['concept']) ? category['concept'][j] : category['concept'];
// initalize if there is concept label or this is the last concept of the category and there were no concepts
// otherwise we could have multiple entries for the same category but without concepts
if (categoryConcept.label || (numOfConcepts == 0 && j == (length1 - 1))) {
@ -703,7 +703,7 @@ export class ParsingFunctions {
contexts[position]['idCategory'] = category.id;
contexts[position]['labelConcept'] = categoryConcept.label ? categoryConcept.label : null;
contexts[position]['idConcept'] = categoryConcept.label ? categoryConcept.id : null;
position++;
numOfConcepts++;
}
@ -743,7 +743,7 @@ export class ParsingFunctions {
}
return contexts;
}
public static getEnermapsConceptId(contexts: any): string {
let enermapsconcepts = contexts.filter(c => {
return c.idCategory == "enermaps::selection" && c.idConcept
@ -751,7 +751,7 @@ export class ParsingFunctions {
return enermapsconcepts && enermapsconcepts.length > 0 ? enermapsconcepts[0].idConcept.split("enermaps::selection::")[1] : null;
// return "hotmaps_heat_tot_curr_density"
}
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
if (!uniqueTypes.has(instance['instancetype'].classname)) {
@ -760,10 +760,10 @@ export class ParsingFunctions {
}
}
}
parseLanguages(_languages: any) {
var languages = new Array<string>();
if (!Array.isArray(_languages)) {
if (_languages.classname != "Undetermined" && _languages.classname) {
languages.push(_languages.classname);
@ -777,10 +777,10 @@ export class ParsingFunctions {
}
return languages;
}
parseCountries(_countries: any) {
var countries = new Array<string>();
if (!Array.isArray(_countries)) {
if (_countries.classname != "Undetermined" && _countries.classname) {
countries.push(_countries.classname);
@ -794,10 +794,10 @@ export class ParsingFunctions {
}
return countries;
}
parseProgrammingLanguages(_pLanguages) {
var pLanguages = new Array<string>();
if (!Array.isArray(_pLanguages)) {
if (_pLanguages.classname != "Undetermined" && _pLanguages.classname) {
pLanguages.push(_pLanguages.classname);
@ -811,7 +811,7 @@ export class ParsingFunctions {
}
return pLanguages;
}
parseReferences(citations: any): Reference[] {
let references: Reference[] = [];
citations = Array.isArray(citations) ? citations : [citations];
@ -834,7 +834,7 @@ export class ParsingFunctions {
});
return references;
}
static parseRelCanonicalId(record, type) {
try {
if (record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"][type]) {
@ -846,9 +846,9 @@ export class ParsingFunctions {
// console.error(e);
}
return record["result"]["header"]["dri:objIdentifier"];
}
parseDescription(description, stripHTML: boolean = false): string {
let abstracts = [];
if (!Array.isArray(description)) {
@ -867,83 +867,89 @@ export class ParsingFunctions {
return abstracts.length > 0 ? ('<p>' + abstracts.join('</p> <p>') + '</p>') : abstracts.join(' ');
}
}
parseMeasures(measures: any[]): Measure {
if (measures && measures.length) {
let parsed: Measure = {
"downloads": null,
"views": null,
"popularity": null,
"influence": null,
"citations": null,
"impulse": null
};
measures.forEach(measure => {
if (measure.id == 'downloads') {
// parsed.downloads = measure.count == 0 ? ' - ' : measure.count;
parsed.downloads = measure.count;
parseMeasures(elements: any[]): Measure {
if (elements && elements.length) {
let bip: Metric[] = [];
let counts: Metric[] = [];
let measure: Measure = {};
elements.forEach(element => {
if (element.id == 'views') {
counts.push({name: 'views', icon: 'visibility', value: element.count, order: 0});
measure.views = element.count;
}
if (measure.id == 'views') {
// parsed.views = measure.count == 0 ? ' - ' : measure.count;
parsed.views = measure.count;
if (element.id == 'downloads') {
counts.push({name: 'downloads', icon: 'download', value: element.count, order: 1});
measure.downloads = element.count;
}
if (measure.id == 'influence') {
if (measure.class == 'C1') {
parsed.influence = 'Top 0.01%';
} else if (measure.class == 'C2') {
parsed.influence = 'Top 0.1%';
} else if (measure.class == 'C3') {
parsed.influence = 'Top 1%';
} else if (measure.class == 'C4') {
parsed.influence = 'Top 10%';
} else if (measure.class == 'A') {
parsed.influence = 'Exceptional';
} else if (measure.class == 'B') {
parsed.influence = 'Substantial';
if (element.id == 'influence_alt') {
bip.push({name: 'citations', icon: 'cite', value: element.score, order: 2});
measure.citations = element.score;
}
if (element.id == 'popularity') {
let metric: Metric = {name: 'popularity', icon: 'fire', value: null, order: 3};
if (element.class == 'C1') {
metric.value = 'Top 0.01%';
} else if (element.class == 'C2') {
metric.value = 'Top 0.1%';
} else if (element.class == 'C3') {
metric.value = 'Top 1%';
} else if (element.class == 'C4') {
metric.value = 'Top 10%';
} else if (element.class == 'A') {
metric.value = 'Exceptional';
} else if (element.class == 'B') {
metric.value = 'Substantial';
} else {
parsed.influence = 'Average';
metric.value = 'Average';
}
measure.popularity = metric.value;
bip.push(metric);
}
if (measure.id == 'popularity') {
if (measure.class == 'C1') {
parsed.popularity = 'Top 0.01%';
} else if (measure.class == 'C2') {
parsed.popularity = 'Top 0.1%';
} else if (measure.class == 'C3') {
parsed.popularity = 'Top 1%';
} else if (measure.class == 'C4') {
parsed.popularity = 'Top 10%';
} else if (measure.class == 'A') {
parsed.popularity = 'Exceptional';
} else if (measure.class == 'B') {
parsed.popularity = 'Substantial';
if (element.id == 'influence') {
let metric: Metric = {name: 'influence', icon: 'landmark', value: null, order: 4};
if (element.class == 'C1') {
metric.value = 'Top 0.01%';
} else if (element.class == 'C2') {
metric.value = 'Top 0.1%';
} else if (element.class == 'C3') {
metric.value = 'Top 1%';
} else if (element.class == 'C4') {
metric.value = 'Top 10%';
} else if (element.class == 'A') {
metric.value = 'Exceptional';
} else if (element.class == 'B') {
metric.value = 'Substantial';
} else {
parsed.popularity = 'Average';
metric.value = 'Average';
}
measure.influence = metric.value;
bip.push(metric);
}
if (measure.id == 'influence_alt') {
// parsed['citations'] = measure.score == 0 ? ' - ' : measure.score;
parsed.citations = measure.score;
}
if (measure.id == 'impulse') {
if (measure.class == 'C1') {
parsed.impulse = 'Top 0.01%';
} else if (measure.class == 'C2') {
parsed.impulse = 'Top 0.1%';
} else if (measure.class == 'C3') {
parsed.impulse = 'Top 1%';
} else if (measure.class == 'C4') {
parsed.impulse = 'Top 10%';
} else if (measure.class == 'A') {
parsed.impulse = 'Exceptional';
} else if (measure.class == 'B') {
parsed.impulse = 'Substantial';
if (element.id == 'impulse') {
let metric: Metric = {name: 'impulse', icon: 'rocket', value: null, order: 5};
if (element.class == 'C1') {
metric.value = 'Top 0.01%';
} else if (element.class == 'C2') {
metric.value = 'Top 0.1%';
} else if (element.class == 'C3') {
metric.value = 'Top 1%';
} else if (element.class == 'C4') {
metric.value = 'Top 10%';
} else if (element.class == 'A') {
metric.value = 'Exceptional';
} else if (element.class == 'B') {
metric.value = 'Substantial';
} else {
parsed.impulse = 'Average';
metric.value = 'Average';
}
measure.impulse = metric.value;
bip.push(metric);
}
});
return parsed;
measure.bip = bip.sort((a, b) => a.order - b.order);
measure.counts = counts.sort((a, b) => a.order - b.order);
return measure;
}
return null;
}

View File

@ -17,6 +17,9 @@ import {SdgComponent} from "./sdg.component";
import {IconsModule} from "../../utils/icons/icons.module";
import {AlertModalModule} from "../../utils/modal/alertModal.module";
import { SearchInputModule } from '../../sharedComponents/search-input/search-input.module';
import {EntityMetadataComponent} from "./entity-metadata.component";
import {IconsService} from "../../utils/icons/icons.service";
import {closed_access, open_access} from "../../utils/icons/icons";
@NgModule({
@ -27,7 +30,8 @@ import { SearchInputModule } from '../../sharedComponents/search-input/search-in
declarations: [
ShowIdentifiersComponent,ShowSubjectsComponent,
FundedByComponent,AvailableOnComponent,TabTableComponent,
RelatedToComponent, FosComponent, SdgComponent
RelatedToComponent, FosComponent, SdgComponent,
EntityMetadataComponent
],
providers:[
],
@ -37,4 +41,8 @@ import { SearchInputModule } from '../../sharedComponents/search-input/search-in
RelatedToComponent, FosComponent, SdgComponent
]
})
export class ResultLandingUtilsModule { }
export class ResultLandingUtilsModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([open_access, closed_access]);
}
}

View File

@ -1,26 +1,26 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {SharedModule} from '../../../openaireLibrary/shared/shared.module';
import {MetricsModule} from '../landing-utils/metrics/metrics.module';
import {LandingModule} from '../landing-utils/landing.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {IFrameModule} from '../../utils/iframe.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {PagingModule} from '../../utils/paging.module';
import {SharedModule} from '../../../openaireLibrary/shared/shared.module';
import {MetricsModule} from '../landing-utils/metrics/metrics.module';
import {LandingModule} from '../landing-utils/landing.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {IFrameModule} from '../../utils/iframe.module';
import {AltMetricsModule} from '../../utils/altmetrics.module';
import {PagingModule} from '../../utils/paging.module';
import {ResultLandingService} from './resultLanding.service';
import {ResultLandingComponent} from './resultLanding.component';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {ResultLandingService} from './resultLanding.service';
import {ResultLandingComponent} from './resultLanding.component';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
import {AlertModalModule} from "../../utils/modal/alertModal.module";
import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module';
import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
import {HelperModule} from "../../utils/helper/helper.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
import {AlertModalModule} from "../../utils/modal/alertModal.module";
import {AnnotationModule} from "../annotation/annotation.module";
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
@ -33,7 +33,7 @@ import {MatFormFieldModule} from "@angular/material/form-field";
import {MatSelectModule} from "@angular/material/select";
import {IconsModule} from "../../utils/icons/icons.module";
import {IconsService} from "../../utils/icons/icons.service";
import {graph, link, quotes, cite, link_to, versions, rocket, fire, landmark, open_access, closed_access} from "../../utils/icons/icons";
import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons";
import {InputModule} from "../../sharedComponents/input/input.module";
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
import {RecaptchaModule} from 'ng-recaptcha';
@ -61,6 +61,6 @@ import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-sugg
})
export class ResultLandingModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([link, graph, quotes, cite, link_to, versions, rocket, fire, landmark, open_access, closed_access])
this.iconsService.registerIcons([link, graph, quotes, cite, link_to, versions, rocket, fire, landmark])
}
}

View File

@ -330,7 +330,7 @@ export class ResultLandingService {
this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher,
this.resultLandingInfo.journal.journal, this.resultLandingInfo.identifiers);
this.resultLandingInfo.journal?.journal, this.resultLandingInfo.identifiers);
// res['result']['metadata']['oaf:entity']['oaf:result']['programmingLanguage']
if (data[12] != null) {

View File

@ -17,71 +17,42 @@ declare var UIkit: any;
@Component({
selector: 'orcid-work',
template: `
<ng-container *ngIf="pageType == 'search'">
<ng-container *ngIf="pageType == 'landing' || pageType == 'search'">
<span *ngIf="!putCodes || putCodes.length == 0"
[attr.uk-tooltip]="(!isLoggedIn) ? tooltipNoLoggedInUser : tooltipAdd"
class="uk-margin-remove-bottom">
<a (click)="currentAction='add'; saveWorkPreparation();"
[class]="'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right@s uk-margin-right '+ ((showLoading || !isLoggedIn) ? 'uk-disabled ' : '') + (!isLoggedIn ? 'half-opacity' : '')">
<icon *ngIf="!showLoading" name="add" ratio="1" flex="true"></icon>
<span *ngIf="showLoading" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span class="uk-margin-small-left uk-flex uk-flex-middle">Add to&#160;
<span class="uk-flex uk-flex-middle">
<span>ORCID&#160;</span>
<img class="" src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="orcid" style="width:16px; height:16px" loading="lazy">&#160;
</span>
</span>
</a>
</span>
<span *ngIf="putCodes && putCodes.length > 0"
[attr.uk-tooltip]="(!isLoggedIn) ? tooltipNoLoggedInUser : tooltipDelete"
class="uk-margin-remove-bottom">
<a (click)="currentAction='delete'; deleteWorks();"
[class]="'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right@s uk-margin-right '+ (showLoading ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading" name="delete" ratio="0.8" flex="true"></icon>
<span *ngIf="showLoading" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span class="uk-margin-small-left uk-flex uk-flex-middle">Delete from&#160;
<span class="uk-flex uk-flex-middle">
<span>ORCID&#160;</span>
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">&#160;
</span>
</span>
</a>
</span>
</ng-container>
<ng-container *ngIf="pageType == 'landing'">
<span *ngIf="!putCodes || putCodes.length == 0"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
<a *ngIf="!showLoading" (click)="currentAction='add'; saveWorkPreparation();"
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder landing-action-button-orcid"
[class.uk-disabled]="showLoading || !isLoggedIn || !pids"
(mouseover)="hoverEvent($event)" (mouseout)="hoverEvent($event)">
<icon name="orcid_add" ratio="1" visuallyHidden="add"></icon>
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder"
[class.uk-disabled]="showLoading || !isLoggedIn || !pids"
[class.uk-text-muted]="showLoading || !isLoggedIn || !pids"
(mouseover)="hoverEvent($event)" (mouseout)="hoverEvent($event)">
<icon [class.text-orcid]="!showLoading && isLoggedIn && pids"
[class.uk-text-muted]="showLoading || !isLoggedIn || !pids" name="orcid_add" ratio="1"
visuallyHidden="add"></icon>
<span class="uk-margin-xsmall-left">Claim</span>
</a>
<span *ngIf="showLoading" class="uk-icon icon-button uk-icon-button-small"><loading
[top_margin]="false" [size]="'small'"></loading></span>
[top_margin]="false" [size]="'small'"></loading></span>
</span>
<span *ngIf="putCodes && putCodes.length > 0"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
<span *ngIf="putCodes && putCodes.length > 0"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
<a *ngIf="!showLoading" (click)="currentAction='delete'; deleteWorks();"
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder landing-action-button-orcid"
[class.uk-disabled]="showLoading || !isLoggedIn || !pids"
(mouseover)="hoverEvent($event, 'delete')" (mouseout)="hoverEvent($event, 'delete')">
<icon name="orcid_bin" ratio="1" visuallyHidden="delete"></icon>
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder"
[class.uk-disabled]="showLoading || !isLoggedIn || !pids"
[class.uk-text-muted]="showLoading || !isLoggedIn || !pids"
(mouseover)="hoverEvent($event, 'delete')" (mouseout)="hoverEvent($event, 'delete')">
<icon [class.text-orcid]="!showLoading && isLoggedIn && pids"
[class.uk-text-muted]="showLoading || !isLoggedIn || !pids" name="orcid_bin" ratio="1"
visuallyHidden="delete"></icon>
<span class="uk-margin-xsmall-left">Remove</span>
</a>
<span *ngIf="showLoading" class="uk-icon icon-button uk-icon-button-small"><loading
[top_margin]="false" [size]="'small'"></loading></span>
[top_margin]="false" [size]="'small'"></loading></span>
</span>
<!-- Old 'remove' code -->
<!-- Old 'remove' code -->
<!-- <span *ngIf="putCodes && putCodes.length > 0"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
@ -101,23 +72,23 @@ declare var UIkit: any;
<div>
<div>{{requestGrantMessage}}</div>
<!-- <div class="uk-margin-medium-top uk-align-right">-->
<!-- <button (click)="closeGrantModal()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
<!-- <span>Cancel</span>-->
<!-- </button>-->
<!-- <div class="uk-margin-medium-top uk-align-right">-->
<!-- <button (click)="closeGrantModal()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
<!-- <span>Cancel</span>-->
<!-- </button>-->
<!-- <button (click)="openGrantWindow()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
<!-- <span>Grant OpenAIRE</span>-->
<!-- </button>-->
<!-- <button (click)="openGrantWindow()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
<!-- <span>Grant OpenAIRE</span>-->
<!-- </button>-->
<!--&lt;!&ndash; <button (click)="openGrantWindow()" type="submit"&ndash;&gt;-->
<!--&lt;!&ndash; class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left orcid-button">&ndash;&gt;-->
<!--&lt;!&ndash; <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}&ndash;&gt;-->
<!--&lt;!&ndash; <span>Create or Connect your ORCID iD</span>&ndash;&gt;-->
<!--&lt;!&ndash; </button>&ndash;&gt;-->
<!-- </div>-->
<!--&lt;!&ndash; <button (click)="openGrantWindow()" type="submit"&ndash;&gt;-->
<!--&lt;!&ndash; class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left orcid-button">&ndash;&gt;-->
<!--&lt;!&ndash; <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}&ndash;&gt;-->
<!--&lt;!&ndash; <span>Create or Connect your ORCID iD</span>&ndash;&gt;-->
<!--&lt;!&ndash; </button>&ndash;&gt;-->
<!-- </div>-->
</div>
</modal-alert>
@ -128,27 +99,29 @@ declare var UIkit: any;
<img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">
<span>&#160;ACTIONS</span>
</span>
<span [attr.uk-tooltip]="(!putCodes || putCodes.length == 0)
<span [attr.uk-tooltip]="(!putCodes || putCodes.length == 0)
? 'This work is currently deleted.'
: 'View this work from your ORCID record'">
<a (click)="currentAction='get'; getOrcidWorks()"
[class]="'uk-button uk-button-default action uk-flex uk-flex-middle '+ ((showLoading || !putCodes || putCodes.length == 0) ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading || currentAction!='get'" name="visibility" ratio="1" flex="true"></icon>
<span *ngIf="showLoading && currentAction=='get'" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span *ngIf="showLoading && currentAction=='get'" class="uk-icon icon-button"><loading [top_margin]="false"
[size]="'small'"></loading></span>
<span class="uk-margin-small-left">View ORCID work</span>
</a>
</span>
<span [attr.uk-tooltip]="(!putCodes || putCodes.length == 0)
<span [attr.uk-tooltip]="(!putCodes || putCodes.length == 0)
? 'This work is currently deleted.'
: ('Update this work to your ORCID record' + ((properties.environment == 'beta') ? '. The action will affect your real ORCID iD.' : '')
: ('Update this work to your ORCID record' + ((properties.environment == 'beta') ? '. The action will affect your real ORCID iD.' : '')
+ showUpdateDatesInTooltip())">
<a (click)="currentAction='update'; updateWorkPreparation()"
[class]="'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ ((showLoading || !putCodes || putCodes.length == 0) ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading || currentAction!='update'" name="refresh" ratio="1" flex="true"></icon>
<span *ngIf="showLoading && currentAction=='update'" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span *ngIf="showLoading && currentAction=='update'" class="uk-icon icon-button"><loading [top_margin]="false"
[size]="'small'"></loading></span>
<span class="uk-margin-small-left">Update ORCID work</span>
</a>
</span>
@ -158,7 +131,8 @@ declare var UIkit: any;
<a (click)="currentAction='add'; saveWorkPreparation();"
[class]="'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ (showLoading ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading || currentAction!='add'" name="add" ratio="1" flex="true"></icon>
<span *ngIf="showLoading && currentAction=='add'" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span *ngIf="showLoading && currentAction=='add'" class="uk-icon icon-button"><loading [top_margin]="false"
[size]="'small'"></loading></span>
<span class="uk-margin-small-left">Add to ORCID</span>
</a>
</span>
@ -168,7 +142,8 @@ declare var UIkit: any;
<a (click)="currentAction='delete'; deleteWorks();"
[class]="'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ (showLoading ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading || currentAction!='delete'" name="delete" ratio="1" flex="true"></icon>
<span *ngIf="showLoading && currentAction=='delete'" class="uk-icon icon-button"><loading [top_margin]="false" [size]="'small'"></loading></span>
<span *ngIf="showLoading && currentAction=='delete'" class="uk-icon icon-button"><loading [top_margin]="false"
[size]="'small'"></loading></span>
<span class="uk-margin-small-left">Delete from ORCID</span>
</a>
</span>
@ -188,9 +163,9 @@ declare var UIkit: any;
<div class="uk-card uk-card-default uk-padding uk-card-hover">
<div>{{work.title?.title?.value}}</div>
<div>{{work.title?.subtitle?.value}}</div>
<div class="uk-text-uppercase">{{work['journal-title']?.value}}</div>
<div *ngIf="work['publication-date'] || work['type']" class="uk-text-small uk-margin-small-bottom">
<span *ngIf="work['publication-date']">
<span *ngIf="work['publication-date']['year'] && work['publication-date']['year'].value">
@ -224,11 +199,11 @@ declare var UIkit: any;
{{work['short-description']}}
</p>
</div>
<div *ngIf="work['external-ids'] && work['external-ids']['external-id']" class="uk-margin-small-bottom">
<showIdentifiers [identifiers]="parseIdentifiers(work['external-ids']['external-id'])"></showIdentifiers>
</div>
<div *ngIf="work['contributors'] && work['contributors']['contributor']">
<div *ngFor="let contributor of work['contributors']['contributor']">
<span *ngIf="contributor['credit-name'] && contributor['credit-name'].value">
@ -238,24 +213,26 @@ declare var UIkit: any;
(contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role'])
||
(contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence'])
||
||
(contributor['contributor-orcid'] && contributor['contributor-orcid']['path'])
)">
(
</span>
<span *ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role']">
<span
*ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role']">
{{contributor['contributor-attributes']['contributor-role']}}
</span>
<span *ngIf="(contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role'])
<span *ngIf="(contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role'])
&& (contributor['contributor-attributes']['contributor-sequence'] || (contributor['contributor-orcid'] && contributor['contributor-orcid']['path']))">
,
</span>
<span *ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']">
<span
*ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']">
{{contributor['contributor-attributes']['contributor-sequence']}}
</span>
<span *ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']
<span *ngIf="contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']
&& contributor['contributor-orcid'] && contributor['contributor-orcid']['path']">
,
,
</span>
<span *ngIf="contributor['contributor-orcid'] && contributor['contributor-orcid']['path']">
{{contributor['contributor-orcid']?.path}}
@ -276,28 +253,31 @@ declare var UIkit: any;
<modal-alert #propagationModal (alertOutput)="confirmedPropagation()">
<div>
This {{openaireEntities.RESULT}} is the result of <span class="uk-text-bold"> merged {{openaireEntities.RESULTS}} in OpenAIRE</span>.
This {{openaireEntities.RESULT}} is the result of <span
class="uk-text-bold"> merged {{openaireEntities.RESULTS}} in OpenAIRE</span>.
<br><br>
You have already added <span class="uk-text-bold">{{this.putCodes?.length}} works</span> in your ORCID record related to the merged {{openaireEntities.RESULT}}.
You have already added <span class="uk-text-bold">{{this.putCodes?.length}} works</span> in your ORCID record
related to the merged {{openaireEntities.RESULT}}.
<div *ngIf="currentAction == 'delete'">
If you continue with delete action, <span class="uk-text-bold">all these works will be deleted</span>.
</div>
<div *ngIf="currentAction == 'update'">
If you continue with update action, <span class="uk-text-bold">all these works will be deleted and a new merged work will be added</span> instead.
If you continue with update action, <span class="uk-text-bold">all these works will be deleted and a new merged work will be added</span>
instead.
</div>
</div>
<!-- <div class="uk-margin-medium-top uk-align-right">-->
<!-- <button (click)="closePropagationModal()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
<!-- <span>Cancel</span>-->
<!-- </button>-->
<!-- <div class="uk-margin-medium-top uk-align-right">-->
<!-- <button (click)="closePropagationModal()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-button-default">-->
<!-- <span>Cancel</span>-->
<!-- </button>-->
<!-- <button (click)="confirmedPropagation()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
<!-- <span>Continue</span>-->
<!-- </button>-->
<!-- </div>-->
<!-- <button (click)="confirmedPropagation()" type="submit"-->
<!-- class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">-->
<!-- <span>Continue</span>-->
<!-- </button>-->
<!-- </div>-->
</modal-alert>
`
})
@ -314,54 +294,54 @@ export class OrcidWorkComponent {
@Input() updateDates: string[] = [];
@Input() givenPutCode: boolean = false;
@Input() pageType: string = "search";
public subscriptions: Subscription[] = [];
@ViewChild('workModal') workModal;
// @ViewChild('saveWorkModal') saveWorkModal;
@ViewChild('grantModal') grantModal;
// @ViewChild('messageModal') messageModal;
@ViewChild('propagationModal') propagationModal;
public requestGrant: boolean = false;
public requestGrantMessage: string = "Please grant OpenAIRE to access and update your ORCID works.";
private tokenUrl: string;
public message: string = "";
public showLoading: boolean = false;
public works: any[] = [];
public orcidWorks: any[] = [];
public window: any;
public isLoggedIn: boolean = false;
public currentAction: string = "";
public hoverAdd: boolean = false;
public hoverDelete: boolean = false;
public properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
constructor(private route: ActivatedRoute,
private _router: Router,
private orcidService: OrcidService,
private resultLandingService: ResultLandingService,
private userManagementService: UserManagementService) {
if(typeof document !== 'undefined') {
if (typeof document !== 'undefined') {
this.tokenUrl = properties.orcidTokenURL
+ "client_id="+properties.orcidClientId
+ "client_id=" + properties.orcidClientId
// + "&response_type=code&scope=/activities/update"
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
+ "&response_type=code&scope=/activities/update /read-limited"
+ "&redirect_uri="+location.origin+"/orcid?source=openaire";
+ "&redirect_uri=" + location.origin + "/orcid?source=openaire";
}
}
ngOnInit() {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
if (user) {
this.isLoggedIn = true;
if(!this.givenPutCode) {
if (!this.givenPutCode) {
this.getPutCode();
}
} else {
@ -371,7 +351,7 @@ export class OrcidWorkComponent {
this.isLoggedIn = false;
}));
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
@ -380,16 +360,16 @@ export class OrcidWorkComponent {
}
});
}
public showUpdateDatesInTooltip() {
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
let response: string = "";
if(this.updateDates != null && this.updateDates.length > 0) {
if (this.updateDates != null && this.updateDates.length > 0) {
response += "<br><br> Last update in ORCID<br>";
for(let i=0; i<this.updateDates.length; i++) {
for (let i = 0; i < this.updateDates.length; i++) {
let date: Date = new Date(this.updateDates[i]);
response += "<span>"+date.getDate() + " " + monthNames[date.getMonth()] + " " + date.getFullYear();
if(i < this.updateDates.length - 1) {
response += "<span>" + date.getDate() + " " + monthNames[date.getMonth()] + " " + date.getFullYear();
if (i < this.updateDates.length - 1) {
response += "& ";
}
response += "</span>";
@ -397,29 +377,34 @@ export class OrcidWorkComponent {
}
return response;
}
public parseIdentifiers(identifiers: ExternalIDV3_0[]): Map<string, string[]> {
let identifiersMap: Map<string, string[]> = new Map<string, string[]>();
for(let identifier of identifiers) {
if(!identifiersMap.has(identifier['external-id-type'])) {
for (let identifier of identifiers) {
if (!identifiersMap.has(identifier['external-id-type'])) {
identifiersMap.set(identifier['external-id-type'], new Array<string>());
}
identifiersMap.get(identifier['external-id-type']).push(identifier['external-id-value']);
}
return identifiersMap;
}
openGrantWindow() {
if(!Session.isLoggedIn()){
if (!Session.isLoggedIn()) {
//this.userValidMessage = "User session has expired. Please login again.";
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
// this.tokenUrl = location.origin+"/orcid";
this.window = window.open(this.tokenUrl, '_blank',
'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes');
// this.requestGrant = false;
this.closeGrantModal();
let self = this;
window.onmessage = function (ev) {
if (ev.isTrusted && ev.origin == location.origin && ev.data == 'success') {
@ -441,17 +426,17 @@ export class OrcidWorkComponent {
}
}
}
private getPutCode() {
this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe(
putCodes => {
this.putCodes = putCodes;
}, error => {
}
))
}
private getResultLandingInfo(action: string) {
this.subscriptions.push(this.resultLandingService.getResultLandingInfo(this.resultId, null, this.type, null, properties).subscribe(
resultLandingInfo => {
@ -463,7 +448,7 @@ export class OrcidWorkComponent {
}
this.pids = pidsArray.join();
}
if(action == "save") {
if (action == "save") {
this.saveWork();
} else if (action == "update") {
this.updateWork();
@ -475,18 +460,23 @@ export class OrcidWorkComponent {
}
))
}
public saveWorkPreparation() {
if(!Session.isLoggedIn()){
if (!Session.isLoggedIn()) {
//this.userValidMessage = "User session has expired. Please login again.";
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
if (this.requestGrant) {
this.openGrantModal("Add, delete or edit work in your ORCID record");
} else {
this.showLoading = true;
if (this.resultLandingInfo) {
this.saveWork();
} else {
@ -495,42 +485,42 @@ export class OrcidWorkComponent {
}
}
}
private saveWork() {
this.subscriptions.push(this.orcidService.saveWork(this.resultLandingInfo, this.pids).subscribe(
response => {
// for testing only
// this.openGrantModal("Add work in your ORCID record");
// this.requestGrant = true;
// this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works.";
if(response == null) {
if (response == null) {
this.handleError(null);
console.error("Error posting landing info: null");
} else {
this.putCodes.push(""+response['put-code']);
this.putCodes.push("" + response['put-code']);
this.creationDates.push(response['created-date']['value']);
this.updateDates.push(response['last-modified-date']['value']);
// this.closeGrantModal();
// this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!";
this.message = "You have successfully added work \""+this.resultTitle+"\" in your ORCID record!";
this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!";
// this.openMessageModal("Work added successfully");
// message: 'You have <strong>successfully added</strong> work with pids: <strong>'+this.pids+'</strong> in your ORCID record!',
UIkit.notification({
message: 'You have <strong>successfully added</strong> work "<strong>'+this.resultTitle+'</strong>" in your ORCID record!'
// +
// '<br><br><a class="uk-link" [href]="goToOrcidLinksPage()">Manager your ORCID links</a>'
message: 'You have <strong>successfully added</strong> work "<strong>' + this.resultTitle + '</strong>" in your ORCID record!'
// +
// '<br><br><a class="uk-link" [href]="goToOrcidLinksPage()">Manager your ORCID links</a>'
,
// '<br><br><a class="uk-link" (click)="goToOrcidLinksPage()">Manager your ORCID links</a>',
// '<br><br><a class="uk-link" routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>',
// '<br><br><a class="uk-link" (click)="goToOrcidLinksPage()">Manager your ORCID links</a>',
// '<br><br><a class="uk-link" routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>',
status: 'success',
timeout: 6000,
pos: 'bottom-right'
});
this.showLoading = false;
}
},
@ -540,23 +530,28 @@ export class OrcidWorkComponent {
}
));
}
goToOrcidLinksPage() {
this._router.navigate([this.properties.myOrcidLinksPage]);
}
private updateWorkPreparation() {
if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
if (this.requestGrant) {
this.openGrantModal("Add, delete or edit work in your ORCID record");
} else if(this.putCodes.length > 1) {
} else if (this.putCodes.length > 1) {
this.openPropagationModal("Update ORCID work");
} else {
this.showLoading = true;
if (this.resultLandingInfo) {
this.updateWork();
} else {
@ -565,18 +560,18 @@ export class OrcidWorkComponent {
}
}
}
private updateWork() {
this.subscriptions.push(this.orcidService.updateWork(this.resultLandingInfo, this.pids, this.putCodes[0]).subscribe(
response => {
if(response) {
if (response) {
this.updateDates[0] = response['last-modified-date'].value;
// message: 'You have <strong>successfully updated</strong> work with pids: <strong>' + this.pids + '</strong> in your ORCID record!',
UIkit.notification({
message: 'You have <strong>successfully updated</strong> work "<strong>' + this.resultTitle + '</strong>" in your ORCID record!'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
,
status: 'success',
timeout: 6000,
@ -591,36 +586,41 @@ export class OrcidWorkComponent {
}
));
}
public confirmedPropagation() {
this.propagationModal.cancel();
this.deleteWorks(true);
//}
// if(this.currentAction == "update") {
// this.saveWork();
// }
}
public getOrcidWorks() {
if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
this.showLoading = true;
this.subscriptions.push(this.orcidService.getOrcidWorks(this.putCodes).subscribe(
(response) => {
let error: boolean = true;
if(response && response['bulk']) {
if (response && response['bulk']) {
response = response['bulk'].filter(res => {
return (!res.error && res.work);
});
if(response && response.length > 0) {
if (response && response.length > 0) {
error = false;
this.orcidWorks = response;
this.openWorkModal();
}
}
if(error) {
if (error) {
UIkit.notification({
message: 'There was an error getting this work. </br> Please make sure you have not deleted it from your ORCID iD.',
status: 'warning',
@ -637,20 +637,25 @@ export class OrcidWorkComponent {
));
}
}
public deleteWorks(confirmed: boolean = false) {
if(!Session.isLoggedIn()){
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,
"redirectUrl": this._router.url
}
});
} else {
if (this.requestGrant) {
this.openGrantModal("Add, delete or edit work in your ORCID record");
} else if(this.putCodes.length > 1 && !confirmed) {
} else if (this.putCodes.length > 1 && !confirmed) {
this.openPropagationModal("Delete ORCID work");
} else {
this.showLoading = true;
if (!this.resultLandingInfo && this.identifiers) {
let pidsArray: string[] = [];
for (let key of Array.from(this.identifiers.keys())) {
@ -658,11 +663,11 @@ export class OrcidWorkComponent {
}
this.pids = pidsArray.join();
}
this.subscriptions.push(this.orcidService.deleteWorks(this.putCodes).subscribe(
deletedPutCodes => {
let deletedAll: boolean = true;
if (deletedPutCodes) {
for (let i = 0; i < deletedPutCodes.length; i++) {
let deletedPutCode = deletedPutCodes[i];
@ -678,24 +683,24 @@ export class OrcidWorkComponent {
} else {
deletedAll = false;
}
if (!deletedAll) {
this.handleError(null);
console.error("Error deleting landing info: null");
} else {
if(this.currentAction == "update") {
if (this.currentAction == "update") {
this.saveWork();
} else {
// this.closeGrantModal();
// this.message = "You have successfully deleted work with pids: " + this.pids + " from your ORCID record!";
this.message = "You have successfully deleted work \"" + this.resultTitle + "\" from your ORCID record!";
// this.openMessageModal("Work deleted successfully");
// message: 'You have <strong>successfully deleted</strong> work with pids: <strong>' + this.pids + '</strong> from your ORCID record!',
UIkit.notification({
message: 'You have <strong>successfully deleted</strong> work "<strong>' + this.resultTitle + '</strong>" from your ORCID record!'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
,
status: 'success',
timeout: 6000,
@ -713,7 +718,7 @@ export class OrcidWorkComponent {
}
}
}
openGrantModal(title: string) {
this.grantModal.cancelButton = true;
this.grantModal.okButton = true;
@ -722,22 +727,22 @@ export class OrcidWorkComponent {
this.grantModal.alertTitle = title;
this.grantModal.open();
}
closeGrantModal() {
this.grantModal.cancel();
}
openWorkModal() {
this.workModal.cancelButton = false;
this.workModal.okButton = false;
this.workModal.alertTitle = "Work in your ORCID record";
this.workModal.open();
}
closeWorkModal() {
this.workModal.cancel();
}
// openMessageModal(title: string) {
// this.messageModal.cancelButton = false;
// this.messageModal.okButton = false;
@ -748,7 +753,7 @@ export class OrcidWorkComponent {
// closeMessageModal() {
// this.messageModal.cancel();
// }
openPropagationModal(title: string) {
this.propagationModal.cancelButton = true;
this.propagationModal.okButton = true;
@ -757,43 +762,43 @@ export class OrcidWorkComponent {
this.propagationModal.alertTitle = title;
this.propagationModal.open();
}
closePropagationModal() {
this.propagationModal.cancel();
}
handleError(error) {
if(error && error.status == "401") {
if (error && error.status == "401") {
this.openGrantModal("Add, delete or edit work in your ORCID record");
this.requestGrant = true;
this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works. ";
// + "If you have already granted OpenAIRE, you just need to login again to ORCID!";
} else if(error && error.status == "403") {
// + "If you have already granted OpenAIRE, you just need to login again to ORCID!";
} else if (error && error.status == "403") {
this.openGrantModal("Add, delete or edit work in your ORCID record");
this.requestGrant = true;
this.requestGrantMessage = "Please login again to ORCID."
// this.openGrantModal();
} else {
this.message = "";
if(error && error.status == "409") {
if (error && error.status == "409") {
this.message = "There is <span class='uk-text-bold'>already a work in your ORCID record</span> with the same information of the work you are trying to add now. <br><br>";
}
if(this.currentAction == "get") {
if (this.currentAction == "get") {
// this.message += "There was an <span class='uk-text-bold'>error getting</span> work with pids: <span class='uk-text-bold'>" + this.pids + "</span> from your ORCID record. <br> Please try again later.";
this.message += "There was an <span class='uk-text-bold'>error getting</span> work \"<span class='uk-text-bold'>" + this.resultTitle + "</span>\" from your ORCID record. <br> Please try again later.";
} else if(this.currentAction == "add") {
} else if (this.currentAction == "add") {
// this.message += "There was an <span class='uk-text-bold'>error adding</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> to your ORCID record. <br> Please try again later.";
this.message += "There was an <span class='uk-text-bold'>error adding</span> work with pids: \"<span class='uk-text-bold'>"+this.pids+"</span>\" to your ORCID record. <br> Please try again later.";
} else if(this.currentAction == "update") {
this.message += "There was an <span class='uk-text-bold'>error adding</span> work with pids: \"<span class='uk-text-bold'>" + this.pids + "</span>\" to your ORCID record. <br> Please try again later.";
} else if (this.currentAction == "update") {
// this.message += "There was an <span class='uk-text-bold'>error updating</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> to your ORCID record. <br> Please try again later.";
this.message += "There was an <span class='uk-text-bold'>error updating</span> work \"<span class='uk-text-bold'>"+this.resultTitle+"</span>\" to your ORCID record. <br> Please try again later.";
} else if(this.currentAction == "delete") {
this.message += "There was an <span class='uk-text-bold'>error updating</span> work \"<span class='uk-text-bold'>" + this.resultTitle + "</span>\" to your ORCID record. <br> Please try again later.";
} else if (this.currentAction == "delete") {
// this.message += "There was an <span class='uk-text-bold'>error deleting</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> from your ORCID record. <br> Please try again later.";
this.message += "There was an <span class='uk-text-bold'>error deleting</span> work \"<span class='uk-text-bold'>"+this.resultTitle+"</span>\" from your ORCID record. <br> Please try again later.";
this.message += "There was an <span class='uk-text-bold'>error deleting</span> work \"<span class='uk-text-bold'>" + this.resultTitle + "</span>\" from your ORCID record. <br> Please try again later.";
} else {
this.message += "There was an error. Please try again later."
}
UIkit.notification({
message: this.message,
status: 'danger',
@ -804,28 +809,28 @@ export class OrcidWorkComponent {
}
this.showLoading = false;
}
get tooltipAdd() {
return "Add this work to your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : "");
}
get tooltipDelete() {
return "Delete this work from your <span class=\"text-orcid\">ORCID</span> record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : "");
}
get tooltipNoPid() {
return "Only resources with a PID (persistent identifier) like DOI, handle, PMID can be added or deleted from your <span class=\"text-orcid\">ORCID</span> record";
}
get tooltipNoLoggedInUser() {
return "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. Please log in first."
return "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. Please log in first."
}
hoverEvent($event, action: string = "add") {
if(action == "add") {
if (action == "add") {
this.hoverAdd = $event.type == "mouseover";
this.hoverDelete = false;
} else if(action == "delete") {
} else if (action == "delete") {
this.hoverDelete = $event.type == "mouseover";
this.hoverAdd = false;
}

View File

@ -252,9 +252,10 @@
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
target="_blank"> OpenAIRE - Explore</a>.
</div>
<div class="uk-flex uk-flex-between uk-flex-middle uk-flex-wrap">
<div class="uk-flex uk-flex-middle uk-flex-wrap" [class.uk-flex-between]="!mobile"
[class.uk-margin-top]="mobile" [class.uk-flex-center]="mobile">
<!-- Total results, number of pages -->
<h6 class="uk-margin-remove">
<div class="uk-margin-remove" [class.uk-h6]="!mobile">
<ng-container *ngIf="results && searchUtils.totalResults > 0">
<span>{{searchUtils.totalResults|number}}</span>
<span class="uk-text-meta uk-text-capitalize"> {{type}}, page </span>
@ -267,9 +268,10 @@
<span>{{searchUtils.page | number}}</span>
<span class="uk-text-meta"> of {{(totalPages(oldTotalResults)|number)}}</span>
</ng-container>
</h6>
</div>
<!-- Download results -->
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)" class="uk-margin-small-bottom uk-margin-small-top">
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
class="uk-margin-small-bottom uk-margin-small-top" [class.uk-margin-medium-top]="mobile">
<search-download
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
[isDisabled]="disabled"

View File

@ -1,4 +1,4 @@
<ul class="uk-list uk-list-xlarge uk-margin" [ngClass]="custom_class">
<ul class="uk-list uk-list-large uk-margin" [class.uk-list-xlarge]="!isMobile" [ngClass]="custom_class">
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<li *ngFor="let result of previewResults" [class.uk-border-bottom]="!isMobile">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations"

View File

@ -30,12 +30,27 @@ export interface Context {
}
export interface Measure {
downloads: string;
views: string;
influence: string;
popularity: string;
citations: string;
impulse: string;
/** @deprecated*/
downloads?: string;
/** @deprecated*/
views?: string;
/** @deprecated*/
influence?: string;
/** @deprecated*/
popularity?: string;
/** @deprecated*/
citations?: string;
/** @deprecated*/
impulse?: string;
bip?: Metric[]
counts?: Metric[]
}
export interface Metric {
name: string,
order: number,
icon: string,
value: any
}
export class ResultLandingInfo {

View File

@ -1,5 +1,5 @@
import {Author, HostedByCollectedFrom, Organization, Project, ResultTitle} from "../result-preview/result-preview";
import {Measure} from "./resultLandingInfo";
import {Measure, Metric} from "./resultLandingInfo";
export class SearchResult {
title: ResultTitle;

View File

@ -15,15 +15,8 @@
</div>
</div>
<div class="uk-width-expand">
<!-- 1st section (title, subtitle and deposit link) -->
<div class="uk-margin-bottom">
<!-- Deposit searchPage URL -->
<!-- <span class="uk-width-expand uk-flex-right">
<a *ngIf="result.websiteURL && promoteWebsiteURL" href="{{result.websiteURL}}" target="_blank" type="submit"
class=" uk-float-right uk-button uk-button-primary uk-padding uk-padding-remove-vertical uk-margin-small-left">
<span><span>Visit repository to deposit</span><span uk-icon="arrow-right"></span></span>
</a>
</span> -->
<!-- 1st section (title, metadata) -->
<div class="uk-margin-small-bottom">
<!-- Title -->
<div>
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
@ -69,25 +62,22 @@
[no title available]
</div>
</div>
<!-- <hr class="uk-margin-remove-bottom" *ngIf="result.websiteURL && promoteWebsiteURL"> -->
</h2>
</div>
<!-- Small subtitle above title -->
<div class="uk-text-small uk-margin-xsmall-bottom">
<span *ngIf="type" class="uk-text-capitalize type">{{type}}</span>
<span *ngIf="type && beforeTitle.length > 0"> . </span>
<span *ngIf="beforeTitle.length > 0" class="uk-text-capitalize">
{{beforeTitle.join(' . ')}}
</span>
<span *ngIf="result.embargoEndDate && result.embargoEndDate != ''">
<span
*ngIf="beforeTitle.length > 0"> . </span> Embargo End Date: {{result.embargoEndDate | date: 'dd MMM yyyy'}}
</span>
<!-- Metadata -->
<div class="uk-margin-xsmall-top">
<entity-metadata [entityType]="type" [types]="result.types" [startYear]="result.startYear?.toString()" [endYear]="result.endYear?.toString()"
[year]="result.year?.toString()" [openAccessMandatePublications]="result.openAccessMandatePublications"
[openAccessMandateDatasets]="result.openAccessMandateDatasets" [date]="" [embargoEndDate]="result.embargoEndDate"
[publisher]="result.publisher" [countries]="result.countries"
[languages]="result.languages" [programmingLanguages]="result.programmingLanguages"
[compatibility]="result.compatibility" [type]="type"
></entity-metadata>
</div>
</div>
<!-- 2nd section (labels only) -->
<div class="uk-margin-bottom">
<!-- Labels -->
<!--<div class="uk-margin-bottom">
&lt;!&ndash; Labels &ndash;&gt;
<div>
<span
*ngIf="result.accessMode && result.accessMode.toLowerCase() !== 'not available'"
@ -127,10 +117,10 @@
{{programmingLanguage}}
</span>{{" "}}
</span>
<!-- <span -->
<!-- *ngIf="result.sc39" class="uk-label" title="Special Clause 39">-->
<!-- Special Clause 39-->
<!-- </span>{{' '}}-->
&lt;!&ndash; <span &ndash;&gt;
&lt;!&ndash; *ngIf="result.sc39" class="uk-label" title="Special Clause 39">&ndash;&gt;
&lt;!&ndash; Special Clause 39&ndash;&gt;
&lt;!&ndash; </span>{{' '}}&ndash;&gt;
<span
*ngIf="result.compatibility && result.compatibility != '' && result.compatibility.toLowerCase() != 'not yet registered'"
class="uk-label" title="Compatibility">
@ -143,11 +133,11 @@
{{result.compatibility}} <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
</span>{{' '}}
</div>
</div>
</div>-->
<!-- 3rd section (funders, budget, authors, PIDs, publisher etc.) -->
<div class="section3 uk-text-small uk-margin-bottom">
<div class="uk-text-small uk-margin-small-bottom">
<!-- Funder -->
<div *ngIf="result.funderShortname || result.code" class="uk-margin-small-bottom">
<div *ngIf="result.funderShortname || result.code" class="uk-margin-xsmall-bottom">
<span *ngIf="result.funderShortname">
<span class="uk-text-meta">Funder: </span>
{{result.funderShortname}}
@ -163,7 +153,7 @@
<!-- </span>-->
</div>
<!-- Funder Budget -->
<div *ngIf="result.budget || result.contribution" class="uk-margin-small-bottom">
<div *ngIf="result.budget || result.contribution" class="uk-margin-xsmall-bottom">
<span *ngIf="result.budget">
<span class="uk-text-meta">Overall Budget: </span>
{{result.budget | number}}
@ -176,31 +166,16 @@
</span>
</div>
<!-- Authors -->
<div *ngIf="result.authors" class="uk-flex uk-margin-small-bottom">
<span class="uk-text-meta">Authors:&nbsp;</span>
<div *ngIf="result.authors" class="uk-flex uk-margin-xsmall-bottom">
<showAuthors [authors]="result.authors" [authorsLimit]=10 [modal]="modal"
[showAll]=false></showAuthors>
</div>
<!-- Identifiers -->
<div *ngIf="result.identifiers && result.identifiers.size > 0" class="uk-margin-small-bottom">
<div *ngIf="result.identifiers && result.identifiers.size > 0" class="uk-margin-xsmall-bottom">
<showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
</div>
<!-- Publisher -->
<div *ngIf="result.publisher && result.publisher != ''" class="uk-margin-small-bottom">
<span class="uk-text-meta">Publisher: </span>
{{result.publisher}}
</div>
<!-- Countries -->
<div *ngIf="result.countries && result.countries.length > 0"
class="uk-margin-small-bottom">
<span class="uk-text-meta">{{(result.countries.length == 1) ? 'Country' : 'Countries'}}: </span>
<span *ngFor="let country of result.countries.slice(0,10) let i = index">
{{country}}{{(i < (result.countries.slice(0, 10).length - 1)) ? ", " : ""}}
{{(i == result.countries.slice(0, 10).length - 1 && result.countries.length > 10) ? "..." : ""}}
</span>
</div>
<!-- Projects -->
<div *ngIf="result.projects && result.projects.length > 0" class="uk-margin-small-bottom">
<div *ngIf="result.projects && result.projects.length > 0" class="uk-margin-xsmall-bottom">
<span class="uk-text-meta"> Project: </span>
<span *ngFor="let project of result.projects.slice(0,10) let i=index">
<span>
@ -217,7 +192,7 @@
</div>
<!-- Organizations -->
<div *ngIf="showOrganizations && result.organizations && result.organizations.length > 0"
class="uk-margin-small-bottom">
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>
@ -227,7 +202,7 @@
</div>
<!-- Website URL -->
<div *ngIf="result.websiteURL && result.websiteURL != '' && !promoteWebsiteURL"
class="uk-margin-small-bottom">
class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">Website URL: </span>
<span>
<a href="{{result.websiteURL}}" target="_blank" class="custom-external">
@ -236,7 +211,7 @@
</span>
</div>
<!-- OAI-PMH URL-->
<div *ngIf="result.OAIPMHURL && result.OAIPMHURL != ''" class="uk-margin-small-bottom">
<div *ngIf="result.OAIPMHURL && result.OAIPMHURL != ''" class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">OAI-PMH URL: </span>
<span>
<a href="{{result.OAIPMHURL}}" target="_blank" class="custom-external">
@ -246,7 +221,7 @@
</div>
<!-- Subjects -->
<div *ngIf="showSubjects && result.subjects && result.subjects.length > 0"
class="uk-margin-small-bottom">
class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">Subject: </span>
<span *ngFor="let subject of result.subjects.slice(0,10) let i = index">
<span>{{subject}}</span>
@ -254,42 +229,9 @@
<span>{{(i == result.subjects.slice(0, 10).length - 1 && result.subjects.length > 10) ? "..." : ""}}</span>
</span>
</div>
<!-- Download from-->
<div *ngIf="result.hostedBy_collectedFrom && result.hostedBy_collectedFrom.length > 0"
class="uk-margin-small-bottom">
<div *ngFor="let from of result.hostedBy_collectedFrom"
[title]="from.accessRight ? from.accessRight : 'Not available'"
class="uk-flex uk-flex-middle">
<span
[class]="'uk-margin-small-right ' + (from.accessRightIcon == 'lock_open' ? 'uk-text-success' : 'uk-text-meta')">
<icon [name]="from.accessRightIcon" flex="true" type="outlined"></icon>
</span>
<span class="uk-width-expand">
<span class="uk-margin-right uk-display-inline-block">
<span class="uk-text-meta">Download from: </span>
<a *ngIf="from.downloadUrl"
[href]="from.downloadUrl" target="_blank" class="title">
<span class="custom-external">{{from.downloadNames.join("; ")}}</span>
</a>
<span *ngIf="!from.downloadUrl || from.downloadUrl.length === 0" class="title">
<span>{{from.downloadNames.join(", ")}}</span>
</span>
</span>
<span class="provider uk-display-inline-block">
<span class="uk-text-meta">Provider: </span>
<a *ngFor="let collectedName of from.collectedNamesAndIds.keys(); let i=index"
[routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: from.collectedNamesAndIds.get(collectedName)}" (click)="onClick();">
{{collectedName}}
<ng-container *ngIf="(i !== (from.collectedNamesAndIds.size - 1))">; </ng-container>
</a>
</span>
</span>
</div>
</div>
</div>
<!-- 4th section (description) -->
<div class="section4 uk-text-small">
<div class="uk-text-small">
<!-- Description -->
<div *ngIf="result.description" class="multi-line-ellipsis lines-3">
<p class="uk-text-meta" [innerHTML]="result.description"></p>
@ -297,7 +239,7 @@
</div>
<!-- 5th section(deposit only) -->
<div>
<span class="uk-width-expand uk-flex-right">
<span class="uk-flex uk-flex-right uk-margin-small-top">
<a *ngIf="result.websiteURL && promoteWebsiteURL" href="{{result.websiteURL}}" target="_blank" type="submit"
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
@ -311,120 +253,77 @@
</div>
</div>
<!--&& loggedIn (card footer)-->
<div *ngIf="result.measure ||((properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator')
&& ((showOrcid && result.identifiers && result.identifiers.size > 0 && isResultType) || result.orcidCreationDates?.length > 0))"
class="uk-text-small"
[ngClass]="{'uk-card-footer': isCard}">
<!-- Impact Factors-->
<span class="uk-flex uk-flex-top uk-flex-wrap" style="grid-gap: 10px;">
<ng-container *ngIf="result.measure?.length">
<!--Popularity -->
<a title="Popularity"
class="popularity-{{result.measure[0]}} uk-margin-right uk-flex uk-flex-middle uk-width-auto@s uk-width-1-1">
<svg xmlns="http://www.w3.org/2000/svg" width="10.749" height="14.33" viewBox="0 0 10.749 14.33"><defs><!--<style>.a{fill:#d51717;}</style>--></defs><path
class="a"
d="M10.382.67a14.44,14.44,0,0,1,.5,3.225A2.331,2.331,0,0,1,8.589,6.4,2.445,2.445,0,0,1,6.15,3.895l.02-.242A9.25,9.25,0,0,0,4,9.625a5.375,5.375,0,0,0,10.749,0A11.5,11.5,0,0,0,10.382.67ZM9.18,12.985a2.134,2.134,0,0,1-2.163-2.11A2.1,2.1,0,0,1,8.9,8.779a5.181,5.181,0,0,0,3.1-1.733,9.374,9.374,0,0,1,.4,2.714A3.226,3.226,0,0,1,9.18,12.985Z"
transform="translate(-4 -0.67)"/>
</svg>
<span class="uk-margin-small-left">
{{" " + result.measure[2] + " popularity" }}
</span>
</a>
<div class="default-dropdown uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
<span class="uk-flex uk-flex-middle">
<span class="popularity-{{result.measure[0]}}">
<svg xmlns="http://www.w3.org/2000/svg" width="20.234" height="26.974"
viewBox="0 0 20.234 26.974"><defs> </defs><path class="a"
d="M16.014.67a27.181,27.181,0,0,1,.936,6.07c0,2.605-1.707,4.717-4.312,4.717A4.6,4.6,0,0,1,8.047,6.74l.038-.455A17.411,17.411,0,0,0,4,17.527a10.117,10.117,0,0,0,20.234,0A21.643,21.643,0,0,0,16.014.67ZM13.75,23.85A4.016,4.016,0,0,1,9.678,19.88c0-2.049,1.328-3.49,3.554-3.946a9.753,9.753,0,0,0,5.843-3.263,17.645,17.645,0,0,1,.746,5.109,6.072,6.072,0,0,1-6.07,6.07Z"
transform="translate(-4 -0.67)"/>
</svg>
<div *ngIf="result.hostedBy_collectedFrom || result.measure?.bip.length || result.measure?.counts.length"
class="uk-text-small" [class.uk-visible@m]="!result.measure?.bip.length && result.measure?.counts.length" [ngClass]="{'uk-card-footer': isCard}">
<div class="uk-grid uk-grid-small uk-flex-between uk-flex-middle uk-grid-divider uk-margin-xsmall-bottom" uk-grid>
<div *ngIf="result.hostedBy_collectedFrom" class="uk-width-auto uk-visible@m">
<availableOn [availableOn]="result.hostedBy_collectedFrom" [source]="false"></availableOn>
</div>
<div *ngIf="hasActions" class="uk-width-expand uk-visible@m">
<span class="uk-grid uk-grid-small uk-child-width-auto uk-text-xsmall" uk-grid>
<span *ngIf="orcid">
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
[resultId]="result.relcanId" [resultTitle]="result.title"
[type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
</orcid-work>
</span>
<span *ngIf="orcid" class="uk-width-expand uk-text-right">
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
<span class="uk-text-meta">
Added in ORCID:
</span>
<span class="uk-margin-small-left">
{{" " + result.measure[2] + " popularity" }}
</span>
<span class="uk-margin-small-left">
{{" " + (result.measure[0] == 'A' ? 'In top 0.01%' : '') + (result.measure[0] == 'B' ? 'In top 1%' : '') + (result.measure[0] == 'C' ? 'In bottom 99%' : '')}}
</span>
</span>
<div class="uk-text-meta uk-margin">
Popularity: Citation-based measure reflecting the current impact.
</div>
<div>
<a title="Link to Bip!Finder" class="uk-float-right" target="_blank"
href="https://bip.imis.athena-innovation.gr/site/details?id={{result.objId}}">
View more details
</a>
</div>
</div>
<!--Influence -->
<a title="Influence"
class="influence-{{result.measure[1]}} uk-margin-right uk-flex uk-flex-middle uk-width-auto@s uk-width-1-1">
<svg xmlns="http://www.w3.org/2000/svg" width="12.667" height="14" viewBox="0 0 12.667 14">
<defs><!--<style>.a{fill:#e1920a;}</style>--></defs>
<path class="a"
d="M3.333,7v4.667h2V7Zm4,0v4.667h2V7ZM2,15H14.667V13H2Zm9.333-8v4.667h2V7Zm-3-6L2,4.333V5.667H14.667V4.333Z"
transform="translate(-2 -1)"/>
</svg>
<span class="uk-margin-small-left">
{{" " + result.measure[3] + " influence" }}
</span>
</a>
<div class="default-dropdown uk-margin-remove-top uk-padding-small"
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
<span class="uk-flex uk-flex-middle">
<span class="influence-{{result.measure[1]}}">
<svg xmlns="http://www.w3.org/2000/svg" width="24.299" height="26.857" viewBox="0 0 24.299 26.857"><defs><style>.a {
fill: #464646;
}</style></defs><path class="a"
d="M4.558,12.51v8.952H8.394V12.51Zm7.673,0v8.952h3.837V12.51ZM2,27.857H26.3V24.02H2ZM19.9,12.51v8.952h3.837V12.51ZM14.149,1,2,7.394V9.952H26.3V7.394Z"
transform="translate(-2 -1)"/>
</svg>
</span>
<span class=" uk-margin-small-left">
{{result.measure[3] + " influence" }}
</span>
<span class="uk-margin-small-left">
{{" " + (result.measure[1] == 'A' ? 'In top 0.01%' : '') + (result.measure[1] == 'B' ? 'In top 1%' : '') + (result.measure[1] == 'C' ? 'In bottom 99%' : '')}}
</span>
</span>
<div class="uk-text-meta uk-margin">
Influence: Citation-based measure reflecting the total impact.
</div>
<div>
<a title="Link to Bip!Finder" class=" uk-float-right" target="_blank"
href="https://bip.imis.athena-innovation.gr/site/details?id={{result.objId}}">
View more details
</a>
</div>
</div>
</ng-container>
<!-- && loggedIn -->
<!-- TODO: change colors/opacity and disabled attr for ORCID buttons -->
<span *ngIf="(properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator')
&& showOrcid && result.identifiers && result.identifiers.size > 0 && isResultType"
class="uk-margin-auto-left">
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
[resultId]="result.relcanId" [resultTitle]="result.title"
[type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
</orcid-work>
</span>
<span
*ngIf="(properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community') && result.orcidCreationDates?.length > 0"
class="uk-width-expand uk-text-right">
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
<span class="uk-text-meta">
Added in ORCID:
</span>
<span *ngFor="let date of result.orcidCreationDates; let i=index">
{{date | date: 'dd MMM yyyy'}}
<span *ngIf="i < (result.orcidCreationDates.length - 1)">
&
<span *ngFor="let date of result.orcidCreationDates; let i=index">
{{date | date: 'dd MMM yyyy'}}
<span *ngIf="i < (result.orcidCreationDates.length - 1)">
&
</span>
</span>
</span>
</span>
</span>
</span>
</div>
<div *ngIf="result.measure?.bip.length || result.measure?.counts.length"
class="uk-text-xsmall uk-width-auto metrics uk-flex uk-flex-middle uk-flex-right uk-text-meta">
<ng-container *ngIf="result.measure?.bip.length">
<a class="uk-flex uk-flex-middle uk-link-reset">
<icon customClass="bip-icon-hover" [flex]="true" [ratio]="0.7" [name]="result.measure.bip[0].icon"></icon>
<span class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span>
</a>
<div uk-drop="pos: top-left" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table>
<tr *ngFor="let metric of result.measure.bip">
<td class="bip-icon"><icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon></td>
<td class="uk-text-capitalize">{{metric.name}}</td>
<td class="uk-text-bolder">{{metric.value}}</td>
</tr>
</table>
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
<img class="uk-margin-xsmall-right" width="15" src="assets/common-assets/bip-minimal.svg" loading="lazy" alt="BIP!">
<span class="uk-text-uppercase">Powered by <span class="uk-text-bolder">BIP!</span></span>
</div>
</div>
</ng-container>
<ng-container *ngIf="result.measure?.counts.length">
<a class="uk-flex uk-flex-middle uk-margin-small-left uk-link-reset">
<icon class="text-usage-counts-hover" [flex]="true" [ratio]="0.8" [name]="result.measure.counts[0].icon"></icon>
<span class="uk-margin-xsmall-left">{{result.measure.counts[0].value}}</span>
</a>
<div uk-drop="pos: top-left" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table>
<tr *ngFor="let metric of result.measure.counts">
<td class="text-usage-counts"><icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon></td>
<td class="uk-text-capitalize">{{metric.name}}</td>
<td class="uk-text-bolder">{{metric.value}}</td>
</tr>
</table>
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
<span class="uk-text-uppercase">Powered by </span>
<img class="uk-margin-xsmall-left" width="15" src="assets/common-assets/logo-small-usage-counts.png" loading="lazy" alt="BIP!">
</div>
</div>
</ng-container>
</div>
</div>
</div>
</div>

View File

@ -14,4 +14,15 @@
.popularity-C, .popularity-C5, .influence-C, .influence-C5 {
& svg a {
fill: #444;
}}
}
}
.metrics {
& .uk-drop {
max-width: 200px;
}
& table td {
padding: 2px 5px;
}
}

View File

@ -4,7 +4,6 @@ import {EnvProperties} from "../properties/env-properties";
import {RouterHelper} from "../routerHelper.class";
import {AlertModal} from "../modal/alert";
import {properties} from "../../../../environments/environment";
import {Session} from "../../login/utils/helper.class";
import {Identifier, StringUtils} from "../string-utils.class";
import {OpenaireEntities} from "../properties/searchFields";
import {HelperFunctions} from "../HelperFunctions.class";
@ -29,29 +28,43 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
public urlParam: string;
public url: string;
@Input() externalUrl: string;
public type: string;
public beforeTitle: string[] = [];
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
@Input() showOrcid: boolean = true;
@Input() showEnermaps: boolean = false;
@Input() deposit: boolean = false;
@Input() provenanceActionVocabulary = null;
@Input() relationsVocabulary = null;
/* Metadata */
public type: string;
public types: string[];
public provenanceAction: string;
public relationName: string;
public linking: boolean = false;
public share: boolean = false;
public cite: boolean = false;
public orcid: boolean = false;
ngOnInit(): void {
if (this.hasLink) {
if (this.result.resultType === "publication") {
this.urlParam = "articleId";
this.url = properties.searchLinkToPublication.split('?')[0];
this.resultActions();
} else if (this.result.resultType === "dataset") {
this.urlParam = "datasetId";
this.url = properties.searchLinkToDataset.split('?')[0];
this.resultActions();
} else if (this.result.resultType === "software") {
this.urlParam = "softwareId";
this.url = properties.searchLinkToSoftwareLanding.split('?')[0];
this.resultActions();
} else if (this.result.resultType === "other") {
this.urlParam = "orpId";
this.url = properties.searchLinkToOrp.split('?')[0];
this.resultActions();
} else if (this.result.resultType == "project") {
if (this.result.id) {
this.urlParam = "projectId";
@ -80,7 +93,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
}
this.checkPID();
}
this.initBeforeTitle();
this.initMetadata();
if (this.result.languages) {
this.result.languages = this.removeUnknown(this.result.languages);
}
@ -89,6 +102,14 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
}
}
resultActions() {
this.linking = true;
this.share = true;
this.cite = true;
this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator') &&
this.showOrcid && this.result.identifiers && this.result.identifiers.size > 0;
}
ngOnChanges(changes: SimpleChanges) {
if (changes.result && this.hasLink) {
this.checkPID();
@ -109,35 +130,28 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return Identifier.getPIDFromIdentifiers(this.result.identifiers);
}
public initBeforeTitle() {
public initMetadata() {
if (this.result.resultType && this.result.resultType !== 'dataprovider') {
this.type = this.getTypeName(this.result.resultType);
}
if (this.result.types) {
this.removeUnknown(this.removeDuplicates(this.result.types)).forEach(type => {
this.beforeTitle.push(type);
});
}
if (this.result.year) {
this.beforeTitle.push(this.result.year.toString());
}
if (this.result.startYear && this.result.endYear) {
this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString());
this.types = this.removeUnknown(this.removeDuplicates(this.result.types));
}
if (this.result.provenanceAction) {
let value = HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary, false);
if (value) {
this.beforeTitle.push(value);
}
this.provenanceAction = HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary, false);
}
if (this.result.relationName) {
this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary));
this.relationName = HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary);
}
// if(this.result.percentage) {
// this.beforeTitle.push((this.result.relation ? this.result.relation+": " : "") + this.result.percentage.toString() + "%");
// }
}
get hasActions() {
return this.linking || this.share || this.cite || this.orcid;
}
public getTypeName(type: string): string {
return StringUtils.getEntityName(type, false);
}
@ -174,7 +188,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return this.routerHelper.createQueryParam(this.urlParam, this.result.id)
}
public get isResultType() {
return this.result.resultType == "publication" || this.result.resultType == "dataset" ||
this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result";

View File

@ -6,10 +6,16 @@ import {ShowAuthorsModule} from "../authors/showAuthors.module";
import {ResultLandingUtilsModule} from "../../landingPages/landing-utils/resultLandingUtils.module";
import {OrcidModule} from "../../orcid/orcid.module";
import {IconsModule} from "../icons/icons.module";
import {IconsService} from "../icons/icons.service";
import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../icons/icons";
@NgModule({
imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule],
declarations: [ResultPreviewComponent],
exports: [ResultPreviewComponent]
})
export class ResultPreviewModule {}
export class ResultPreviewModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([link, quotes, cite, link_to, rocket, fire, landmark])
}
}

View File

@ -1,5 +1,5 @@
import {SearchResult} from "../entities/searchResult";
import {Measure, ResultLandingInfo} from "../entities/resultLandingInfo";
import {Measure, Metric, ResultLandingInfo} from "../entities/resultLandingInfo";
import {OrganizationInfo} from "../entities/organizationInfo";
export interface HostedByCollectedFrom {
@ -199,6 +199,7 @@ export class ResultPreview {
resultPreview.identifiers = result.identifiers;
resultPreview.enermapsId = result.enermapsId;
resultPreview.measure = result.measure;
resultPreview.hostedBy_collectedFrom = result.hostedBy_collectedFrom;
return resultPreview;
}