From c4e58f942c9180ab18ccf915dd28af8b893ab8de Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 16 Jun 2021 08:19:16 +0000 Subject: [PATCH] [Trunk | Library]: 1. env-properties.ts: Deleted property "enermapsAPIURL" (always used enermapsURL). 2. resultLanding.component.ts: Removed all usages of "enermapsAPIURL" and use "enermapsURL". 3. resultLanding.service.ts: In "getEnermapsDetails()" method, set url to properties.enermapsURL+"/api/datasets_full?shared_id=eq."+id; 4. parsingFunctions.class.ts: In "getEnermapsConceptId()" method, uncomment parsing of contexts to find enermaps id and commented a default id which was set. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@61231 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/landing-utils/parsingFunctions.class.ts | 6 +++--- landingPages/result/resultLanding.component.ts | 4 ++-- landingPages/result/resultLanding.service.ts | 2 +- utils/properties/env-properties.ts | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index aa6a6601..40561d85 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -617,9 +617,9 @@ export class ParsingFunctions { return contexts; } public static getEnermapsConceptId(contexts: any): string{ - // let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept}); - // return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null; - return "hotmaps_heat_tot_curr_density" + let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept}); + return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null; + // return "hotmaps_heat_tot_curr_density" } parseTypes(types: string[], uniqueTypes: Set, instance: any) { if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) { diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 0d2f9624..b76faa16 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -321,7 +321,7 @@ export class ResultLandingComponent { this.activeTab = 'related'; } else if (this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) { this.activeTab = 'bioentities'; - } else if(this.enermapsId && this.properties.enermapsURL && this.properties.enermapsAPIURL) { + } else if(this.enermapsId && this.properties.enermapsURL) { this.activeTab = "enermaps"; } } @@ -698,7 +698,7 @@ export class ResultLandingComponent { public onSelectActiveTab(activeTabId) { if (this.activeTab != activeTabId) { // tab really changed this.activeTab = activeTabId; - if (activeTabId == 'enermaps' && this.properties.enermapsAPIURL) { + if (activeTabId == 'enermaps' && this.properties.enermapsURL) { this.getEnermapsDetails(this.enermapsId); } } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index c1b16b14..224fd8e2 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -484,7 +484,7 @@ export class ResultLandingService { } getEnermapsDetails(id: string) { - let url = properties.enermapsAPIURL+id; + let url = properties.enermapsURL+"/api/datasets_full?shared_id=eq."+id; return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url) // return this.http.get(url) .pipe(map(res => this.parseEnermapsDetails(res))); diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index ac237191..3bcc7b59 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -24,7 +24,6 @@ export interface EnvProperties { statisticsAPIURL?: string; impactFactorsAPIURL?: string; enermapsURL?: string; - enermapsAPIURL?: string; claimsAPIURL?: string; searchAPIURLLAst?: string; searchResourcesAPIURL?: string;