diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index c3f2a771..606c31d3 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -1,4 +1,5 @@ import {SafeResourceUrl} from "@angular/platform-browser"; +import {properties} from "../../../../environments/environment"; export const ChartHelper = { prefix: "((__", @@ -209,17 +210,20 @@ export class IndicatorFilterUtils{ }else if (field == "project"){ return this.getProjectFilter(filterType); } - //TODO uncomment to add other options --> following doesn't work -/* else if (field == "country"){ + else if (field == "country"){ return this.getCountryFilter(filterType); }else if (field == "organization"){ return this.getOrganizationFilter(filterType); - }*/ + } } static getResultFilter(dbType: string = null, filterType:FilterType) { if (filterType == "fundingL0") { - return '{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + ChartHelper.prefix + 'fundingL0' + ChartHelper.suffix + '"]}],"op":"AND"}'; + if(properties.useOldStatisticsSchema) { + return '{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + ChartHelper.prefix + 'fundingL0' + ChartHelper.suffix + '"]}],"op":"AND"}'; + }else{//new statistcs schema + return '{"groupFilters":[{"field":"' + dbType + '.project funding level 0","type":"=","values":["' + ChartHelper.prefix + 'fundingL0' + ChartHelper.suffix + '"]}],"op":"AND"}'; + } } else if (filterType == "start_year") { return '{"groupFilters":[{"field":"' + dbType + '.year","type":">=","values":["' + ChartHelper.prefix + 'start_year' + ChartHelper.suffix + '"]}],"op":"AND"}'; } else if (filterType == "end_year") { diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 57f9ae36..fb0f95f7 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -18,6 +18,8 @@ export interface EnvProperties { statisticsFrameAPIURL?: string; statisticsFrameNewAPIURL?: string; useNewStatistisTool?: boolean; + useOldStatisticsSchema?: boolean; + monitorStatsFrameUrl?:string; disableFrameLoad?:boolean statisticsAPIURL?: string; impactFactorsAPIURL?: string;