Compare commits

..

No commits in common. "83ba9f747875b540283955f34d2f685cba301427" and "4f6935341da2fa8e8601c9133c5d1880af6e2078" have entirely different histories.

2 changed files with 9 additions and 5 deletions

View File

@ -51,7 +51,7 @@ public class RequestsListView extends Main {
this.vacationService = vacationService;
this.employees = employeeService.findAllEmployees();
initializeView();
refreshGeneralRequestGrid(null, null, null);
refreshGeneralRequestGrid(null, null, null, null);
}
private void initializeView() {
@ -97,6 +97,7 @@ public class RequestsListView extends Main {
private void refreshGeneralRequestGrid(final Employee employee,
final Team team,
final TimeOffRequestType category,
final Status state) {
requestGrid.setPagingDataProvider((page, pageSize) -> {
int start = (int) (page * requestGrid.getPageSize());
@ -109,7 +110,7 @@ public class RequestsListView extends Main {
final int pageSize,
final Employee employee,
final Team team,
final Status state) {
final Status employeeState) {
List<Employee> filteredEmployees = employeeService.findAllEmployees();
if (employee != null && !"ALL".equals(employee.getFirstName())) {
@ -124,12 +125,12 @@ public class RequestsListView extends Main {
.collect(Collectors.toList());
}
if (state != null && state != Status.ALL) {
if (employeeState != null && employeeState != Status.ALL) {
filteredEmployees = filteredEmployees.stream()
.filter(emp -> {
Optional<TimeOffRequest> request = requestService
.findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.TAKEN);
return state == Status.IDLE ? request.isPresent() : request.isEmpty();
return employeeState == Status.IDLE ? request.isPresent() : request.isEmpty();
})
.collect(Collectors.toList());
}
@ -196,6 +197,7 @@ public class RequestsListView extends Main {
refreshGeneralRequestGrid(
event.getValue(),
teamFilter.getValue(),
categoryFilter.getValue(),
stateFilter.getValue()
)
);
@ -213,6 +215,7 @@ public class RequestsListView extends Main {
refreshGeneralRequestGrid(
employeeFilter.getValue(),
event.getValue(),
categoryFilter.getValue(),
stateFilter.getValue()
)
);
@ -227,6 +230,7 @@ public class RequestsListView extends Main {
refreshGeneralRequestGrid(
employeeFilter.getValue(),
teamFilter.getValue(),
categoryFilter.getValue(),
event.getValue()
)
);

View File

@ -76,7 +76,7 @@ values ('9c6f12ba-e333-4e7a-b8a6-caa0982bd8c3', 1, '5c6f11fe-c341-4be7-a9a6-bba0
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('9d6f12ba-e444-4e7a-b8a6-caa0982bd8d4', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'GOOD_FRIDAY', 'COMPLETED', 1, '2024-03-29', '2024-03-29', '2024-03-29', 1, 0);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('9e6f12ba-e555-4e7a-b8a6-caa0982bd8e5', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'VACATION_CURRENT_MANAGEMENT', 'APPROVED', 30, '2026-11-01', '2024-11-01', '2024-11-30', 30, 0);
values ('9e6f12ba-e555-4e7a-b8a6-caa0982bd8e5', 1, '5c6f11fe-c341-4be7-a9a6-bba0081ad7c6', 'LABOR_DAY', 'REJECTED', 1, '2025-05-01', '2024-05-01', '2024-05-01', 1, 0);
insert into time_off_request (id, version, employee_id, category, state, available_days, expiration, start_date, end_date, days_to_be_take, days_balance)
values ('8c653f2a-f9a3-4d67-b3b6-12ad98fe0983', 1, 'f6ab3c6d-7078-45f6-9b22-4e37637bfec6', 'LABOR_DAY', 'REQUESTED', 1, '2025-05-01', '2024-05-01', '2024-05-01', 1, 0);