Skip to content

Commit

Permalink
Merge pull request #13180 from SORMAS-Foundation/bugfix-13179_Birthda…
Browse files Browse the repository at this point in the history
…te_month_does_not_show_confidential

Birthdate month does not show "Empty" instead of "confidential" when …
  • Loading branch information
leventegal-she authored Nov 11, 2024
2 parents 8fe745c + a682d07 commit 14977ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ public class PersonDto extends PseudonymizableDto implements IsPerson {
@SensitiveData
private Integer birthdateDD;
@Outbreaks
@PersonalData
@SensitiveData
private Integer birthdateMM;
@Outbreaks
private Integer birthdateYYYY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,8 @@ protected void addFields() {
ComboBox birthDateMonth = addField(PersonDto.BIRTH_DATE_MM, ComboBox.class);
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
birthDateMonth.setNullSelectionAllowed(true);
birthDateMonth.addItems(DateHelper.getMonthsInYear());
birthDateMonth.setPageLength(12);
birthDateMonth.setInputPrompt(I18nProperties.getString(Strings.month));
birthDateMonth.setCaption("");
DateHelper.getMonthsInYear()
.forEach(month -> birthDateMonth.setItemCaption(month, de.symeda.sormas.api.Month.values()[month - 1].toString()));
setItemCaptionsForMonths(birthDateMonth);
ComboBox birthDateYear = addField(PersonDto.BIRTH_DATE_YYYY, ComboBox.class);
birthDateYear.setCaption(I18nProperties.getPrefixCaption(PersonDto.I18N_PREFIX, PersonDto.BIRTH_DATE));
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
Expand Down Expand Up @@ -446,6 +441,13 @@ protected void addFields() {
initializeVisibilitiesAndAllowedVisibilities();
initializeAccessAndAllowedAccesses();

if (isEditableAllowed(PersonDto.BIRTH_DATE_MM)) {
birthDateMonth.addItems(DateHelper.getMonthsInYear());
birthDateMonth.setPageLength(13);
DateHelper.getMonthsInYear()
.forEach(month -> birthDateMonth.setItemCaption(month, de.symeda.sormas.api.Month.values()[month - 1].toString()));
}

if (!getField(PersonDto.OCCUPATION_TYPE).isVisible()
&& !getField(PersonDto.ARMED_FORCES_RELATION_TYPE).isVisible()
&& !getField(PersonDto.EDUCATION_TYPE).isVisible())
Expand Down

0 comments on commit 14977ab

Please sign in to comment.