From e916e6edff3fa51f84fb3440f82ef633faf25341 Mon Sep 17 00:00:00 2001 From: effe Date: Sat, 14 Sep 2024 16:17:33 -0400 Subject: [PATCH] refactor: ExpensesView --- .../application/munera/views/dashboard/DashboardView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/application/munera/views/dashboard/DashboardView.java b/src/main/java/com/application/munera/views/dashboard/DashboardView.java index cf6a6bb..57300f8 100644 --- a/src/main/java/com/application/munera/views/dashboard/DashboardView.java +++ b/src/main/java/com/application/munera/views/dashboard/DashboardView.java @@ -47,16 +47,14 @@ public class DashboardView extends Div { List availableYears = this.expenseService.getAvailableExpenseYearsForUser(loggedUser.getId()); // Initialize the ComboBox for year selection - yearComboBox = new ComboBox<>("Select Year"); + yearComboBox = new ComboBox<>(); yearComboBox.setItems(availableYears); yearComboBox.setValue(Year.now().getValue()); // Default to current year yearComboBox.setWidth("200px"); // Add listener to update charts when a new year is selected yearComboBox.addValueChangeListener(event -> { - if (event.getValue() != null) { - updateCharts(Year.of(event.getValue())); - } + if (event.getValue() != null) updateCharts(Year.of(event.getValue())); }); VerticalLayout mainLayout = new VerticalLayout();