From f0a48cd2e10ca9bc3c5edafa02c5af20b4106877 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 Oct 2023 11:44:18 +0300 Subject: [PATCH 1/3] [Library | develop]: search-input.component.ts: [Bug fix] Added cdr.detectChanges() call on ngAfterViewInit, to solve expressionChangedAfterItHasBeenChecked error. --- sharedComponents/search-input/search-input.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sharedComponents/search-input/search-input.component.ts b/sharedComponents/search-input/search-input.component.ts index ea7e87df..63fc7d03 100644 --- a/sharedComponents/search-input/search-input.component.ts +++ b/sharedComponents/search-input/search-input.component.ts @@ -90,6 +90,7 @@ export class SearchInputComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if(typeof document !== 'undefined') { this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio')); + this.cdr.detectChanges(); } } From aa0ec0b06fa169469d68858e5b1590cb5c395907 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 16 Oct 2023 12:11:47 +0300 Subject: [PATCH 2/3] search tab: show all results / don't slice the array Fetch research results: keep all results in allResults field (for community results case) --- utils/fetchEntitiesClasses/fetchResearchResults.class.ts | 4 +++- utils/tabs/contents/search-tab.component.ts | 9 ++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts index 1090aeae..ce05a800 100644 --- a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts +++ b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts @@ -12,6 +12,7 @@ export class FetchResearchResults { private errorMessages: ErrorMessagesComponent; public results =[]; + public allResults =[]; // in case of paging public requestComplete: Subject; @@ -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( data => { 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; if(this.searchUtils.totalResults == 0 ){ diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index 7383f76e..e8656ed1 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from '@angular/core'; +import {Component, Input, SimpleChanges} from '@angular/core'; import {EnvProperties} from "../../properties/env-properties"; import {ErrorCodes} from "../../properties/errorCodes"; import {OpenaireEntities} from "../../properties/searchFields"; @@ -41,7 +41,7 @@ import {StringUtils} from "../../string-utils.class"; @@ -67,7 +67,6 @@ export class SearchTabComponent { @Input() properties: EnvProperties; @Input() customTitle; @Input() showEnermaps: boolean; - @Input() currentPage: number = null; public errorCodes: ErrorCodes = new ErrorCodes(); @@ -75,10 +74,6 @@ export class SearchTabComponent { 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() { let parameters: string = ""; Object.keys(this.params).forEach(paramKey => { From fce848008aa7edf91be10a3a241d940abec0076a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 16 Oct 2023 12:53:40 +0300 Subject: [PATCH 3/3] [Library | develop]: resultLanding.component.html: [Bug fix] Fix check isNumber for bip measures & remove check if value (show citation score also when it is 0). --- landingPages/result/resultLanding.component.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 4aa62494..f12efbb7 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -388,7 +388,7 @@
-
+
@@ -404,7 +404,7 @@
-
+ @@ -422,14 +422,14 @@
- -
+
{{formatNumber(measure.value)}}
- -
+ +
{{measure.value}}