Skip to content

Commit

Permalink
feat[NavigationController]: Add a small about us pop up feature that …
Browse files Browse the repository at this point in the history
…summarizes what this application is about
  • Loading branch information
Fredrik Marjoni committed Apr 18, 2026
1 parent 8295379 commit c4d31dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/group5/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void init() {
OrganizationService organizationService = new OrganizationService(organizationRepository, orgScraper);
this.root = new BorderPane();
this.appState = new AppState();
this.nav = new NavigationController(root, appState, userService, donationService, organizationService);
this.nav = new NavigationController(root, appState, userService, donationService, organizationService, getHostServices());
}

@Override
Expand Down
38 changes: 35 additions & 3 deletions src/main/java/edu/group5/app/control/NavigationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
import edu.group5.app.view.loginpage.SignUpPageView;
import edu.group5.app.view.organizationpage.OrganizationPageView;
import edu.group5.app.view.userpage.UserPageView;
import javafx.application.HostServices;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;

/**
* Controller responsible for handling navigation between different pages of the application.
Expand All @@ -33,23 +39,25 @@ public class NavigationController {
private final LoginHeader loginHeader;

private final AppState appState;
private HostServices hostServices;

private final AuthController authController;
private final DonationController donationController;
private final OrganizationController organizationController;

public NavigationController(BorderPane root, AppState appState, UserService userService,
DonationService donationService, OrganizationService organizationService) {
DonationService donationService, OrganizationService organizationService, HostServices hostServices) {
ParameterValidator.objectChecker(root, "Root BorderPane");
ParameterValidator.objectChecker(appState, "AppState");
ParameterValidator.objectChecker(userService, "UserService");
ParameterValidator.objectChecker(donationService, "DonationService");
ParameterValidator.objectChecker(organizationService, "OrganizationService");
ParameterValidator.objectChecker(hostServices, "HostServices");

this.root = root;
this.header = new Header(this);
this.loginHeader = new LoginHeader();

this.hostServices = hostServices;
this.appState = appState;

this.authController = new AuthController(appState, this, userService);
Expand Down Expand Up @@ -122,7 +130,31 @@ public void showDonationPage() {
}

public void showAboutUsPage() {
root.setTop(header);
Alert aboutUs = new Alert(Alert.AlertType.INFORMATION);
aboutUs.setTitle("About us");
aboutUs.setHeaderText("Help Me Help - About Us");

Label description = new Label(
"Help Me Help is a charity donation application designed to connect donors with organizations in need. " +
"Our mission is to make it easy for people to support causes they care about and make a positive impact in the world.\n\n" +
"This application was developed by Team 5 as part of a IDATT1005 course project at NTNU spring 2026."
);
description.setWrapText(true);
description.maxWidthProperty().bind(aboutUs.getDialogPane().widthProperty().subtract(40));

Hyperlink websiteLink = new Hyperlink("For more information about the project, visit our GitHub repository");
websiteLink.setOnAction(e -> hostServices.showDocument("https://git.ntnu.no/Group-5/Help-Me-Help"));

VBox content = new VBox(10, description, websiteLink);
content.setPrefWidth(420);

aboutUs.getDialogPane().setContentText(null);
aboutUs.getDialogPane().setContent(content);

// Optional: single Close button instead of OK
aboutUs.getButtonTypes().setAll(ButtonType.CLOSE);

aboutUs.showAndWait();
}

/**
Expand Down

0 comments on commit c4d31dc

Please sign in to comment.