From ca630ef5c613f2d1a1b869650cb13ca663e2735f Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 31 Oct 2024 01:29:59 -0400 Subject: [PATCH] =?UTF-8?q?#37=20Perfil=20de=20Personal=20Administrativo?= =?UTF-8?q?=20-=20Listado=20General=20de=20Vacaciones=20(Tracducir=20a=20e?= =?UTF-8?q?spa=C3=B1ol)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/RequestsListView.java | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index aa1de7e..58f991d 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -70,10 +70,10 @@ public class RequestsListView extends Main { } private void setupRequestGrid() { - requestGrid.addColumn(this::getEmployeeFullName).setHeader("Employee"); - requestGrid.addColumn(this::getTeamName).setHeader("Team"); - requestGrid.addColumn(this::getEmployeeStatus).setHeader("Employee State"); - requestGrid.addColumn(this::getGeneralTotal).setHeader("General Total"); + requestGrid.addColumn(this::getEmployeeFullName).setHeader("Empleado"); + requestGrid.addColumn(this::getTeamName).setHeader("Equipo"); + requestGrid.addColumn(this::getEmployeeStatus).setHeader("Estado del empleado"); + requestGrid.addColumn(this::getGeneralTotal).setHeader("Total general"); requestGrid.setPaginationBarMode(PagingGrid.PaginationBarMode.BOTTOM); requestGrid.setPageSize(5); @@ -86,14 +86,14 @@ public class RequestsListView extends Main { } private HorizontalLayout createActionButtons() { - Button viewButton = new Button("View", event -> { + Button viewButton = new Button("Ver", event -> { if (selectedEmployeeId != null) { navigateToTimeOffRequestView(selectedEmployeeId); } else { - Notification.show("Please select a request to view.", 3000, Notification.Position.MIDDLE); + Notification.show("Seleccione una solicitud para verla.", 3000, Notification.Position.MIDDLE); } }); - Button closeButton = new Button("Close", event -> navigateToMainView()); + Button closeButton = new Button("Salir", event -> navigateToMainView()); return new HorizontalLayout(viewButton, closeButton); } @@ -114,24 +114,24 @@ public class RequestsListView extends Main { final Status state) { List filteredEmployees = employeeService.findAllEmployees(); - if (employee != null && !"ALL".equals(employee.getFirstName())) { + if (employee != null && !"TODOS".equals(employee.getFirstName())) { filteredEmployees = filteredEmployees.stream() .filter(emp -> emp.getId().equals(employee.getId())) .collect(Collectors.toList()); } - if (team != null && !"ALL".equals(team.getName())) { + if (team != null && !"TODOS".equals(team.getName())) { filteredEmployees = filteredEmployees.stream() .filter(emp -> emp.getTeam() != null && emp.getTeam().getId().equals(team.getId())) .collect(Collectors.toList()); } - if (state != null && state != Status.ALL) { + if (state != null && state != Status.TODOS) { filteredEmployees = filteredEmployees.stream() .filter(emp -> { Optional request = requestService - .findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.TAKEN); - return state == Status.IDLE ? request.isPresent() : request.isEmpty(); + .findByEmployeeAndState(emp.getId(), TimeOffRequestStatus.IN_USE); + return state == Status.EN_DESCANSO ? request.isPresent() : request.isEmpty(); }) .collect(Collectors.toList()); } @@ -141,22 +141,22 @@ public class RequestsListView extends Main { } private String getEmployeeFullName(final Employee employee) { - return "ALL".equals(employee.getFirstName()) ? "ALL" : employee.getFirstName() + " " + employee.getLastName(); + return "TODOS".equals(employee.getFirstName()) ? "TODOS" : employee.getFirstName() + " " + employee.getLastName(); } private String getTeamName(final Employee employee) { Team team = employee.getTeam(); - return team != null ? team.getName() : "Unassigned"; + return team != null ? team.getName() : "Sin asignar"; } private String getTeamLabel(final Team team) { - return "ALL".equals(team.getName()) ? "ALL" : team.getName(); + return "TODOS".equals(team.getName()) ? "TODOS" : team.getName(); } private String getEmployeeStatus(final Employee employee) { Optional activeRequest = requestService .findByEmployeeAndState(employee.getId(), TimeOffRequestStatus.IN_USE); - return activeRequest.isPresent() ? "IDLE" : "ACTIVE"; + return activeRequest.isPresent() ? "EN_DESCANSO" : "ACTIVO"; } private String getGeneralTotal(final Employee employee) { @@ -249,7 +249,7 @@ public class RequestsListView extends Main { } private ComboBox createEmployeeFilter() { - employeeFilter = new ComboBox<>("Employee"); + employeeFilter = new ComboBox<>("Empleado"); List employees = new ArrayList<>(employeeService.findAllEmployees()); employees.addFirst(createAllEmployeesOption()); employeeFilter.setItems(employees); @@ -266,7 +266,7 @@ public class RequestsListView extends Main { } private ComboBox createTeamFilter() { - teamFilter = new ComboBox<>("Team"); + teamFilter = new ComboBox<>("Equipo"); List teams = new ArrayList<>(teamService.findAllTeams()); teams.addFirst(createAllTeamsOption()); teamFilter.setItems(teams); @@ -283,7 +283,7 @@ public class RequestsListView extends Main { } private ComboBox createStateFilter() { - stateFilter = new ComboBox<>("Employee State"); + stateFilter = new ComboBox<>("Estado del empleado"); stateFilter.setItems(Status.values()); stateFilter.setValue(Status.values()[0]); stateFilter.addValueChangeListener(event -> @@ -297,20 +297,20 @@ public class RequestsListView extends Main { } private enum Status { - ALL, - IDLE, - ACTIVE + TODOS, + EN_DESCANSO, + ACTIVO } private Employee createAllEmployeesOption() { Employee allEmployeesOption = new Employee(); - allEmployeesOption.setFirstName("ALL"); + allEmployeesOption.setFirstName("TODOS"); return allEmployeesOption; } private Team createAllTeamsOption() { Team allTeamsOption = new Team(); - allTeamsOption.setName("ALL"); + allTeamsOption.setName("TODOS"); return allTeamsOption; }