En-desarrollo #59

Merged
alex merged 12 commits from En-desarrollo into main 2024-10-22 01:01:10 +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);