From 32c6c0de26becf343ed23276f47758f86a47ffac Mon Sep 17 00:00:00 2001 From: Filippo Ferrari Date: Mon, 5 Aug 2024 22:14:53 +0200 Subject: [PATCH] refactor: isResolved changed to isPaid --- .../munera/views/expenses/ExpensesView.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/application/munera/views/expenses/ExpensesView.java b/src/main/java/com/application/munera/views/expenses/ExpensesView.java index c52b851..1a8ea4f 100644 --- a/src/main/java/com/application/munera/views/expenses/ExpensesView.java +++ b/src/main/java/com/application/munera/views/expenses/ExpensesView.java @@ -98,7 +98,7 @@ public class ExpensesView extends Div implements BeforeEnterObserver { grid.addColumn(Expense::getDate).setHeader("Date").setSortable(true).setSortProperty("date"); // grid.addColumn(expenseEvent -> expenseEvent.getEvent().getName()).setHeader("Event").setSortable(true); - grid.addColumn(new ComponentRenderer<>(expense1 -> createBadge(expenseService.isExpenseResolved(expense1)))).setHeader("Status").setSortable(true); + grid.addColumn(new ComponentRenderer<>(expense1 -> createBadge(expenseService.isExpensePaid(expense1)))).setHeader("Status").setSortable(true); grid.getColumns().forEach(col -> col.setAutoWidth(true)); grid.setItems(this.expenseService.findAllOrderByDateDescending()); @@ -292,13 +292,13 @@ public class ExpensesView extends Div implements BeforeEnterObserver { periodInterval.setVisible(isPeriodicChecked); } - private Span createBadge(Boolean isExpenseResolved) { + private Span createBadge(Boolean isExpensePaid) { Span badge = new Span(); - if (Boolean.TRUE.equals(isExpenseResolved)) { - badge.setText("Resolved"); + if (Boolean.TRUE.equals(isExpensePaid)) { + badge.setText("Paid"); badge.getElement().getThemeList().add("badge success"); } else { - badge.setText("To be Resolved"); + badge.setText("Owed"); badge.getElement().getThemeList().add("badge error"); } return badge;