fix related to #8135: count properly the filters applied in the parameters

This commit is contained in:
argirok 2022-10-25 18:41:51 +03:00
parent 191855d64d
commit 2ad18e5899
1 changed files with 5 additions and 4 deletions

View File

@ -323,9 +323,13 @@ export class IndicatorUtils {
let replacedValue = indicatorPath.parameters[key]; let replacedValue = indicatorPath.parameters[key];
if (startYear && key == "start_year") { if (startYear && key == "start_year") {
replacedValue = (replacedValue < startYear) ? startYear : replacedValue; replacedValue = (replacedValue < startYear) ? startYear : replacedValue;
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
indicatorPath.filtersApplied++;
} }
if (endYear && key == "end_year") { if (endYear && key == "end_year") {
replacedValue = (replacedValue > endYear) ? endYear : replacedValue; replacedValue = (replacedValue > endYear) ? endYear : replacedValue;
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
indicatorPath.filtersApplied++;
} }
if (key == "index_id") { if (key == "index_id") {
replacedValue = stakeholder.index_id; replacedValue = stakeholder.index_id;
@ -336,10 +340,7 @@ export class IndicatorUtils {
if (key == "index_shortName") { if (key == "index_shortName") {
replacedValue = stakeholder.index_shortName.toLowerCase(); replacedValue = stakeholder.index_shortName.toLowerCase();
} }
//if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
if(replacedValue !=indicatorPath.parameters[key]){
indicatorPath.filtersApplied++;
}
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
}); });
} }