Skip to content

Commit

Permalink
#1461 | Fix display and hide of appliedFiltersV2
Browse files Browse the repository at this point in the history
  • Loading branch information
himeshr committed Aug 1, 2024
1 parent a8c2e54 commit f7e3aff
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ function loadCurrentDashboardInfo(context, state) {
state.customDashboardFilters = selectedFilterValues;
if (state.activeDashboardUUID) {
state.reportCardSectionMappings = getReportsCards(state.activeDashboardUUID, context);
state.hasFiltersSet = selectedFilterValues && Object.values(selectedFilterValues).length > 0
&& Object.values(selectedFilterValues).some(sfv => !_.isNil(sfv) && !_.isEmpty(sfv));
state.hasFiltersSet = getHasFiltersSet(selectedFilterValues);
}
return state;
}

function getHasFiltersSet(selectedFilterValues) {
return selectedFilterValues && Object.values(selectedFilterValues).length > 0
&& Object.values(selectedFilterValues).some(sfv => !_.isNil(sfv) && !_.isEmpty(sfv));
}

function getViewName(standardReportCardType) {
switch (true) {
case _.isNil(standardReportCardType) :
Expand Down Expand Up @@ -132,6 +136,7 @@ class CustomDashboardActions {

const {selectedFilterValues} = customDashboardService.getDashboardData(state.activeDashboardUUID);
newState.customDashboardFilters = selectedFilterValues;
newState.hasFiltersSet = getHasFiltersSet(selectedFilterValues);
const userSettings = userInfoService.getUserSettingsObject();

const I18n = context.get(MessageService).getI18n();
Expand Down

0 comments on commit f7e3aff

Please sign in to comment.