Skip to content

Commit

Permalink
Merge pull request #13232 from SORMAS-Foundation/bugfix-13231_birthda…
Browse files Browse the repository at this point in the history
…te_filter_issues

#13231 - Birthdate filter does not hold the selected values
  • Loading branch information
leventegal-she authored Jan 16, 2025
2 parents 85fd987 + 4ba3f6d commit dafe50a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,14 @@ protected void applyDependenciesOnNewValue(CaseCriteria criteria) {
weekAndDateFilter.getDateToFilter().setValue(criteria.getNewCaseDateTo());
}
}

//Birthdate Filter
HorizontalLayout birthdateFilterForm = (HorizontalLayout) getMoreFiltersContainer().getComponent(BIRTHDATE_RANGE_FILTER);
BirthdateRangeFilterComponent birtdateFilter = (BirthdateRangeFilterComponent) birthdateFilterForm.getComponent(0);
birtdateFilter.getDateFromFilter().setValue(criteria.getBirthdateFrom());
birtdateFilter.getDateToFilter().setValue(criteria.getBirthdateTo());
birtdateFilter.getIncludePartialMatch().setValue(criteria.isIncludePartialMatch());

ComboBox birthDateDD = getField(CaseCriteria.BIRTHDATE_DD);
if (getField(CaseCriteria.BIRTHDATE_YYYY).getValue() != null && getField(CaseCriteria.BIRTHDATE_MM).getValue() != null) {
birthDateDD.addItems(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ protected void applyDependenciesOnNewValue(ContactCriteria newValue) {
weekAndDateFilter.getDateToFilter().setValue(dateTo);
}

//Birthdate Filter
HorizontalLayout birthdateFilterForm = (HorizontalLayout) getMoreFiltersContainer().getComponent(BIRTHDATE_RANGE_FILTER);
BirthdateRangeFilterComponent birtdateFilter = (BirthdateRangeFilterComponent) birthdateFilterForm.getComponent(0);
birtdateFilter.getDateFromFilter().setValue(newValue.getBirthdateFrom());
birtdateFilter.getDateToFilter().setValue(newValue.getBirthdateTo());
birtdateFilter.getIncludePartialMatch().setValue(newValue.isIncludePartialMatch());

if (StringUtils.isBlank(newValue.getEventLike())) {
clearAndDisableFields(ContactCriteria.ONLY_CONTACTS_SHARING_EVENT_WITH_SOURCE_CASE);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,12 @@ protected void applyDependenciesOnNewValue(PersonCriteria criteria) {
birthDateDD.clear();
birthDateDD.setEnabled(false);
}

//Birthdate Filter
HorizontalLayout birthdateFilterForm = (HorizontalLayout) getMoreFiltersContainer().getComponent(BIRTHDATE_RANGE_FILTER);
BirthdateRangeFilterComponent birtdateFilter = (BirthdateRangeFilterComponent) birthdateFilterForm.getComponent(0);
birtdateFilter.getDateFromFilter().setValue(criteria.getBirthdateFrom());
birtdateFilter.getDateToFilter().setValue(criteria.getBirthdateTo());
birtdateFilter.getIncludePartialMatch().setValue(criteria.isIncludePartialMatch());
}
}

0 comments on commit dafe50a

Please sign in to comment.