Skip to content

Commit

Permalink
Merge pull request #527 from yixiann/add-dg-help
Browse files Browse the repository at this point in the history
Add DG help command sequence diagram and activity diagram
  • Loading branch information
RichDom2185 authored Nov 7, 2022
2 parents b0b0c32 + ff280ac commit a7cbfae
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 25 deletions.
20 changes: 12 additions & 8 deletions docs/_dg/implementations/GeneralFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,29 @@
<!-- TODO: ADD GENERAL FEATURES CLASS DIAGRAM -->
<!-- NOTE: As this is for general features like Help, add/remove class diagrams as you see fit -->

#### General Design Considerations
The `Exit command` and `Reset command` do not contain complex implementations.

#### Displaying Help Dialogs
Exit command returns a `CommandResult` that returns `true` when calling the method `shouldExit()` on it.
The reset command functions like most other commands.
The `HelpCommand` is worth looking into, as it involves opening a separate window (`HelpWindow`).

<!-- TODO: ACTIVITY DIAGRAM -->
#### Displaying Help Dialogs

The `help` feature provides a user with instructions of how to use certain commands.
The `help` feature provides the user with instructions of how to use a specified command.

##### Feature Details

1. The user specifies a specific command that they need help with. This is done using the word needed to execute a particular command in FoodRem.
![HelpActivityDiagram](images/HelpActivityDiagram.png)

1. The user specifies a command that they need help with. This is done using the word needed to execute a particular command in FoodRem.
1. If this is not provided, a general help message will be shown.
1. The provided command is cross-referenced with all available commands in FoodRem. If the command that the user needs help with does not exist, an error would be thrown. This informs the user that the command does not exist. A general help is also shown to the user.
1. The help is shown in a new window that will open upon successful execution of the command.

<!-- TODO: SEQUENCE DIAGRM -->
![HelpSequenceDiagram](images/HelpSequenceDiagram.png)

In the above diagram, only methods relevant to showing the HelpWindow was shown. Other methods such as `setFeedbackToUser` and `isShowHelp` is not shown.

##### Feature Considerations

When the `HelpCommand` is executed we want users to receive help immediately instead of searching for it the User Guide.

Only methods relevant to showing the HelpWindow was shown. Other methods such as `setFeedbackToUser` and `isShowHelp` is not shown.
18 changes: 18 additions & 0 deletions docs/diagrams/HelpActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@startuml
!pragma useVerticalIf on
start
:User enters help command;
if () then ([Specified command not provided])
:Help window opens and shows
the general help message;
stop
else ( [Specified command provided])
if () then ([Specified command exist])
:Help window opens and shows help for
the command with the general help message;
stop
else ([Specified command does not exist])
:Help window opens and shows invalid command
message with the general help message;
stop
@enduml
110 changes: 110 additions & 0 deletions docs/diagrams/HelpSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
@startuml
!include style.puml

box Ui UI_COLOR_T1
participant ":MainWindow" as MainWindow UI_COLOR
participant ":HelpWindow" as HelpWindow UI_COLOR
end box

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":FoodRemParser" as FoodRemParser LOGIC_COLOR
participant ":HelpCommandParser" as HelpCommandParser LOGIC_COLOR
participant "t:HelpCommand" as HelpCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

[-> MainWindow : executeCommand("help new")
activate MainWindow
MainWindow -> LogicManager : execute("help new")

activate LogicManager

LogicManager -> FoodRemParser : parseCommand("help new")
activate FoodRemParser

create HelpCommandParser
FoodRemParser -> HelpCommandParser
activate HelpCommandParser

HelpCommandParser --> FoodRemParser
deactivate HelpCommandParser

FoodRemParser -> HelpCommandParser : parse("help new")
activate HelpCommandParser

create HelpCommand
HelpCommandParser -> HelpCommand
activate HelpCommand

HelpCommand --> HelpCommandParser :
deactivate HelpCommand

HelpCommandParser --> FoodRemParser :
deactivate HelpCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
HelpCommandParser -[hidden]-> FoodRemParser
destroy HelpCommandParser

FoodRemParser --> LogicManager :
deactivate FoodRemParser

LogicManager -> HelpCommand : execute(model)
activate HelpCommand

create CommandResult
HelpCommand -> CommandResult
activate CommandResult

CommandResult --> HelpCommand
deactivate CommandResult

HelpCommand --> LogicManager
deactivate HelpCommand

MainWindow <--LogicManager
deactivate LogicManager

MainWindow -[Hidden]-> HelpCommand
destroy HelpCommand

MainWindow --> HelpWindow : hide()
activate HelpWindow

HelpWindow --> MainWindow
deactivate HelpWindow

MainWindow --> CommandResult : getHelpText()
activate CommandResult

CommandResult --> MainWindow : helpText
deactivate CommandResult

MainWindow --> HelpWindow : setMessageToDisplay(helpText)
activate HelpWindow

HelpWindow --> MainWindow
deactivate HelpWindow

MainWindow --> MainWindow : handleHelpCommand()
activate MainWindow

MainWindow --> HelpWindow : isShowing()
activate HelpWindow

HelpWindow --> MainWindow
deactivate HelpWindow

MainWindow --> HelpWindow : show()
activate HelpWindow

HelpWindow --> MainWindow
deactivate HelpWindow

MainWindow --> MainWindow
deactivate MainWindow

[<--MainWindow
deactivate MainWindow

@enduml
Binary file added docs/images/HelpActivityDiagram.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.
27 changes: 10 additions & 17 deletions docs/team/yixiann.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ title: Tan Yi Xian's Project Portfolio Page
<!-- markdownlint-disable-next-line proper-names -->
{{ site.data.foodrem.about.summary }}

FoodRem is an inventory management system that empowers small food and beverage (F&B) restaurant managers to manage inventory and obtain insights from inventory data.

FoodRem stores information such as name, quantity, unit, bought date, expiry date, price, and remarks.
The two main functionalities of FoodRem are the inventory management system and inventory analysis.
The inventory management system uses an efficient tagging system where you can create, rename, and delete existing tags. We are also able to sort and filter items by different attributes.
The Inventory Analysis System tracks data that helps restaurants streamline their business decisions through statistics.

Given below are my contributions to the project.

* **Major Refactoring**: Refactor AB3 into FoodRem
Expand All @@ -35,31 +28,31 @@ Given below are my contributions to the project.
* A class has to be created for each of the following fields: name, quantity, unit, bought date, expiry date, price, and remarks.
* A validation class was created for each individual field to ensure easy extension.
* Commands such as the help, exit and reset, commands required minimal changes.
* Pull requests : [Refactoring Person to Item PR\#157](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/157))
* Pull requests : Refactoring Person to Item [[PR\#157]]

* **New Feature**: Added the ability to add a remark

* What it does: Allows the user to add a remark to an item.
* Justification: This feature improves the user's experience as they are now able to include notes specific to an item.
* Pull requests : [Add remarks fields and remarks command PR#254](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/254))
* Pull requests : Add remarks fields and remarks command [[PR#254]]

* **New Feature**: Add the user interface for tags
* What it does: Allows the user to view results of tag commands in a beautiful format rather than plain text.
* Justification: This feature standardises the UI of Items and Tags.
* The implementation was extended from the current UI of Items which was created by Richard Dominick.
* Pull requests : [Add UI for tags PR#340](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/340)
* Pull requests : Add UI for tags [[PR#340]]

* **Enhancements to the `help` command**:

* Enhanced `help` command to provide help for individual commands rather than a generic message.
* Enumeration of CommandWords was done.
* Pull requests : [Modify help command to provide help for each individual command PR#201](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/201))
* Pull requests : Modify help command to provide help for each individual command [[PR#201]]

* **Enhancements to the `inc` and `dec` command**:

* Enhanced `inc` command and `dec` command to have optional qty prefix.
* This was done to make it easier to increment and decrement the quantity of an item.
* Pull requests : [Modify increment and decrement command to have optional qty prefix PR#183](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/183))
* Pull requests : Modify increment and decrement command to have optional qty prefix [[PR#183]]

* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2223s1.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2022-09-16&tabOpen=true&tabType=authorship&tabAuthor=yixiann&tabRepo=AY2223S1-CS2103T-W16-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)

Expand All @@ -71,18 +64,18 @@ Given below are my contributions to the project.
* **Documentation**:

* User Guide:
* Add skeleton for the User Guide [PR#35](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/35)
* Add value preposition of FoodRem in the User Guide [PR#147](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/147)
* Update Quick Start of User Guide, and reorganise content page [PR#141](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/141)
* Add documentation for the `help` feature [PR#90](https://github.com/AY2223S1-CS2103T-W16-2/tp/pull/90)
* Add skeleton for the User Guide [[PR#35]]
* Add value preposition of FoodRem in the User Guide [[PR#147]]
* Update Quick Start of User Guide, and reorganise content page [[PR#141]]
* Add documentation for the `help` feature [[PR#90]]

* Developer Guide:
* Added about us section for the Developer Guide.

* **Community**:

* Reported bugs and suggestions for other teams in the class:
* Stats command do not calculate amount wasted by performing qty * price [Issue#449](https://github.com/AY2223S1-CS2103T-W16-2/tp/issues/449)
* Stats command do not calculate amount wasted by performing qty * price [[Issue#449]] (https://github.com/AY2223S1-CS2103T-W16-2/tp/issues/449)
* Stats command expiry date do not count items that expire today [Issue#448](https://github.com/AY2223S1-CS2103T-W16-2/tp/issues/448)
* Stats command fail on FoodRem having less than 3 items [Issue#447](https://github.com/AY2223S1-CS2103T-W16-2/tp/issues/447)
* Rename tag does not modify tags in items [Issue#293](https://github.com/AY2223S1-CS2103T-W16-2/tp/issues/293)
Expand Down

0 comments on commit a7cbfae

Please sign in to comment.