From 326a5907431eadbc4bd5c32d889072dbb974c50b Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 7 May 2020 10:50:15 +0000 Subject: [PATCH] [Library|Trunk] Impact factors: add url in property add cache if there is no property won't do the request git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58628 d315682c-612b-4755-9ff5-7f18f6832af3 --- searchPages/searchUtils/searchResult.component.ts | 6 +++--- utils/properties/env-properties.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 002bfb16..2ef2c3c3 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -34,9 +34,9 @@ export class SearchResultComponent implements OnInit, OnChanges { // console.log(data[1]); let dois = encodeURIComponent(this.results.map((result) => result.DOI).join(",")); // console.log(dois); - if(dois.length > 0 && this.showImpactFactors && this.properties.environment != "production") { - let url = 'http://bip.imis.athena-innovation.gr:4000/paper/scores/batch/' + dois; - this.http.get(url).subscribe((data_received) => { + if(dois.length > 0 && this.showImpactFactors && this.properties.environment != "production" && (this.properties.impactFactorsAPIURL && this.properties.impactFactorsAPIURL.length > 0) ) { + let url = this.properties.impactFactorsAPIURL + dois; + this.http.get((this.properties.useCache?(this.properties.cacheUrl+(encodeURIComponent(url))):url)).subscribe((data_received) => { for (let i = 0; i < this.previewResults.length; i++) { this.previewResults[i].pop_inf = new Array(); if (this.previewResults[i].DOI != '' && this.previewResults[i].DOI != null) { diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 40923e16..5c57914b 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -13,7 +13,7 @@ export class EnvProperties { statisticsFrameNewAPIURL; useNewStatistisTool: boolean; statisticsAPIURL; - + impactFactorsAPIURL; claimsAPIURL; searchAPIURLLAst;