Skip to content

Commit

Permalink
#1340 | Fix issue with load and reset of address, gender and custom f…
Browse files Browse the repository at this point in the history
…ilters in myDashboardFilter view
  • Loading branch information
himeshr committed Mar 11, 2024
1 parent f036dbe commit 83b7bc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import IndividualSearchCriteria from "../../service/query/IndividualSearchCriter
import _ from "lodash";
import FormMappingService from "../../service/FormMappingService";
import {ArrayUtil} from "openchs-models";
import AddressLevelState from '../common/AddressLevelsState';

class FiltersActions {

Expand Down Expand Up @@ -33,6 +34,7 @@ class FiltersActions {
filters: FiltersActions.cloneFilters(action.filters),
locationSearchCriteria: action.locationSearchCriteria,
addressLevelState: action.addressLevelState,
selectedCustomFilters: action.selectedCustomFilters,
filterDate: {value: action.filterDate.value},
programs: action.programs,
selectedPrograms: action.selectedPrograms,
Expand Down Expand Up @@ -115,10 +117,14 @@ class FiltersActions {
selectedSubjectType,
programs,
selectedPrograms,
selectedLocations: [],
addressLevelState: new AddressLevelState(),
encounterTypes,
selectedEncounterTypes: [],
generalEncounterTypes,
selectedGeneralEncounterTypes: [],
selectedCustomFilters: [],
selectedGenders: [],
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/src/views/filter/FiltersView.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class FilterView extends AbstractComponent {
}
{!_.isEmpty(topLevelFilters) ?
<CustomFilters filters={topLevelFilters}
selectedCustomFilters={this.props.selectedCustomFilters}
selectedCustomFilters={this.state.selectedCustomFilters}
onSelect={(selectedCustomFilters) => this.dispatchAction(FilterActionNames.CUSTOM_FILTER_CHANGE, {selectedCustomFilters})}
/> : null}
{this.customFilterService.filterTypePresent(filterScreenName, CustomFilter.type.Gender, this.state.selectedSubjectType.uuid) ?
Expand All @@ -276,7 +276,7 @@ class FilterView extends AbstractComponent {
userHintText={this.I18n.t('addressFilterImplicitBehaviorHint')}/> : null}
{!_.isEmpty(bottomLevelFilters) ?
<CustomFilters filters={bottomLevelFilters}
selectedCustomFilters={this.props.selectedCustomFilters}
selectedCustomFilters={this.state.selectedCustomFilters}
onSelect={(selectedCustomFilters) => this.dispatchAction(FilterActionNames.CUSTOM_FILTER_CHANGE, {selectedCustomFilters})}
addressLevelState={this.state.addressLevelState}
/> : null}
Expand Down

0 comments on commit 83b7bc4

Please sign in to comment.