refactor: ExpensesView columns

This commit is contained in:
effe 2024-09-15 17:22:20 -04:00
parent f2e39bb8d7
commit b1a3e56d04

View file

@ -106,8 +106,8 @@ public class ExpensesView extends Div implements BeforeEnterObserver {
grid.addColumn(Expense::getName).setHeader("Name").setSortable(true).setSortProperty("name"); grid.addColumn(Expense::getName).setHeader("Name").setSortable(true).setSortProperty("name");
grid.addColumn(Expense::getCost).setHeader("Amount").setSortable(true).setSortProperty("cost"); grid.addColumn(Expense::getCost).setHeader("Amount").setSortable(true).setSortProperty("cost");
grid.addColumn(expenseCategory -> expenseCategory.getCategory().getName()).setHeader("Category").setSortable(true).setSortProperty("category"); grid.addColumn(expenseCategory -> expenseCategory.getCategory().getName()).setHeader("Category").setSortable(true).setSortProperty("category");
grid.addColumn(Expense::getPeriodInterval).setHeader("Period Interval").setSortable(true); // grid.addColumn(Expense::getPeriodInterval).setHeader("Period Interval").setSortable(true);
grid.addColumn(Expense::getPeriodUnit).setHeader("Period Unit").setSortable(true); // grid.addColumn(Expense::getPeriodUnit).setHeader("Period Unit").setSortable(true);
grid.addColumn(Expense::getDate).setHeader("Date").setSortable(true).setSortProperty("date"); grid.addColumn(Expense::getDate).setHeader("Date").setSortable(true).setSortProperty("date");
grid.addColumn(new ComponentRenderer<>(this.viewsService::createExpenseBadge)).setHeader("Status").setSortable(true); grid.addColumn(new ComponentRenderer<>(this.viewsService::createExpenseBadge)).setHeader("Status").setSortable(true);
grid.getColumns().forEach(col -> col.setAutoWidth(true)); grid.getColumns().forEach(col -> col.setAutoWidth(true));