Skip to content

Commit 14977ab

Browse files
Merge pull request #13180 from SORMAS-Foundation/bugfix-13179_Birthdate_month_does_not_show_confidential
Birthdate month does not show "Empty" instead of "confidential" when …
2 parents 8fe745c + a682d07 commit 14977ab

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/person/PersonDto.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ public class PersonDto extends PseudonymizableDto implements IsPerson {
195195
@SensitiveData
196196
private Integer birthdateDD;
197197
@Outbreaks
198+
@PersonalData
199+
@SensitiveData
198200
private Integer birthdateMM;
199201
@Outbreaks
200202
private Integer birthdateYYYY;

sormas-ui/src/main/java/de/symeda/sormas/ui/person/PersonEditForm.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,8 @@ protected void addFields() {
296296
ComboBox birthDateMonth = addField(PersonDto.BIRTH_DATE_MM, ComboBox.class);
297297
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
298298
birthDateMonth.setNullSelectionAllowed(true);
299-
birthDateMonth.addItems(DateHelper.getMonthsInYear());
300-
birthDateMonth.setPageLength(12);
301299
birthDateMonth.setInputPrompt(I18nProperties.getString(Strings.month));
302300
birthDateMonth.setCaption("");
303-
DateHelper.getMonthsInYear()
304-
.forEach(month -> birthDateMonth.setItemCaption(month, de.symeda.sormas.api.Month.values()[month - 1].toString()));
305-
setItemCaptionsForMonths(birthDateMonth);
306301
ComboBox birthDateYear = addField(PersonDto.BIRTH_DATE_YYYY, ComboBox.class);
307302
birthDateYear.setCaption(I18nProperties.getPrefixCaption(PersonDto.I18N_PREFIX, PersonDto.BIRTH_DATE));
308303
// @TODO: Done for nullselection Bug, fixed in Vaadin 7.7.3
@@ -446,6 +441,13 @@ protected void addFields() {
446441
initializeVisibilitiesAndAllowedVisibilities();
447442
initializeAccessAndAllowedAccesses();
448443

444+
if (isEditableAllowed(PersonDto.BIRTH_DATE_MM)) {
445+
birthDateMonth.addItems(DateHelper.getMonthsInYear());
446+
birthDateMonth.setPageLength(13);
447+
DateHelper.getMonthsInYear()
448+
.forEach(month -> birthDateMonth.setItemCaption(month, de.symeda.sormas.api.Month.values()[month - 1].toString()));
449+
}
450+
449451
if (!getField(PersonDto.OCCUPATION_TYPE).isVisible()
450452
&& !getField(PersonDto.ARMED_FORCES_RELATION_TYPE).isVisible()
451453
&& !getField(PersonDto.EDUCATION_TYPE).isVisible())

0 commit comments

Comments
 (0)