forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #181 from zekone/add-tag-DG
Add tag feature to DG
- Loading branch information
Showing
5 changed files
with
194 additions
and
11 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 |
---|---|---|
|
@@ -160,10 +160,10 @@ Unsuccessful output: | |
* Contact already exists: `This contact already exists in the contact list` | ||
* Invalid format<br> | ||
``` | ||
Invalid command format! | ||
add contact: Adds a contact to the contact list. | ||
Invalid command format! | ||
add contact: Adds a contact to the contact list. | ||
Usage: add contact -n NAME -p PHONE -e EMAIL -a ADDRESS [-t TAGNAME...] | ||
Example: add contact -n John Doe -p 98765432 -e [email protected] -a 311, Clementi Ave 2, #02-25 -t frontend | ||
Example: add contact -n John Doe -p 98765432 -e [email protected] -a 311, Clementi Ave 2, #02-25 -t frontend | ||
``` | ||
* Invalid email:<br> | ||
``` | ||
|
@@ -194,7 +194,7 @@ Unsuccessful output: | |
* Invalid index (out of range): `The person index provided is invalid` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
delete contact: Deletes a contact by its index number used in the displayed contact list. | ||
Parameters: INDEX (must be a positive integer) | ||
Example: delete contact 1 | ||
|
@@ -232,7 +232,7 @@ Unsuccessful output: | |
* Invalid index (out of range): `Can not find the target contact with ID: 100` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
add tag: Adds tags to a contact from the contact list. | ||
Usage: add tag -id CONTACT_ID -t TAGNAME... | ||
``` | ||
|
@@ -256,7 +256,7 @@ Unsuccessful output: | |
* Invalid index (out of range): `Can not find the target contact with ID: 100` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
delete tag: Delete one or more tags from a contact. | ||
Usage: delete tag -id CONTACT_ID -t TAGNAME... | ||
``` | ||
|
@@ -278,7 +278,7 @@ Unsuccessful output: | |
* Invalid index (out of range): `Can not find the target contact with ID: 100` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
add note: Adds a note to a contact from the contact list. | ||
Usage: add note -id CONTACT_ID -tit NOTE_TITLE -con NOTE_CONTENT | ||
``` | ||
|
@@ -302,7 +302,7 @@ Unsuccessful output: | |
* Invalid note index: `Note not found: ID = 5` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
delete note: Deletes a note from a contact. | ||
Usage: delete note -id CONTACT_ID -nid NOTE_ID | ||
``` | ||
|
@@ -333,7 +333,7 @@ Successful output: | |
Unsuccessful ouput: | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
list events: Shows a list of all events or events within a specified time interval. | ||
Usage: list events [-descending] [-st filter_start_time] [-et filter_end_time] (-st and -et must either both present or both not present) | ||
``` | ||
|
@@ -360,7 +360,7 @@ Unsuccessful output: | |
* Invalid time format: `Invalid date-time format! Text '29/05/2024' could not be parsed at index 2` | ||
* Invalid command format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
add event: Adds an event to a contact. | ||
Usage: add event -id CONTACT_ID -en EVENT_NAME -st START_TIME [-et END_TIME] [-loc LOCATION] [-info INFORMATION] | ||
``` | ||
|
@@ -385,7 +385,7 @@ Unsuccessful output: | |
* Invalid note index: `Event not found: ID = 5` | ||
* Invalid format:<br> | ||
``` | ||
Invalid command format! | ||
Invalid command format! | ||
delete event: Deletes an event from a contact. | ||
Usage: delete event -id CONTACT_ID -eid EVENT_ID | ||
``` | ||
|
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,20 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes add tag command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([person exists]) | ||
:Add new tags to person; | ||
:Model updates the person in the address book; | ||
:Returns result message notifying | ||
that the tags have been added; | ||
else ([else]) | ||
:Throw CommandException; | ||
endif | ||
stop | ||
@enduml |
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,22 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
start | ||
:User executes delete tag command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([person exists]) | ||
:Separate tags that exists in the tag list | ||
from those that do not; | ||
:Delete only those that exists in the tag list; | ||
:Model updates the person in the address book; | ||
:Returns result message with a list of tags that have | ||
been deleted and a list of tags that cannot be found; | ||
else ([else]) | ||
:Throw CommandException; | ||
endif | ||
stop | ||
@enduml |
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,69 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR | ||
participant ":AddTagCommandParser" as AddTagCommandParser LOGIC_COLOR | ||
participant ":AddTagCommand" as AddTagCommand LOGIC_COLOR | ||
participant "commandResult:CommandResult" as CommandResult LOGIC_COLOR | ||
|
||
[-> LogicManager : execute(commandText) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(commandText) | ||
activate AddressBookParser | ||
|
||
create AddCommandParser | ||
AddressBookParser -> AddCommandParser | ||
activate AddCommandParser | ||
|
||
AddCommandParser --> AddressBookParser | ||
deactivate AddCommandParser | ||
|
||
AddressBookParser -> AddCommandParser : parse(commandText) | ||
activate AddCommandParser | ||
|
||
create AddTagCommandParser | ||
AddCommandParser -> AddTagCommandParser : parse(commandText) | ||
activate AddTagCommandParser | ||
|
||
create AddTagCommand | ||
AddTagCommandParser -> AddTagCommand | ||
activate AddTagCommand | ||
|
||
AddTagCommand --> AddTagCommandParser | ||
deactivate AddTagCommand | ||
|
||
AddTagCommandParser --> AddCommandParser | ||
deactivate AddTagCommandParser | ||
AddTagCommandParser -[hidden]-> AddCommandParser | ||
destroy AddTagCommandParser | ||
|
||
AddCommandParser --> AddressBookParser | ||
deactivate AddCommandParser | ||
AddCommandParser -[hidden]-> AddressBookParser | ||
destroy AddCommandParser | ||
|
||
AddressBookParser --> LogicManager | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddTagCommand : execute() | ||
activate AddTagCommand | ||
|
||
create CommandResult | ||
AddTagCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddTagCommand : commandResult | ||
deactivate CommandResult | ||
|
||
AddTagCommand --> LogicManager : commandResult | ||
deactivate AddTagCommand | ||
AddTagCommand -[hidden]-> LogicManager | ||
destroy AddTagCommand | ||
|
||
[<--LogicManager : commandResult | ||
deactivate LogicManager | ||
@enduml |