[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
This commit is contained in:
parent
1a38cf4843
commit
c4e58f942c
|
@ -617,9 +617,9 @@ export class ParsingFunctions {
|
||||||
return contexts;
|
return contexts;
|
||||||
}
|
}
|
||||||
public static getEnermapsConceptId(contexts: any): string{
|
public static getEnermapsConceptId(contexts: any): string{
|
||||||
// let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
|
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 enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
|
||||||
return "hotmaps_heat_tot_curr_density"
|
// return "hotmaps_heat_tot_curr_density"
|
||||||
}
|
}
|
||||||
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
|
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
|
||||||
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||||
|
|
|
@ -321,7 +321,7 @@ export class ResultLandingComponent {
|
||||||
this.activeTab = 'related';
|
this.activeTab = 'related';
|
||||||
} else if (this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) {
|
} else if (this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) {
|
||||||
this.activeTab = 'bioentities';
|
this.activeTab = 'bioentities';
|
||||||
} else if(this.enermapsId && this.properties.enermapsURL && this.properties.enermapsAPIURL) {
|
} else if(this.enermapsId && this.properties.enermapsURL) {
|
||||||
this.activeTab = "enermaps";
|
this.activeTab = "enermaps";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,7 @@ export class ResultLandingComponent {
|
||||||
public onSelectActiveTab(activeTabId) {
|
public onSelectActiveTab(activeTabId) {
|
||||||
if (this.activeTab != activeTabId) { // tab really changed
|
if (this.activeTab != activeTabId) { // tab really changed
|
||||||
this.activeTab = activeTabId;
|
this.activeTab = activeTabId;
|
||||||
if (activeTabId == 'enermaps' && this.properties.enermapsAPIURL) {
|
if (activeTabId == 'enermaps' && this.properties.enermapsURL) {
|
||||||
this.getEnermapsDetails(this.enermapsId);
|
this.getEnermapsDetails(this.enermapsId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -484,7 +484,7 @@ export class ResultLandingService {
|
||||||
}
|
}
|
||||||
|
|
||||||
getEnermapsDetails(id: string) {
|
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((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
// return this.http.get(url)
|
// return this.http.get(url)
|
||||||
.pipe(map(res => this.parseEnermapsDetails(res)));
|
.pipe(map(res => this.parseEnermapsDetails(res)));
|
||||||
|
|
|
@ -24,7 +24,6 @@ export interface EnvProperties {
|
||||||
statisticsAPIURL?: string;
|
statisticsAPIURL?: string;
|
||||||
impactFactorsAPIURL?: string;
|
impactFactorsAPIURL?: string;
|
||||||
enermapsURL?: string;
|
enermapsURL?: string;
|
||||||
enermapsAPIURL?: string;
|
|
||||||
claimsAPIURL?: string;
|
claimsAPIURL?: string;
|
||||||
searchAPIURLLAst?: string;
|
searchAPIURLLAst?: string;
|
||||||
searchResourcesAPIURL?: string;
|
searchResourcesAPIURL?: string;
|
||||||
|
|
Loading…
Reference in New Issue