Vacaciones #58

Merged
jesus.pelaez merged 8 commits from Vacaciones into En-desarrollo 2024-10-21 16:43:12 +00:00
Showing only changes of commit 2582c5e903 - Show all commits

View File

@ -64,8 +64,14 @@ public class RequestRegisterView extends VerticalLayout {
List<Employee> employees = employeeService.findAllEmployees(); List<Employee> employees = employeeService.findAllEmployees();
employeeComboBox.setItems(employees); employeeComboBox.setItems(employees);
employeeComboBox.setItemLabelGenerator(emp -> emp.getFirstName() + " " + emp.getLastName()); employeeComboBox.setItemLabelGenerator(emp -> emp.getFirstName() + " " + emp.getLastName());
categoryComboBox.setEnabled(false);
categoryComboBox.setItems(TimeOffRequestType.values()); categoryComboBox.setItems(TimeOffRequestType.values());
categoryComboBox.addValueChangeListener(event -> updateAvailableDays(event.getValue())); categoryComboBox.addValueChangeListener(event -> updateAvailableDays(event.getValue()));
employeeComboBox.addValueChangeListener(event -> {
if (event.getValue() != null) {
categoryComboBox.setEnabled(true);
}
});
startDatePicker.addValueChangeListener(event -> updateDatePickerMinValues()); startDatePicker.addValueChangeListener(event -> updateDatePickerMinValues());
endDatePicker.addValueChangeListener(event -> calculateDays()); endDatePicker.addValueChangeListener(event -> calculateDays());
availableDaysField.setReadOnly(true); availableDaysField.setReadOnly(true);