Skip to content

Commit

Permalink
Merge pull request #57 from ejnan/update-developerguide
Browse files Browse the repository at this point in the history
Update Developer Guide to include Help Command
  • Loading branch information
iamtr authored Apr 2, 2024
2 parents bc449a8 + 86291b3 commit 4c97943
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 25 deletions.
33 changes: 29 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa

This section describes some noteworthy details on how certain features are implemented.

### Help command

The help command is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application.

The following class diagram shows the relevant classes involved in the help command implementation:

![HelpCommandClassDiagram](images/HelpClassDiagram.png)

The `HelpCommand` class extends the `Command` interface and is responsible for executing the `help` command. It creates a `CommandResult` object with the help message to be displayed to the user.

The following sequence diagram shows how the help command works:

![HelpCommandSequenceDiagram](images/HelpSequenceDiagram.png)

When the user executes the help command, the following steps occur:

1. The `LogicManager` is called to execute the "help" command.
2. The `AddressBookParser` parses the command and creates a new `HelpCommand` instance.
3. The `LogicManager` calls the `execute()` method of the `HelpCommand`.
4. The `HelpCommand` creates a new `CommandResult` with the help message.
5. The `MainWindow` handles the help command and calls the `handleHelp()` method.
6. The `ResultDisplay` is updated with the help message obtained from `HelpCommand.SHOWING_HELP_MESSAGE`.

The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user.

### \[Proposed\] Undo/redo feature

#### Proposed Implementation
Expand Down Expand Up @@ -422,7 +447,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
**MSS**

1. User requests to view contacts(UC01)
2. User requests to delete a specific person in the list
2. User requests to delete a specific person in the list
3. AddressBook deletes the person

Use case ends.
Expand Down Expand Up @@ -453,14 +478,14 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
10. The software should work without requiring an installer.
11. The software should not depend on a specific remote server.
12. The GUI should work well for standard screen resolutions 1920x1080 and higher, and, for screen scales 100% and 125%.
13. The GUI should be usable (i.e., all functions can be used even if the user experience is not optimal) for,
13. The GUI should be usable (i.e., all functions can be used even if the user experience is not optimal) for,
resolutions 1280x720 and higher, and, for screen scales 150%.
14. The product should be available as a single JAR file of size 100MB or below.
15. The web documents saved should be a PDF file of size 15MB or below.
16. The final JAR/PDF files should not be bloated unnecessarily.
17. The DG and UG should be PDF-friendly, without any expandable panels, embedded videos, animated GIFs etc.
18. The use of third-party frameworks/libraries/services is allowed only if they, are free, open-source (this
doesn't apply to services), and have permissive license terms; do not require any installation by the user; do
18. The use of third-party frameworks/libraries/services is allowed only if they, are free, open-source (this
doesn't apply to services), and have permissive license terms; do not require any installation by the user; do
not violate other constraints.
19. The product should process a user input command within 1 second.
20. The system must perform without failure in 95 percent of use cases during a month.
Expand Down
87 changes: 66 additions & 21 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
---
layout: page
title: User Guide
nav_order : 2
---
Nursing Address Book (NAB) is a desktop application tailored for ward nurses, optimizing patient contact management via a Command Line Interface (CLI) while incorporating a Graphical User Interface (GUI) for ease of use.
# Nursing Address Book (NAB)
Nursing Address Book (NAB) is a desktop application tailored for ward nurses, optimizing patient contact management via a Command Line Interface (CLI) while incorporating a Graphical User Interface (GUI) for ease of use.
Designed for efficiency, NAB enables quick access to patient records, streamlined contact management, and simplified logging of care details, proving to be a valuable tool for fast typists and those who prefer the precision of CLI operations.

## Table of Contents
* Quick Start
* Features
* Adding a Patient
* Viewing Patients
* Editing a Patient's details
* Finding a Patient
* Deleting a Patient
* Clearing all Entries
* Exiting the Application
* FAQ
* Command Summary
* [Quick Start](#quick-start)
* [Features](#features)
* [Adding a Patient](#adding-a-patient-add)
* [Viewing Patients](#listing-all-patients--list)
* [Editing a Patient](#editing-a-patient--edit)
* [Finding a Patient](#locating-patients-by-name-find)
* [Deleting a Patient](#deleting-a-patient--delete)
* [Viewing Help](#viewing-help--help)
* [Clearing all Entries](#clearing-all-entries--clear)
* [Exiting the Application](#exiting-the-program--exit)
* [FAQ](#faq)
* [Command Summary](#command-summary)
* [Troubleshooting](#troubleshooting)

--------------------------------------------------------------------------------------------------------------------

Expand All @@ -28,7 +32,7 @@ Designed for efficiency, NAB enables quick access to patient records, streamline

3. Copy the file to the folder you want to use as the _home folder_ for your AddressBook.

4. Open a command terminal, For Windows users, search for `cmd` in the Start menu and run it as an administrator if necessary. Use the `cd` command to navigate to the folder where you placed the jar file. Run the application by executing `java -jar addressbook`.jar.<br>
4. Open a command terminal, For Windows users, search for `cmd` in the Start menu and run it as an administrator if necessary. Use the `cd` command to navigate to the folder where you placed the jar file. Run the application by executing `java -jar nab.jar`.<br>
Shortly, a GUI resembling the following should display, including some sample input to get you started:<br>
![Ui](images/Ui.png)
<br>
Expand Down Expand Up @@ -72,7 +76,7 @@ Designed for efficiency, NAB enables quick access to patient records, streamline
* If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.
</div>

### Adding a person: `add`
### Adding a patient: `add`

Adds a new patient's information to the address book.

Expand Down Expand Up @@ -106,15 +110,15 @@ Tags: FallRisk, Diabetes
You now have 1 patient(s) in your address book.
```

### Listing all persons : `list`
### Listing all patients : `list`

Displays a list of all registered patients.

Format: `list`, `list [w\WARD] [t\TAG]...`

* WARD: Must only list at most 1 ward.

Example command:
Example command:

`list`
```
Expand All @@ -124,7 +128,7 @@ Here are the details of the 2 patients in your contact book:
2. Jane Doe
```

Example command:
Example command:

`list w\B4 t\SeverAllergies`
```
Expand All @@ -140,9 +144,9 @@ Ward: B4
Tags: SevereAllergies
```

### Editing a person : `edit`
### Editing a patient : `edit`

Edits an existing person in the address book.
Edits an existing patient's details in the address book.

Format: `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]…​`

Expand Down Expand Up @@ -170,7 +174,7 @@ Ward: A1
Tags:
```

### Locating persons by name: `find`
### Locating patients by name: `find`

Finds patients whose names contain any of the given keywords.

Expand All @@ -187,7 +191,7 @@ Examples:
* `find John` returns `john` and `John Doe`
* `find alex david` returns `Alex Yeoh`, `David Li`<br>

### Deleting a person : `delete`
### Deleting a patient : `delete`

Deletes the specified patient from the address book.

Expand All @@ -210,6 +214,40 @@ Tags: SevereAllergies
You now have 1 patient(s) in your contact book.
```
### Viewing help : `help`

Shows a message explaining the available commands and their usage.

Format: `help`

Output:

```
Here are the list of available commands:
Add: add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [t\TAG]...
Example: add n\John Doe ic\T1234567P dob\01/01/2000 ad\25/03/2024 w\A1 t\Diabetes t\FallRisk
Clear: clear
Clears all entries from the address book.
Delete: delete INDEX
Example: delete 3
Edit: edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]...
Example: edit 1 ic\T0123456P t\
Find: find KEYWORD [MORE_KEYWORDS]
Example: find John
List: list
Lists all patients.
Exit: exit
Exits the application.
For more detailed information on each command, please refer to the User Guide.
```

### Clearing all entries : `clear`

Expand Down Expand Up @@ -267,3 +305,10 @@ Action | Format, Examples
**Edit** | `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]…​`<br> e.g.,`edit 2 n\James Lee w\A2`
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake`
**List** | `list`
**Help** | `help`

--------------------------------------------------------------------------------------------------------------------

## Troubleshooting

1. **When using multiple screens**, if you move the application to a secondary screen, and later switch to using only the primary screen, the GUI will open off-screen. The remedy is to delete the `preferences.json` file created by the application before running the application again.
31 changes: 31 additions & 0 deletions docs/diagrams/HelpClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
!include style.puml
skinparam arrowThickness 1.1
skinparam arrowColor LOGIC_COLOR
skinparam classBackgroundColor LOGIC_COLOR

Package Logic as LogicPackage <<Rectangle>>{
Class "<<interface>>\nCommand" as Command
Class "<<interface>>\nParser" as Parser
Class "<<interface>>\nLogic" as Logic
Class LogicManager
Class HelpCommand
Class CommandResult

Logic -down-> Parser
Logic -down-> Command
Logic -right-> CommandResult
LogicManager .up.|> Logic
LogicManager -down-> Parser
LogicManager -down-> Command

HelpCommand .up.|> Command
HelpCommand -right-> CommandResult

Parser -[hidden]down-> HelpCommand
}

Class HiddenOutside #FFFFFF
HiddenOutside .down.> Logic

@enduml
66 changes: 66 additions & 0 deletions docs/diagrams/HelpSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant "h:HelpCommand" as HelpCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box UI UI_COLOR_T1
participant ":MainWindow" as MainWindow UI_COLOR
participant ":ResultDisplay" as ResultDisplay UI_COLOR
end box

[-> LogicManager : execute("help")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("help")
activate AddressBookParser

create HelpCommand
AddressBookParser -> HelpCommand
activate HelpCommand

HelpCommand --> AddressBookParser
deactivate HelpCommand

AddressBookParser --> LogicManager : h
deactivate AddressBookParser

LogicManager -> HelpCommand : execute()
activate HelpCommand

create CommandResult
HelpCommand -> CommandResult
activate CommandResult

CommandResult --> HelpCommand
deactivate CommandResult

HelpCommand --> LogicManager : r
deactivate HelpCommand

LogicManager -> MainWindow : executeCommand("help")
activate MainWindow

MainWindow -> MainWindow : handleHelp()
activate MainWindow

MainWindow -> ResultDisplay : setFeedbackToUser(HelpCommand.SHOWING_HELP_MESSAGE)
activate ResultDisplay

ResultDisplay --> MainWindow
deactivate ResultDisplay

MainWindow --> MainWindow
deactivate MainWindow

MainWindow --> LogicManager : r
deactivate MainWindow

[<--LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/HelpClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/HelpSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c97943

Please sign in to comment.