Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Birthdate month does not show "Empty" instead of "confidential" when … #13180

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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
@@ -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())