Revision 61231
Added by Konstantina Galouni almost 3 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/parsingFunctions.class.ts | ||
---|---|---|
617 | 617 |
return contexts; |
618 | 618 |
} |
619 | 619 |
public static getEnermapsConceptId(contexts: any): string{ |
620 |
// let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept});
|
|
621 |
// return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null;
|
|
622 |
return "hotmaps_heat_tot_curr_density" |
|
620 |
let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept}); |
|
621 |
return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null; |
|
622 |
// return "hotmaps_heat_tot_curr_density"
|
|
623 | 623 |
} |
624 | 624 |
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) { |
625 | 625 |
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) { |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.service.ts | ||
---|---|---|
484 | 484 |
} |
485 | 485 |
|
486 | 486 |
getEnermapsDetails(id: string) { |
487 |
let url = properties.enermapsAPIURL+id;
|
|
487 |
let url = properties.enermapsURL+"/api/datasets_full?shared_id=eq."+id;
|
|
488 | 488 |
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url) |
489 | 489 |
// return this.http.get(url) |
490 | 490 |
.pipe(map(res => this.parseEnermapsDetails(res))); |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.component.ts | ||
---|---|---|
321 | 321 |
this.activeTab = 'related'; |
322 | 322 |
} else if (this.resultLandingInfo.bioentities && this.bioentitiesNum > 0) { |
323 | 323 |
this.activeTab = 'bioentities'; |
324 |
} else if(this.enermapsId && this.properties.enermapsURL && this.properties.enermapsAPIURL) {
|
|
324 |
} else if(this.enermapsId && this.properties.enermapsURL) { |
|
325 | 325 |
this.activeTab = "enermaps"; |
326 | 326 |
} |
327 | 327 |
} |
... | ... | |
698 | 698 |
public onSelectActiveTab(activeTabId) { |
699 | 699 |
if (this.activeTab != activeTabId) { // tab really changed |
700 | 700 |
this.activeTab = activeTabId; |
701 |
if (activeTabId == 'enermaps' && this.properties.enermapsAPIURL) {
|
|
701 |
if (activeTabId == 'enermaps' && this.properties.enermapsURL) { |
|
702 | 702 |
this.getEnermapsDetails(this.enermapsId); |
703 | 703 |
} |
704 | 704 |
} |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/properties/env-properties.ts | ||
---|---|---|
24 | 24 |
statisticsAPIURL?: string; |
25 | 25 |
impactFactorsAPIURL?: string; |
26 | 26 |
enermapsURL?: string; |
27 |
enermapsAPIURL?: string; |
|
28 | 27 |
claimsAPIURL?: string; |
29 | 28 |
searchAPIURLLAst?: string; |
30 | 29 |
searchResourcesAPIURL?: string; |
Also available in: Unified diff
[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.