Revision 57647
Added by Argiro Kokogiannaki over 4 years ago
monitor.component.ts | ||
---|---|---|
11 | 11 |
import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; |
12 | 12 |
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; |
13 | 13 |
import {StakeholderService} from "../services/stakeholder.service"; |
14 |
import {Category, IndicatorPath, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder"; |
|
14 |
import {Category, ChartHelper, IndicatorPath, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder";
|
|
15 | 15 |
import {StatisticsService} from "../utils/services/statistics.service"; |
16 | 16 |
import {Item, Sidebar} from "../utils/entities/sidebar"; |
17 | 17 |
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service"; |
... | ... | |
38 | 38 |
public chartsActiveType: Map<number, IndicatorPath> = new Map<number, IndicatorPath>(); |
39 | 39 |
private errorMessages: ErrorMessagesComponent; |
40 | 40 |
properties: EnvProperties; |
41 |
fundingL0; |
|
42 |
startYear; |
|
43 |
endYear; |
|
41 | 44 |
|
42 | 45 |
constructor( |
43 | 46 |
private route: ActivatedRoute, |
... | ... | |
193 | 196 |
let urls: Map<string, number[]> = new Map<string, number[]>(); |
194 | 197 |
this.activeSubCategory.numbers.forEach((number, index) => { |
195 | 198 |
if (number.isActive && number.isPublic) { |
196 |
const pair = JSON.stringify([number.indicatorPaths[0].source, number.indicatorPaths[0].url]); |
|
199 |
let url = number.indicatorPaths[0].url; |
|
200 |
//add fundingLevel0 filter in the query |
|
201 |
if(this.fundingL0 && number.indicatorPaths[0].filters.get("fundingL0")){ |
|
202 |
url = url + number.indicatorPaths[0].filters.get("fundingL0").replace(ChartHelper.prefix+'fundingL0'+ChartHelper.suffix,encodeURIComponent(this.fundingL0)); |
|
203 |
} |
|
204 |
const pair = JSON.stringify([number.indicatorPaths[0].source, url]); |
|
197 | 205 |
const indexes = urls.get(pair) ? urls.get(pair) : []; |
198 | 206 |
indexes.push(index); |
199 | 207 |
urls.set(pair, indexes); |
... | ... | |
224 | 232 |
|
225 | 233 |
public getUrlByStakeHolder(indicatorPath: IndicatorPath) { |
226 | 234 |
return this.sanitizer.bypassSecurityTrustResourceUrl( |
227 |
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(indicatorPath))); |
|
235 |
this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(indicatorPath, this.fundingL0, this.startYear, this.endYear)));
|
|
228 | 236 |
} |
229 | 237 |
|
230 | 238 |
public setActiveChart(index, type: string) { |
Also available in: Unified diff
StakeholderCreator:
initialize filters where is posible
monitor page:
apply filters when available
add filters section in html for testing (commented)
Indicator-utils:
create IndicatorPath from URL:
add checks if filters & queries exist
apply parameters when there are more than one queries
add Indicator filters if possible
old Tool:
add basic fields in parameters
fix url