Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Status error message #181

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ dependencies {
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'mac'
implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'linux'
implementation group: 'org.openjfx', name: 'javafx-media' , version:javaFxVersion, classifier: 'win'

implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/status/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
public class Status {

public static final String MESSAGE_CONSTRAINTS = "The statuses are only none, non-urgent and urgent. Please use "
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, i'll need to update this in the ug as well

+ "only one of them";
public static final String MESSAGE_CONSTRAINTS = "The Statuses are None, Non_Urgent and Urgent. Please use "
+ "one of them.";

public final StatusEnum status;

Expand Down
64 changes: 25 additions & 39 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
import java.util.logging.Logger;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import seedu.address.commons.core.LogsCenter;

Expand All @@ -33,15 +33,9 @@ public class HelpWindow extends UiPart<Stage> {
private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
private static final String FXML = "HelpWindow.fxml";

@FXML
private Button openGuideButton;

@FXML
private TableView<CommandSummary> commandTable;

@FXML
private WebView helpMessageWebView;

@FXML
private VBox mainContainer;

Expand All @@ -58,21 +52,6 @@ public HelpWindow(Stage root) {
titleLabel.getStyleClass().add("help-title");
mainContainer.getChildren().add(0, titleLabel);
initializeCommandTable();
helpMessageWebView.getEngine().loadContent(
"<html><body style='display: flex; justify-content: center; align-items: center; height: 100%; "
+ "margin: 0; padding: 0; background-color: #2b2b2b;'>"
+ "<p style='color: #e6e6e6; font-family: \"Segoe UI\", sans-serif; font-size: 14pt; "
+ "text-align: center;'>"
+ "For more information, please refer to the user guide."
+ "</p></body></html>"
);

helpMessageWebView.setPrefHeight(50);

openGuideButton.setMaxWidth(Double.MAX_VALUE);
openGuideButton.setPrefHeight(40);

setEventHandlers();
}

/**
Expand All @@ -82,14 +61,6 @@ public HelpWindow() {
this(new Stage());
}

/**
* Initializes the event handlers for the help window.
* Specifically, it sets the action on the button to open the user guide.
*/
private void setEventHandlers() {
openGuideButton.setOnAction(event -> openUserGuide());
}

/**
* Initializes the command table with predefined columns and items. This method sets up the structure of the table,
* including the columns for action, command format, and example, and fills it with data.
Expand Down Expand Up @@ -117,23 +88,26 @@ private void initializeCommandTable() {
"Automatic",
"No command required"),
new CommandSummary(
"Add New Customer",
"Add New Client",
"add n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> "
+ "[t/ <TIER>] [rn/ <REMARK>]",
+ "[t/ <TIER>] [s/ <STATUS>] [r/ <REMARK>]",
"add n/ TAN LESHEW p/ 99007766 e/ [email protected] a/ com3 j/ doctor i/ 99999 "
+ "t/ gold rn/ got anger issue"),
new CommandSummary("Remove Old Customer",
+ "t/ gold s/ urgent r/ got anger issue"),
new CommandSummary("Remove Old Client",
"delete <INDEX>",
"delete 69"),
new CommandSummary("Edit Existing Customer",
new CommandSummary("Edit Existing Client",
"edit <INDEX> n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> "
+ "[t/ <TIER>] "
+ "[t/ <TIER>] [s/ <STATUS>]"
+ "[rn/ <NEW REMARK>] [ra/ <REMARK TO BE APPENDED ONTO EXISTING ONE>]",
"edit 69 n/ TAN LESHEW p/ 77337733 e/ [email protected] a/ COM3 j/ doctor i/ 1000000000"
"edit 69 n/ TAN LESHEW p/ 77337733 e/ [email protected] a/ COM3 j/ doctor i/ 1000000000 "
+ "ra/ Specialist in eye care"),
new CommandSummary("Find a Customer by Details",
new CommandSummary("Find a Client by Details",
"filter <FLAG>/ <FLAG FIELD>",
"filter n/ TAN LESHEW"),
new CommandSummary("Undo Previous Command",
"undo",
"undo"),
new CommandSummary("Help",
"help",
"help"),
Expand Down Expand Up @@ -277,5 +251,17 @@ public String getCommandFormat() {
public String getExample() {
return example;
}

}

/**
* Copies the URL to the user guide to the clipboard.
*/
@FXML
private void copyUrl() {
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent url = new ClipboardContent();
url.putString(USERGUIDE_URL);
clipboard.setContent(url);
}
}
5 changes: 2 additions & 3 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<?import javafx.scene.control.TableView?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.web.WebView?>
<?import javafx.stage.Stage?>

<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
Expand All @@ -28,8 +27,8 @@
<TableView fx:id="commandTable" VBox.vgrow="ALWAYS" />

<VBox fx:id="helpMessageContainer" styleClass="help-message-container">
<WebView fx:id="helpMessageWebView" />
<Button fx:id="openGuideButton" mnemonicParsing="false" text="Open User Guide" />
<Button fx:id="copyButton" mnemonicParsing="false" onAction="#copyUrl" text="Copy link to User Guide">
</Button>
</VBox>
</VBox>
</Scene>
Expand Down