Skip to content

Commit

Permalink
Merge branch 'master' into branch-markUnmarkCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Incogdino authored Oct 24, 2024
2 parents 0d2a76a + 83670cd commit 3b7c7be
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Here's a (partial) class diagram of the `Logic` component:

<puml src="diagrams/LogicClassDiagram.puml" width="550"/>

The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example.
The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete n/John")` API call as an example.

<puml src="diagrams/DeleteSequenceDiagram.puml" alt="Interactions Inside the Logic Component for the `delete 1` Command" />

Expand Down
49 changes: 32 additions & 17 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ konTActs is a **desktop app for managing contacts, optimized for use via a Comma

* `add n/John Doe p/98765432 e/[email protected] a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book.

* `delete 3` : Deletes the 3rd contact shown in the current list.
* `delete n/John Doe` : Deletes the contact with name `John Doe` if it is shown in the current list.

* `clear` : Deletes all contacts.

Expand Down Expand Up @@ -196,7 +196,7 @@ Format: `view [n/NAME]`

Examples:
* `view n/JohnDoe` opens a window at the side showing the full details of the person named `JohnDoe`.
* Calling `view n/JohnDoe` followed by `view` closes the window showing the full contact details of `JohnDoe`.
* Calling `view n/JohnDoe` followed by `view` closes the window showing the full contact details of `JohnDoe`.

### Marking a student as present : `mark`

Expand Down Expand Up @@ -226,6 +226,20 @@ Examples:
* `unmarks n/John Doe w/1` unmarks the student named `JohnDoe` as present for week 1.
![result for unmark](images/unmarkViswa.png)

### Sorting the displayed lsit : `sort`

Sorts the displayed list based on the given field and order.

Format: `sort FIELD order/ORDER`

* Current FIELD that can be sorted by: `github`, `name`, `telegram`.
* Current ORDER that is accepted: `asc`, `desc`.
* The sort order will persist between commands.
* The sorting is case-insensitive: upper and lower case are treated as the same values.

Examples:
* `sort name order/asc` will sort the displayed list based on their name in ascending order.

### Clearing all entries : `clear`

Clears all entries from the address book.
Expand All @@ -246,7 +260,7 @@ AddressBook data are saved in the hard disk automatically after any command that

AddressBook data are saved automatically as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.

<box type="warning" seamless>
<box type="warning" seamless>

**Caution:**
If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.<br>
Expand Down Expand Up @@ -275,17 +289,18 @@ _Details coming soon ..._

## Command summary

| Action | Format, Examples |
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS telegram/TELEGRAM [t/TAG]…​ github/GITHUB` <br> e.g., `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 telegram/@James t/friend t/colleague github/james-cool` |
| **Clear** | `clear` |
| **Delete** | `delete n/NAME`<br> e.g., `delete n/James` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [telegram/TELEGRAM] [t/TAG]…​ [github/GITHUB]`<br> e.g.,`edit 2 n/James Lee e/[email protected]` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **Filter** | `filter t/[TAG] t/[MORE_TAG]…​`<br> e.g., `filter t/friends t/family` |
| **List** | `list` |
| **Help** | `help` |
| **View** | `view [n/NAME]` <br> e.g., `view n/JohnDoe` |
| **GitHub** | `github n/NAME` |
| **Mark** | `mark n/NAME w/WEEK NUMBER` <br> e.g. `mark n/John Doe w/1` |
| **Unmark** | `unmark n/NAME w/WEEK NUMBER` <br> e.g. `unmark n/John Doe w/1` |
| Action | Format, Examples |
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS telegram/TELEGRAM [t/TAG]…​ github/GITHUB` <br> e.g., `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 telegram/@James t/friend t/colleague github/james-cool` |
| **Clear** | `clear` |
| **Delete** | `delete n/NAME`<br> e.g., `delete n/James` |
| **Edit** | `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [telegram/TELEGRAM] [t/TAG]…​ [github/GITHUB]`<br> e.g.,`edit 2 n/James Lee e/[email protected]` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **Filter** | `filter t/[TAG] t/[MORE_TAG]…​`<br> e.g., `filter t/friends t/family` |
| **List** | `list` |
| **Help** | `help` |
| **View** | `view [n/NAME]` <br> e.g., `view n/JohnDoe` |
| **GitHub** | `github n/NAME` |
| **Mark** | `mark n/NAME w/WEEK NUMBER` <br> e.g. `mark n/John Doe w/1` |
| **Unmark** | `unmark n/NAME w/WEEK NUMBER` <br> e.g. `unmark n/John Doe w/1` |
| **Sort** | `sort FIELD order/ORDER` <br> e.g. `sort name order/asc` |
10 changes: 8 additions & 2 deletions docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ Participant ":Logic" as logic LOGIC_COLOR
Participant ":Model" as model MODEL_COLOR
Participant ":Storage" as storage STORAGE_COLOR

user -[USER_COLOR]> ui : "delete 1"
user -[USER_COLOR]> ui : "delete n/John"
activate ui UI_COLOR

ui -[UI_COLOR]> logic : execute("delete 1")
ui -[UI_COLOR]> logic : execute("delete n/John")
activate logic LOGIC_COLOR

logic -[LOGIC_COLOR]> model : getPerson(name)
activate model MODEL_COLOR

model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> model : deletePerson(p)
activate model MODEL_COLOR

Expand Down
14 changes: 10 additions & 4 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("delete 1")
[-> LogicManager : execute("delete n/John")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
LogicManager -> AddressBookParser : parseCommand("delete n/John")
activate AddressBookParser

create DeleteCommandParser
Expand All @@ -27,7 +27,7 @@ activate DeleteCommandParser
DeleteCommandParser --> AddressBookParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
AddressBookParser -> DeleteCommandParser : parse("John")
activate DeleteCommandParser

create DeleteCommand
Expand All @@ -49,7 +49,7 @@ deactivate AddressBookParser
LogicManager -> DeleteCommand : execute(m)
activate DeleteCommand

DeleteCommand -> Model : deletePerson(1)
DeleteCommand -> Model : deletePerson(person)
activate Model

Model --> DeleteCommand
Expand All @@ -61,9 +61,15 @@ activate CommandResult

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

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

[<--LogicManager
deactivate LogicManager
Expand Down

0 comments on commit 3b7c7be

Please sign in to comment.