Skip to content

Commit

Permalink
Merge pull request #131 from KrashKart/branch-edit-UG-again
Browse files Browse the repository at this point in the history
Add undo command to UG and DG UML
  • Loading branch information
chrisjohntan authored Oct 22, 2024
2 parents ca486c8 + 8c49d4a commit cef3369
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 8 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ Examples:
Disallowed examples:
* `deletetag 2 t/classmate t/neighbour` will not succeed as it tries to delete 2 tags at once.

### Undo a command : `undo`

Undoes the previous command and reverts CampusConnect.

Format: `undo`

* Reverts the state of CampusConnect to the one before the most recent command, if any.

### Clearing all entries : `clear`

Clears all entries from the address book.
Expand Down
11 changes: 9 additions & 2 deletions docs/diagrams/CommandClasses.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package "Command Classes" as CommandClasses {
Class "AddCommand" as AC
Class "ClearCommand" as CC
Class "DeleteCommand" as DC
Class "DeleteTagCommand" as DTC
Class "EditCommand" as EdC
Class "ExitCommand" as ExC
Class "FindByEmailCommand" as FEC
Expand All @@ -21,7 +22,7 @@ package "Command Classes" as CommandClasses {
Class "FindByPhoneCommand" as FPC
Class "HelpCommand" as HC
Class "ListCommand" as LC
Class "DeleteTagCommand" as DTC
Class "UndoCommand" as UC
}
}
HiddenOutside ..> Command
Expand All @@ -43,9 +44,11 @@ FEC -[hidden]u- CC

DC -u-|> Command
DC -[hidden]right- EdC
DTC -u-|> Command
FEC -[hidden]u- DC

DTC -u-|> Command
FEC -[hidden]u- DTC

EdC -u-|> Command
EdC -[hidden]right- ExC
FEC -[hidden]u- EdC
Expand All @@ -59,5 +62,9 @@ HC -[hidden]right- LC
FEC -[hidden]u- HC

LC -u-|> Command
LC -[hidden]right UC
FEC -[hidden]u- LC

UC -u-|> Command
FEC -[hidden]u- UC
@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ public Command parseCommand(String userInput) throws ParseException {

case HelpCommand.COMMAND_WORD:
return new HelpCommand();

case DeleteTagCommand.COMMAND_WORD:
return new DeleteTagCommandParser().parse(arguments);

case UndoCommand.COMMAND_WORD:
return new UndoCommand();

default:
logger.finer("This user input caused a ParseException: " + userInput);
throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
Expand Down

0 comments on commit cef3369

Please sign in to comment.