forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2103-AY2324S1#100 from yuxunn/UG
Update UG and DG with View Command and UI Class Diagram
- Loading branch information
Showing
9 changed files
with
131 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,18 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa | |
|
||
This section describes some noteworthy details on how certain features are implemented. | ||
|
||
### View Specific Person feature | ||
Step 1: The user launches the application for the first time. The `SampleAddressBook` will be initialised. | ||
|
||
Step 2: The user executes `addclient n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01` to add a new Client. | ||
|
||
Step 3: The user executes a `view 1` command to view the 1st person in the address book. The user’s command is parsed by `ViewCommandParser` which extracts the target index. The `ViewCommand` class is instantiated with the extracted index. `ViewCommand` class interacts with `Model#FilteredPersonList` to verify the validity of the index and retrieve the corresponding person’s details. The command execution would be encapsulated as a `CommandResult` object that is then returned back from `Logic`. | ||
|
||
**Note:** If the index given is more than the size of the list or when the index given is 0, `ViewCommand` will not call `Model#view(Person personToView)`. Instead, a `MESSAGE_INVALID_PERSON_DISPLAYED_INDEX` exception will be thrown. The Main Window display continue displaying the `PersonListPanel` UI instead of the `ViewWindow` UI | ||
|
||
The following sequence diagram shows how the View Command works: | ||
<img src="diagrams/ViewSequenceDiagram.png" alt= "ViewSequenceDiagram"/> | ||
|
||
### \[Proposed\] Undo/redo feature | ||
|
||
#### Proposed Implementation | ||
|
@@ -605,6 +617,19 @@ testers are expected to do more *exploratory* testing. | |
|
||
1. _{ more test cases … }_ | ||
|
||
### Viewing a person | ||
|
||
1. Viewing a person while all persons are being shown | ||
|
||
1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. | ||
|
||
1. Test case: `view 0`<br> | ||
Expected: Entire list remains displayed. Error details shown in status message. Status bar remains the same. | ||
1. Other incorrect view commands to try: `view`, `view x` (where x is larger than the list size, or x is a negative index)<br> | ||
Expected: Similar to previous. | ||
1. Test case: `view 1`, `view x` (where x is an integer within the size of the list) <br> | ||
Expected: The full details of the first person is displayed. Success message: `Viewed Person Successfully` | ||
|
||
### Saving data | ||
|
||
1. Dealing with missing/corrupted data files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ Here are some descriptions of the words we use throughout the User Guide: | |
- Precise expected outputs when the command fails: | ||
|
||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
addlead: Adds a lead to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS [t/TAG]... | ||
Example: addlead n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/classmate | ||
``` | ||
|
@@ -99,7 +99,7 @@ Example: addlead n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2 | |
- Precise expected outputs when the command fails: | ||
|
||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
addclient: Adds a client to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS [t/TAG]... | ||
Example: addclient n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/classmate | ||
``` | ||
|
@@ -110,7 +110,7 @@ Example: addclient n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave | |
- Command: `listclient`. | ||
- Precise expected outputs when the command succeeds: | ||
|
||
In output section of the | ||
In output section of the | ||
`List of all clients` | ||
|
||
<h4>Examples of usage:</h4> | ||
|
@@ -139,6 +139,33 @@ In output section of the | |
<p>After using listlead command</p> | ||
</div> | ||
|
||
### View Specific Person | ||
|
||
- What it does: View a specific person that you have stored, including their basic information and another relevant lead/client | ||
details. | ||
- Command: `view INDEX`. | ||
- Example usage: `view 1`. | ||
- Acceptable values for `INDEX` parameter: | ||
- Must be an integer from `1` to the last index of the main list. | ||
- Precise expected output when the command succeeds: | ||
|
||
`Viewed Person Successfully` | ||
|
||
- Precise expected output when command fails: | ||
|
||
`The person index provided is invalid` | ||
|
||
<h4>Example usage:<h4> | ||
|
||
<div align="center"> | ||
<img src="./images/ViewExample.png" width="500" /> | ||
<p>After using View Command on a Lead</p> | ||
</div> | ||
|
||
<div align="center"> | ||
<img src="./images/ViewExampleClient.png" width = "500"/> | ||
<p>After using View Command on a Client</p> | ||
</div> | ||
|
||
### Delete [Coming soon] | ||
|
||
|
@@ -154,7 +181,7 @@ In output section of the | |
- Precise expected outputs when the command fails: | ||
|
||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
delete: Deletes the person identified by the index number used in the displayed person list. | ||
Parameters: INDEX (must be a positive integer) | ||
``` | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
@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 ":ViewCommandParser" as ViewCommandParser LOGIC_COLOR | ||
participant "d:ViewCommand" as ViewCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("view 1") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("view 1") | ||
activate AddressBookParser | ||
|
||
create ViewCommandParser | ||
AddressBookParser -> ViewCommandParser | ||
activate ViewCommandParser | ||
|
||
ViewCommandParser --> AddressBookParser | ||
deactivate ViewCommandParser | ||
|
||
AddressBookParser -> ViewCommandParser : parse("1") | ||
activate ViewCommandParser | ||
|
||
create ViewCommand | ||
ViewCommandParser -> ViewCommand | ||
activate ViewCommand | ||
|
||
ViewCommand --> ViewCommandParser : v | ||
deactivate ViewCommand | ||
|
||
ViewCommandParser --> AddressBookParser : v | ||
deactivate ViewCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
ViewCommandParser -[hidden]-> AddressBookParser | ||
destroy ViewCommandParser | ||
|
||
AddressBookParser --> LogicManager : v | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> ViewCommand : execute() | ||
activate ViewCommand | ||
|
||
ViewCommand -> Model : view(person) | ||
activate Model | ||
|
||
Model --> ViewCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
ViewCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> ViewCommand | ||
deactivate CommandResult | ||
|
||
ViewCommand --> LogicManager : result | ||
deactivate ViewCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.