From 2ad18e58991aaa6020a1d2c98f1cb89275238bba Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 25 Oct 2022 18:41:51 +0300 Subject: [PATCH] fix related to #8135: count properly the filters applied in the parameters --- src/app/utils/indicator-utils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/utils/indicator-utils.ts b/src/app/utils/indicator-utils.ts index a74880f..114155c 100644 --- a/src/app/utils/indicator-utils.ts +++ b/src/app/utils/indicator-utils.ts @@ -323,9 +323,13 @@ export class IndicatorUtils { let replacedValue = indicatorPath.parameters[key]; if (startYear && key == "start_year") { 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") { 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") { replacedValue = stakeholder.index_id; @@ -336,10 +340,7 @@ export class IndicatorUtils { if (key == "index_shortName") { 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) }); }