Update to Angular 16 #16
File diff suppressed because one or more lines are too long
|
@ -60,10 +60,10 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
<span>{{year}}</span>
|
<span>{{year}}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="startYear && !endYear">
|
<ng-container *ngIf="startYear && !endYear">
|
||||||
<span>{{startYear}}</span>
|
<span>From {{startYear}}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!startYear && endYear">
|
<ng-container *ngIf="!startYear && endYear">
|
||||||
<span>{{endYear}}</span>
|
<span>Until {{endYear}}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="startYear && endYear">
|
<ng-container *ngIf="startYear && endYear">
|
||||||
<ng-container>
|
<ng-container>
|
||||||
|
|
|
@ -464,6 +464,7 @@ export class ProjectComponent {
|
||||||
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
|
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.projectInfo = data;
|
this.projectInfo = data;
|
||||||
|
this.projectInfo.id = this.projectId;
|
||||||
|
|
||||||
this.actionsAfterGettingProjectInfo();
|
this.actionsAfterGettingProjectInfo();
|
||||||
},
|
},
|
||||||
|
|
|
@ -163,7 +163,7 @@ export class MyOrcidLinksComponent {
|
||||||
|
|
||||||
if(typeof document !== 'undefined') {
|
if(typeof document !== 'undefined') {
|
||||||
this.tokenUrl = properties.orcidTokenURL
|
this.tokenUrl = properties.orcidTokenURL
|
||||||
+ "clientid="+properties.orcidClientId
|
+ "client_id=" + properties.orcidClientId
|
||||||
// + "&response_type=code&scope=/activities/update"
|
// + "&response_type=code&scope=/activities/update"
|
||||||
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
|
||||||
+ "&response_type=code&scope=/activities/update /read-limited"
|
+ "&response_type=code&scope=/activities/update /read-limited"
|
||||||
|
|
|
@ -160,7 +160,9 @@ export class SearchResearchResultsComponent {
|
||||||
|
|
||||||
this.searchUtils.validateSize(params['size']);
|
this.searchUtils.validateSize(params['size']);
|
||||||
this.searchUtils.sortBy = (params['sortBy']) ? params['sortBy'] : '';
|
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.searchUtils.sortBy = "";
|
||||||
}
|
}
|
||||||
this.selectedFields = [];
|
this.selectedFields = [];
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
||||||
import {Option} from "../../sharedComponents/input/input.component";
|
import {Option} from "../../sharedComponents/input/input.component";
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'search-sorting',
|
selector: 'search-sorting',
|
||||||
|
@ -19,10 +20,20 @@ export class SearchSortingComponent {
|
||||||
@Input() entityType: string = '';
|
@Input() entityType: string = '';
|
||||||
@Output() sortByChange = new EventEmitter();
|
@Output() sortByChange = new EventEmitter();
|
||||||
public options: Option[];
|
public options: Option[];
|
||||||
private generalOptions = [
|
private generalOptions = properties.environment != "production" ?
|
||||||
|
[
|
||||||
{value: '', label: 'Relevance'},
|
{value: '', label: 'Relevance'},
|
||||||
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
|
{value: 'resultdateofacceptance,descending', label: 'Date (most recent)'},
|
||||||
{value: 'resultdateofacceptance,ascending', label: 'Date (least 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 = [
|
private communityOptions = [
|
||||||
{value: '', label: 'Title'},
|
{value: '', label: 'Title'},
|
||||||
|
|
|
@ -248,10 +248,10 @@ export class SearchProjectsService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(resData.hasOwnProperty("startdate")) {
|
if(resData.hasOwnProperty("startdate") && resData['startdate']) {
|
||||||
result.startYear = resData.startdate.split('-')[0];
|
result.startYear = resData.startdate.split('-')[0];
|
||||||
}
|
}
|
||||||
if(resData.hasOwnProperty("enddate")) {
|
if(resData.hasOwnProperty("enddate") && resData['enddate']) {
|
||||||
result.endYear = resData.enddate.split('-')[0];
|
result.endYear = resData.enddate.split('-')[0];
|
||||||
}
|
}
|
||||||
// Measure
|
// Measure
|
||||||
|
|
|
@ -214,7 +214,8 @@
|
||||||
<a class="uk-flex uk-flex-middle uk-link-reset">
|
<a class="uk-flex uk-flex-middle uk-link-reset">
|
||||||
<icon customClass="bip-icon-hover" [flex]="true" [ratio]="0.7"
|
<icon customClass="bip-icon-hover" [flex]="true" [ratio]="0.7"
|
||||||
[name]="result.measure.bip[0].icon"></icon>
|
[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>
|
</a>
|
||||||
<div uk-drop="pos: top-right" class="uk-drop">
|
<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">
|
<div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
|
||||||
|
@ -223,8 +224,8 @@
|
||||||
<td class="bip-icon">
|
<td class="bip-icon">
|
||||||
<icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon>
|
<icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon>
|
||||||
</td>
|
</td>
|
||||||
<td class="uk-text-capitalize">{{metric.name}}</td>
|
<td *ngIf="isNumber(metric.value)" class="uk-text-bolder">{{metric.value | number}}</td>
|
||||||
<td class="uk-text-bolder">{{metric.value}}</td>
|
<td *ngIf="!isNumber(metric.value)" class="uk-text-bolder">{{metric.value}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
|
<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">
|
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
|
||||||
<span class="uk-text-uppercase">Powered by </span>
|
<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"
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
|
@ -223,6 +223,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
|
||||||
return formatted.number + formatted.size;
|
return formatted.number + formatted.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isNumber(value): boolean {
|
||||||
|
return typeof value === 'number';
|
||||||
|
}
|
||||||
|
|
||||||
public getAccessLabel(accessRight) : string {
|
public getAccessLabel(accessRight) : string {
|
||||||
if(accessRight) {
|
if(accessRight) {
|
||||||
return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access"));
|
return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access"));
|
||||||
|
|
Loading…
Reference in New Issue