From 3cfdcc487e0a38dd727b6593b08763d6ac7aa440 Mon Sep 17 00:00:00 2001 From: AdrianBalunan Date: Wed, 22 Apr 2026 20:00:38 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Added=20Missing=20fxml=20and=20fx:ids=20?= =?UTF-8?q?and=20unntaksh=C3=A5ndtering=20upon=20empty=20charity=20attribu?= =?UTF-8?q?tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AvailableOrganizationController.java | 18 +++++- .../fxml/available_organizations.fxml | 58 ++++++------------- .../main/resources/fxml/profile_org_edit.fxml | 1 - 3 files changed, 34 insertions(+), 43 deletions(-) diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/AvailableOrganizationController.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/AvailableOrganizationController.java index 5a9386e..b7d1444 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/AvailableOrganizationController.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/AvailableOrganizationController.java @@ -53,6 +53,8 @@ public void initialize() { CharityRegistry charities = db.getCharitiesFromDB(); allCharities = charities.getAllCharities(); + + cardsContainer.getChildren().clear(); searchField @@ -77,8 +79,20 @@ private List filterCharities(String query) { } for (Charity charity : allCharities) { - String name = charity.getName().toLowerCase(); - String description = charity.getDescription().toLowerCase(); + String name = charity.getName(); + String description = charity.getDescription(); + + if (name == null || name.isBlank()){ + name = "This one has no name"; + } else { + name = name.toLowerCase(); + } + if (description == null || description.isBlank()){ + description = "This one has no description"; + } else { + description = description.toLowerCase(); + } + if (name.contains(query) || description.contains(query)) { matches.add(charity); diff --git a/helpmehelpapplication/src/main/resources/fxml/available_organizations.fxml b/helpmehelpapplication/src/main/resources/fxml/available_organizations.fxml index 51e0525..bce73a2 100644 --- a/helpmehelpapplication/src/main/resources/fxml/available_organizations.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/available_organizations.fxml @@ -1,31 +1,19 @@ - - - - - + - - - - - + @@ -34,43 +22,33 @@
- + + - + - - - @@ -83,4 +61,4 @@ - \ No newline at end of file + diff --git a/helpmehelpapplication/src/main/resources/fxml/profile_org_edit.fxml b/helpmehelpapplication/src/main/resources/fxml/profile_org_edit.fxml index a17a1cf..215fa2b 100644 --- a/helpmehelpapplication/src/main/resources/fxml/profile_org_edit.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/profile_org_edit.fxml @@ -152,7 +152,6 @@ -