Merge from origin/develop

This commit is contained in:
Konstantinos Triantafyllou 2023-09-26 11:50:07 +03:00
commit 6d7f6eca72
9 changed files with 50 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@ -60,10 +60,10 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span>{{year}}</span>
</ng-container>
<ng-container *ngIf="startYear && !endYear">
<span>{{startYear}}</span>
<span>From {{startYear}}</span>
</ng-container>
<ng-container *ngIf="!startYear && endYear">
<span>{{endYear}}</span>
<span>Until {{endYear}}</span>
</ng-container>
<ng-container *ngIf="startYear && endYear">
<ng-container>

View File

@ -464,6 +464,7 @@ export class ProjectComponent {
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
data => {
this.projectInfo = data;
this.projectInfo.id = this.projectId;
this.actionsAfterGettingProjectInfo();
},

View File

@ -163,7 +163,7 @@ export class MyOrcidLinksComponent {
if(typeof document !== 'undefined') {
this.tokenUrl = properties.orcidTokenURL
+ "clientid="+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"

View File

@ -160,7 +160,9 @@ export class SearchResearchResultsComponent {
this.searchUtils.validateSize(params['size']);
this.searchUtils.sortBy = (params['sortBy']) ? params['sortBy'] : '';
if (this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") {
if (this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending"
&& this.searchUtils.sortBy != "citation_count,descending" && this.searchUtils.sortBy != "popularity,descending"
&& this.searchUtils.sortBy != "influence,descending" && this.searchUtils.sortBy != "impulse,descending") {
this.searchUtils.sortBy = "";
}
this.selectedFields = [];

View File

@ -1,5 +1,6 @@
import {Component, Input, Output, EventEmitter} from '@angular/core';
import {Option} from "../../sharedComponents/input/input.component";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'search-sorting',
@ -19,11 +20,21 @@ export class SearchSortingComponent {
@Input() entityType: string = '';
@Output() sortByChange = new EventEmitter();
public options: Option[];
private generalOptions = [
{value: '', label: 'Relevance'},
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
{value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'},
];
private generalOptions = properties.environment != "production" ?
[
{value: '', label: 'Relevance'},
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
{value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'},
{value: 'citation_count,descending', label: 'Citation Count'},
{value: 'popularity,descending', label: 'Popularity'},
{value: 'influence,descending', label: 'Influence'},
{value: 'impulse,descending', label: 'Impulse'}
] :
[
{value: '', label: 'Relevance'},
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
{value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}
];
private communityOptions = [
{value: '', label: 'Title'},
{value: 'creationdate,descending', label: 'Creation Date (most recent)'},

View File

@ -248,10 +248,10 @@ export class SearchProjectsService {
}
}
}
if(resData.hasOwnProperty("startdate")) {
if(resData.hasOwnProperty("startdate") && resData['startdate']) {
result.startYear = resData.startdate.split('-')[0];
}
if(resData.hasOwnProperty("enddate")) {
if(resData.hasOwnProperty("enddate") && resData['enddate']) {
result.endYear = resData.enddate.split('-')[0];
}
// Measure

View File

@ -7,10 +7,10 @@
<img class="uk-width-medium" [src]="properties.enermapsURL +'/images/datasets/' + result.enermapsId + '.png'"
alt="Enermaps tool preview" loading="lazy">
<div
class="uk-overlay uk-margin-medium-left uk-overlay-default uk-position-bottom uk-hidden-hover uk-padding-small">
class="uk-overlay uk-margin-medium-left uk-overlay-default uk-position-bottom uk-hidden-hover uk-padding-small">
<p>Visit <a
class="custom-external uk-margin-right uk-margin-small-top"
[href]="properties.enermapsURL + '/?shared_id=' + result.enermapsId" target="_blank">
class="custom-external uk-margin-right uk-margin-small-top"
[href]="properties.enermapsURL + '/?shared_id=' + result.enermapsId" target="_blank">
Enermaps tool
</a></p>
</div>
@ -23,7 +23,7 @@
<div class="multi-line-ellipsis lines-3 uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="!externalUrl && result.id" (click)="onClick()" [queryParams]="addEoscPrevInParams(createParam())"
[routerLink]="url" class="uk-link uk-text-decoration-none uk-width-expand">
[routerLink]="url" class="uk-link uk-text-decoration-none uk-width-expand">
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
@ -37,8 +37,8 @@
</div>
</a>
<a *ngIf="externalUrl && result.id" (click)="onClick()"
target="_blank" [href]="externalUrl+result.id"
class="custom-external uk-link uk-text-decoration-none uk-width-expand">
target="_blank" [href]="externalUrl+result.id"
class="custom-external uk-link uk-text-decoration-none uk-width-expand">
<span *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
{{result.acronym}}
@ -96,7 +96,7 @@
<div *ngIf="result.funderShortname || result.code" class="uk-margin-xsmall-bottom">
<span *ngIf="result.funderShortname">
<span class="uk-text-meta">Funder: </span>
{{result.funderShortname}}
{{result.funderShortname}}
</span>
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname">
<span class="uk-text-meta">{{openaireEntities.PROJECT}} Code: </span>
@ -112,8 +112,8 @@
<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}}
<span *ngIf="result.currency">{{result.currency}}</span>
{{result.budget | number}}
<span *ngIf="result.currency">{{result.currency}}</span>
</span>
<span *ngIf="result.contribution" [class.uk-margin-left]="result.budget">
<span class="uk-text-meta">Funder Contribution: </span>
@ -172,11 +172,11 @@
</div>
</div>
<div *ngIf="(result.hostedBy_collectedFrom || hasActions || result.measure?.bip.length || result.measure?.counts.length) && !isDeletedByInferenceModal"
class="uk-text-small uk-margin-top" [class.uk-border-bottom]="!isMobile">
class="uk-text-small uk-margin-top" [class.uk-border-bottom]="!isMobile">
<div uk-grid class="uk-grid uk-grid-small uk-text-xsmall uk-flex-middle uk-margin-xsmall-bottom"
[class.uk-flex-between]="(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-flex-right]="!(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-grid-divider]="!isMobile">
[class.uk-flex-between]="(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-flex-right]="!(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-grid-divider]="!isMobile">
<div *ngIf="result.hostedBy_collectedFrom?.length" class="uk-width-auto uk-visible@m">
<availableOn [availableOn]="result.hostedBy_collectedFrom"></availableOn>
</div>
@ -193,7 +193,7 @@
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
</orcid-work>
</span>
<span *ngIf="orcid" class="uk-width-expand uk-text-right">
<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:
@ -209,12 +209,13 @@
</entity-actions>
</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">
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>
<span *ngIf="isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{formatNumber(result.measure.bip[0].value)}}</span>
<span *ngIf="!isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span>
</a>
<div uk-drop="pos: top-right" class="uk-drop">
<div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
@ -223,8 +224,8 @@
<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>
<td *ngIf="isNumber(metric.value)" class="uk-text-bolder">{{metric.value | number}}</td>
<td *ngIf="!isNumber(metric.value)" class="uk-text-bolder">{{metric.value}}</td>
</tr>
</table>
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
@ -254,7 +255,7 @@
<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!">
loading="lazy" alt="Usage counts">
</div>
</div>
</ng-container>

View File

@ -223,6 +223,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return formatted.number + formatted.size;
}
public isNumber(value): boolean {
return typeof value === 'number';
}
public getAccessLabel(accessRight) : string {
if(accessRight) {
return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access"));