From f9ece73b7c01f0e7b8dcd6726ebd6c224f86987e Mon Sep 17 00:00:00 2001 From: meenakshijay1005-netizen Date: Thu, 16 Apr 2026 08:58:47 +0200 Subject: [PATCH 01/35] changes made to every class to match footers and fullscreen size --- .../resources/fxml/profile_org_Inbox.fxml | 442 ++++++++------ .../resources/fxml/profile_org_Payments.fxml | 538 +++++++++-------- .../resources/fxml/profile_org_Settings.fxml | 469 +++++++++------ .../main/resources/fxml/profile_org_edit.fxml | 413 +++++++------ .../resources/fxml/profile_user_history.fxml | 428 ++++++++------ .../resources/fxml/profile_user_inbox.fxml | 407 ++++++++----- .../fxml/profile_user_interests.fxml | 544 ++++++++++-------- .../resources/fxml/profile_user_settings.fxml | 436 ++++++++------ .../src/main/resources/fxml/test.fxml | 0 9 files changed, 2215 insertions(+), 1462 deletions(-) delete mode 100644 helpmehelpapplication/src/main/resources/fxml/test.fxml diff --git a/helpmehelpapplication/src/main/resources/fxml/profile_org_Inbox.fxml b/helpmehelpapplication/src/main/resources/fxml/profile_org_Inbox.fxml index e369d53c..bb6cc57a 100644 --- a/helpmehelpapplication/src/main/resources/fxml/profile_org_Inbox.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/profile_org_Inbox.fxml @@ -8,6 +8,7 @@ + @@ -19,20 +20,10 @@ - - - - - - - - - - - + - + @@ -110,199 +101,290 @@ + - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - @@ -111,220 +103,314 @@ - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + - - - + - + - + + + - - - - - - - - - + + - + + - - - - - - - - - + + + + - - + + + - - + - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + - - - - + + + + + + + + + + + + + + + + + + + From 92aaac54087eedb93af86d851d7ad6b3a73c3961 Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 00:56:53 +0200 Subject: [PATCH 13/35] Updated charityPage.fxml Added fx:id to charity logo for controller. --- .../src/main/resources/fxml/charityPage.fxml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml index c9f5b00b..680dedda 100644 --- a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml @@ -219,11 +219,7 @@ - - - - - + From 068b189000f22d1dd4227ce354db3f55d25449b1 Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 00:58:09 +0200 Subject: [PATCH 14/35] Updated CharityPageController Added reference to CharityLogo fx:id and dynamically sets the image to the logoBlob of the charity, or a placeholder image if the logoBlob is null. --- .../controller/CharityPageController.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java index 81d6f4b8..c5669e1f 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java @@ -1,9 +1,14 @@ package ntnu.systemutvikling.team6.controller; +import java.io.ByteArrayInputStream; +import java.util.Objects; + import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.control.TextField; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; import ntnu.systemutvikling.team6.controller.components.LoaderScene; import ntnu.systemutvikling.team6.models.Charity; @@ -18,6 +23,8 @@ public class CharityPageController { @FXML private Label CharityName; + @FXML private ImageView CharityLogo; + @FXML public void initialize() {} @@ -39,6 +46,17 @@ public void setCharity(Charity charity) { CharityDescription.setText(charity.getDescription()); CharityName.setText(charity.getName()); + + if (this.charity.getLogoBlob() != null) { + ByteArrayInputStream logoByteStream = new ByteArrayInputStream(this.charity.getLogoBlob()); + Image CharityLogoImage = new Image(logoByteStream); + this.CharityLogo.setImage(CharityLogoImage); + } else { + String placeholderImagePath = + Objects.requireNonNull(getClass().getResource("/images/leggTilBilde.jpg")).toExternalForm(); + Image placeholderImage = new Image(placeholderImagePath); + this.CharityLogo.setImage(placeholderImage); + } } /** From 57fdb668f20bd779116401ba21ae71baaf2ceccb Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 01:06:13 +0200 Subject: [PATCH 15/35] Updated charityPage.fxml Added fx:id and method reference to Homepage Hyperlink. --- helpmehelpapplication/src/main/resources/fxml/charityPage.fxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml index 680dedda..cbc96703 100644 --- a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml @@ -169,7 +169,7 @@ - + From 7ba02775558d980a44375fc4f67572437494151c Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 01:07:12 +0200 Subject: [PATCH 16/35] Updated CharityPageController Added method for opening browser and navigating to the url of the charity on IK. --- .../controller/CharityPageController.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java index c5669e1f..bf51b008 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/controller/CharityPageController.java @@ -2,9 +2,9 @@ import java.io.ByteArrayInputStream; import java.util.Objects; - import javafx.event.ActionEvent; import javafx.fxml.FXML; +import javafx.scene.control.Hyperlink; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.image.Image; @@ -25,6 +25,8 @@ public class CharityPageController { @FXML private ImageView CharityLogo; + @FXML private Hyperlink CharityURL; + @FXML public void initialize() {} @@ -53,7 +55,8 @@ public void setCharity(Charity charity) { this.CharityLogo.setImage(CharityLogoImage); } else { String placeholderImagePath = - Objects.requireNonNull(getClass().getResource("/images/leggTilBilde.jpg")).toExternalForm(); + Objects.requireNonNull(getClass().getResource("/images/leggTilBilde.jpg")) + .toExternalForm(); Image placeholderImage = new Image(placeholderImagePath); this.CharityLogo.setImage(placeholderImage); } @@ -91,4 +94,15 @@ public void handleSearch(ActionEvent event) { LoaderScene.LoadScene("availableOrganization", event, null, query); } + + @FXML + public void handleHomepageClick(ActionEvent event) { + try { + String url = this.charity.getURL(); + java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); + } catch (Exception e) { + System.out.println("Something went wrong when opening URL."); + e.printStackTrace(); + } + } } From 6410ed8e58ac323ad45de3148332f1d1388ef282 Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 01:11:46 +0200 Subject: [PATCH 17/35] Updated URLCharityScraper Time for scraping went down from approx 2 hours to around 20-30 mins, and is still reliable. Thread.sleep() seems to not be required after all. --- .../scraperComponents/URLCharityScraper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/scraper/scraperComponents/URLCharityScraper.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/scraper/scraperComponents/URLCharityScraper.java index f9e98b37..33b3c529 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/scraper/scraperComponents/URLCharityScraper.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/scraper/scraperComponents/URLCharityScraper.java @@ -70,7 +70,7 @@ public URLCharityScraper(String url, WebDriver driver) { * @return the {@code WebDriverWait} object to be used in the methods */ protected WebDriverWait createWait() { - return new WebDriverWait(driver, Duration.ofSeconds(30)); + return new WebDriverWait(driver, Duration.ofSeconds(10)); } /** @@ -118,7 +118,7 @@ protected void updateDescription() { wait.until( ExpectedConditions.numberOfElementsToBeMoreThan(By.cssSelector(".information"), 0)); - Thread.sleep(5000); + // Thread.sleep(5000); List firstDescription = findElements(By.cssSelector(".information")); for (WebElement element : firstDescription) { @@ -139,7 +139,7 @@ void updateLogo() { try { WebDriverWait wait = createWait(); wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".logo > img"))); - Thread.sleep(5000); + // Thread.sleep(5000); WebElement logo = findElement(By.cssSelector(".logo > img")); this.logoURL = logo.getAttribute("src"); @@ -155,7 +155,7 @@ void updateCategories() { WebDriverWait wait = createWait(); wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(".tag-label"))); - Thread.sleep(5000); + // Thread.sleep(5000); List elements = findElements(By.cssSelector(".tag-label")); @@ -183,7 +183,7 @@ void updateKeyValues() { ExpectedConditions.visibilityOfElementLocated( By.xpath( "//li[.//h2[normalize-space()='Innsamlingsprosent']]//div[@class='graph']"))); - Thread.sleep(5000); + // Thread.sleep(5000); element = findElement( By.xpath("//li[.//h2[normalize-space()='Innsamlingsprosent']]//div[@class='graph']")); @@ -224,9 +224,9 @@ public void scrapeCharityPage() { updateLogo(); updateCategories(); updateKeyValues(); - Thread.sleep(1000); + // Thread.sleep(1000); - } catch (InterruptedException e) { + } catch (Exception e) { throw new RuntimeException(e); } finally { closeDriver(); From bed9fe4686640ca87ee12156f002707e48840ffd Mon Sep 17 00:00:00 2001 From: Roar Date: Fri, 17 Apr 2026 12:08:36 +0200 Subject: [PATCH 18/35] Updated charityPage.fxml Added fx:id to arc and label for key values. --- .../src/main/resources/fxml/charityPage.fxml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml index cbc96703..130f321d 100644 --- a/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml +++ b/helpmehelpapplication/src/main/resources/fxml/charityPage.fxml @@ -294,11 +294,11 @@ - + - - - + + - - - + + + - - + + + - - - + - - + + + + + + -