Library | angular-16: Merge develop branch into angular-16 and resolve conflicts

This commit is contained in:
Konstantina Galouni 2023-10-16 13:06:14 +03:00
commit 5948d61a47
4 changed files with 12 additions and 15 deletions

View File

@ -390,7 +390,7 @@
<div> <div>
<ng-container *ngIf="resultLandingInfo.measure.bip.length"> <ng-container *ngIf="resultLandingInfo.measure.bip.length">
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip"> <ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
<div *ngIf="measure.value" class="cell uk-flex uk-flex-middle uk-margin-xsmall-bottom"> <div class="cell uk-flex uk-flex-middle uk-margin-xsmall-bottom">
<icon [name]="measure.icon" [ratio]="0.8" [flex]="true"></icon> <icon [name]="measure.icon" [ratio]="0.8" [flex]="true"></icon>
</div> </div>
</ng-container> </ng-container>
@ -406,7 +406,7 @@
<div> <div>
<ng-container *ngIf="resultLandingInfo.measure.bip.length"> <ng-container *ngIf="resultLandingInfo.measure.bip.length">
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip"> <ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
<div *ngIf="measure.value" class="cell uk-margin-xsmall-bottom"> <div class="cell uk-margin-xsmall-bottom">
<a class="uk-text-capitalize">{{measure.name}}</a> <a class="uk-text-capitalize">{{measure.name}}</a>
<ng-container *ngTemplateOutlet="dropInfo; context: {option: measure.name, isCompact: false}"></ng-container> <ng-container *ngTemplateOutlet="dropInfo; context: {option: measure.name, isCompact: false}"></ng-container>
</div> </div>
@ -424,14 +424,14 @@
<div class="uk-text-uppercase uk-text-bolder"> <div class="uk-text-uppercase uk-text-bolder">
<ng-container *ngIf="resultLandingInfo.measure.bip.length"> <ng-container *ngIf="resultLandingInfo.measure.bip.length">
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip"> <ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
<ng-container *ngIf="isNumber(measure)"> <ng-container *ngIf="isNumber(measure.value)">
<div *ngIf="measure.value" [attr.uk-tooltip]="measure.value >= 1000 ? 'cls: uk-active' : 'cls: uk-invisible'" <div [attr.uk-tooltip]="measure.value >= 1000 ? 'cls: uk-active' : 'cls: uk-invisible'"
title="{{measure.value | number}}" class="cell uk-margin-xsmall-bottom"> title="{{measure.value | number}}" class="cell uk-margin-xsmall-bottom">
{{formatNumber(measure.value)}} {{formatNumber(measure.value)}}
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="!isNumber(measure)"> <ng-container *ngIf="!isNumber(measure.value)">
<div *ngIf="measure.value" class="cell uk-margin-xsmall-bottom"> <div class="cell uk-margin-xsmall-bottom">
{{measure.value}} {{measure.value}}
</div> </div>
</ng-container> </ng-container>

View File

@ -90,7 +90,7 @@ export class SearchInputComponent implements OnInit, AfterViewInit {
ngAfterViewInit() { ngAfterViewInit() {
if(typeof document !== 'undefined') { if(typeof document !== 'undefined') {
this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio')); this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio'));
this.cdr.detectChanges() this.cdr.detectChanges();
} }
} }

View File

@ -12,6 +12,7 @@ export class FetchResearchResults {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
public results =[]; public results =[];
public allResults =[]; // in case of paging
public requestComplete: Subject<void>; public requestComplete: Subject<void>;
@ -88,7 +89,8 @@ export class FetchResearchResults {
this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults(resultType, "", page, size, "resultdateofacceptance,descending", properties, "&type=results&fq=communityid=" + communityId +(contextId?'&fq=categoryid=' + encodeURIComponent(contextId):'')).subscribe( this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults(resultType, "", page, size, "resultdateofacceptance,descending", properties, "&type=results&fq=communityid=" + communityId +(contextId?'&fq=categoryid=' + encodeURIComponent(contextId):'')).subscribe(
data => { data => {
this.searchUtils.totalResults = data[0]; this.searchUtils.totalResults = data[0];
this.results = data[1]; this.allResults = data[1];
this.results = data[1].slice(0, 5) ;
this.searchUtils.status = this.errorCodes.DONE; this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){ if(this.searchUtils.totalResults == 0 ){

View File

@ -1,4 +1,4 @@
import {Component, Input} from '@angular/core'; import {Component, Input, SimpleChanges} from '@angular/core';
import {EnvProperties} from "../../properties/env-properties"; import {EnvProperties} from "../../properties/env-properties";
import {ErrorCodes} from "../../properties/errorCodes"; import {ErrorCodes} from "../../properties/errorCodes";
import {OpenaireEntities} from "../../properties/searchFields"; import {OpenaireEntities} from "../../properties/searchFields";
@ -41,7 +41,7 @@ import {StringUtils} from "../../string-utils.class";
<ng-container *ngIf="fetch.searchUtils.status == errorCodes.DONE"> <ng-container *ngIf="fetch.searchUtils.status == errorCodes.DONE">
<search-result [properties]="properties" <search-result [properties]="properties"
[results]="results" [results]="fetch.results"
[status]="fetch.searchUtils.status" [status]="fetch.searchUtils.status"
[type]="resultType" [showEnermaps]="showEnermaps" [prevPath]="prevPath"> [type]="resultType" [showEnermaps]="showEnermaps" [prevPath]="prevPath">
</search-result> </search-result>
@ -67,7 +67,6 @@ export class SearchTabComponent {
@Input() properties: EnvProperties; @Input() properties: EnvProperties;
@Input() customTitle; @Input() customTitle;
@Input() showEnermaps: boolean; @Input() showEnermaps: boolean;
@Input() currentPage: number = null;
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
@ -75,10 +74,6 @@ export class SearchTabComponent {
return StringUtils.getEntityName(entityType, true); return StringUtils.getEntityName(entityType, true);
} }
get results() {
return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results;
}
get paramsForExternalUrl() { get paramsForExternalUrl() {
let parameters: string = ""; let parameters: string = "";
Object.keys(this.params).forEach(paramKey => { Object.keys(this.params).forEach(paramKey => {