From 411f38477510073dd59db73f41a2a09c0c424726 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Tue, 9 Jul 2024 18:40:58 -0400 Subject: [PATCH] Removed most fancy search features for now while I add an SQL console. --- .../control/TransactionsViewController.java | 28 ---------- src/main/resources/transactions-view.fxml | 55 +++---------------- 2 files changed, 7 insertions(+), 76 deletions(-) diff --git a/src/main/java/com/andrewlalis/perfin/control/TransactionsViewController.java b/src/main/java/com/andrewlalis/perfin/control/TransactionsViewController.java index c575eea..f3f7b90 100644 --- a/src/main/java/com/andrewlalis/perfin/control/TransactionsViewController.java +++ b/src/main/java/com/andrewlalis/perfin/control/TransactionsViewController.java @@ -24,8 +24,6 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ObservableValue; import javafx.fxml.FXML; import javafx.scene.Node; -import javafx.scene.control.TabPane; -import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; @@ -33,7 +31,6 @@ import javafx.scene.layout.VBox; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import static com.andrewlalis.perfin.PerfinApp.router; @@ -53,10 +50,8 @@ public class TransactionsViewController implements RouteSelectionListener { public record RouteContext(Long selectedTransactionId) {} @FXML public BorderPane transactionsListBorderPane; - @FXML public TabPane searchTabPane; @FXML public TextField searchField; @FXML public AccountSelectionBox filterByAccountComboBox; - @FXML public TextArea customSearchSqlTextArea; @FXML public VBox transactionsVBox; @@ -80,12 +75,6 @@ public class TransactionsViewController implements RouteSelectionListener { selectedTransaction.set(null); }); - // Add listener to reset search when a different search tab is selected. - searchTabPane.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) -> { - paginationControls.setPage(1); - selectedTransaction.set(null); - }); - this.paginationControls = new DataSourcePaginationControls( transactionsVBox.getChildren(), new DataSourcePaginationControls.PageFetcherFunction() { @@ -173,24 +162,7 @@ public class TransactionsViewController implements RouteSelectionListener { Popups.message(transactionsListBorderPane, "Exporting transactions is not yet supported."); } - @FXML public void executeSqlQuery() { - paginationControls.setPage(1); - selectedTransaction.set(null); - } - private List getCurrentSearchFilters() { - if (searchTabPane.getSelectionModel().isSelected(0)) { - return getBasicSearchFilters(); - } else if (searchTabPane.getSelectionModel().isSelected(1)) { - return Collections.emptyList(); - } else if (searchTabPane.getSelectionModel().isSelected(2) && !customSearchSqlTextArea.getText().isBlank()) { - var filter = new SearchFilter.Builder().where(customSearchSqlTextArea.getText().strip()).build(); - return List.of(filter); - } - return Collections.emptyList(); - } - - private List getBasicSearchFilters() { List filters = new ArrayList<>(); if (searchField.getText() != null && !searchField.getText().isBlank()) { final String text = searchField.getText().strip(); diff --git a/src/main/resources/transactions-view.fxml b/src/main/resources/transactions-view.fxml index 6cc3329..a7b6781 100644 --- a/src/main/resources/transactions-view.fxml +++ b/src/main/resources/transactions-view.fxml @@ -21,54 +21,13 @@ - - - - - - - - - - - - - - - - -