diff --git a/docs/_dg/implementations/GeneralFeatures.md b/docs/_dg/implementations/GeneralFeatures.md index c015faa46a2..0bf75263efa 100644 --- a/docs/_dg/implementations/GeneralFeatures.md +++ b/docs/_dg/implementations/GeneralFeatures.md @@ -5,25 +5,29 @@ -#### 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`). - +#### 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. - +![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. diff --git a/docs/diagrams/HelpActivityDiagram.puml b/docs/diagrams/HelpActivityDiagram.puml new file mode 100644 index 00000000000..9fb2c1a39f1 --- /dev/null +++ b/docs/diagrams/HelpActivityDiagram.puml @@ -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 diff --git a/docs/diagrams/HelpSequenceDiagram.puml b/docs/diagrams/HelpSequenceDiagram.puml new file mode 100644 index 00000000000..cbcd0ec0ef4 --- /dev/null +++ b/docs/diagrams/HelpSequenceDiagram.puml @@ -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 diff --git a/docs/images/HelpActivityDiagram.png b/docs/images/HelpActivityDiagram.png new file mode 100644 index 00000000000..52f79cbe848 Binary files /dev/null and b/docs/images/HelpActivityDiagram.png differ diff --git a/docs/images/HelpSequenceDiagram.png b/docs/images/HelpSequenceDiagram.png new file mode 100644 index 00000000000..961478882c6 Binary files /dev/null and b/docs/images/HelpSequenceDiagram.png differ diff --git a/docs/team/yixiann.md b/docs/team/yixiann.md index 6b99efdee14..adc9cbe1548 100644 --- a/docs/team/yixiann.md +++ b/docs/team/yixiann.md @@ -10,13 +10,6 @@ title: Tan Yi Xian's Project Portfolio Page {{ 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 @@ -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) @@ -71,10 +64,10 @@ 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. @@ -82,7 +75,7 @@ Given below are my contributions to the project. * **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)