diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 39cd39c7f30..75bdc7a3503 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -13,7 +13,7 @@
## **Acknowledgements**
-
+This application is based off of the AddressBook Level-3 by SE-EDU.
--------------------------------------------------------------------------------------------------------------------
@@ -222,7 +222,7 @@ Step 4. The user now decides that adding the person was a mistake, and decides t
-**Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook modelState, then there are no previous AddressBook states to restore. The call to `Model#rollBackState()` will throw a checked exception, which will be caught and return an error to the user rather than attempting to perform the undo.
+**Note:** If the `currentStateIdx` is at index 0, pointing to the initial AddressBook modelState, then there are no previous AddressBook states to restore. The call to `Model#rollBackState()` will throw a checked exception, which will be caught and return an error to the user rather than attempting to perform the undo.
@@ -264,10 +264,30 @@ The following activity diagram summarizes what happens when a user executes a ne
**Aspect: How undo & redo executes:**
-* Saves the entire address book, filtered list and predicate.
+* Saves the entire address book, calendar, and predicate.
* Pros: Easy to implement, and captures all aspects of the application in the state
* Cons: May have performance issues in terms of memory usage.
+* Saves only the changes made when a command is executed.
+ * Pros: Utilises a lot less space and is thus makes the application more performative
+ * Cons: Much more difficult to implement and is less scalable as more commands and features are added
+
+**Aspect: Which commands are reversible:**
+
+* Currently, the following commands are reversible:
+ * AddCommand
+ * ClearCommand
+ * DeleteCommand
+ * DisplayCommand
+ * FindCommand
+ * ListCommand
+ * ScheduleAddCommand
+ * ScheduleDeleteCommand
+ * UpdateCommand
+
+
+
+
--------------------------------------------------------------------------------------------------------------------
## **Documentation, logging, testing, configuration, dev-ops**
@@ -317,13 +337,13 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
| `*` | social worker with colleagues | switch between profiles | manage my own set of clients on the same machine |
| `*` | social worker | undo and redo my commands | easily rectify a mistaken command |
-*{More to be added}*
+
### Use cases
(For all use cases below, the **System** is `ConnectCare` and the **Actor** is the `user`, unless specified otherwise)
-**Use case: Add a client**
+#### Use case: Add a client
**MSS**
@@ -340,7 +360,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Update client details**
+#### Use case: Update client details
**MSS**
@@ -363,7 +383,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Delete a person**
+#### Use case: Delete a person
**MSS**
@@ -386,7 +406,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case resumes at step 2.
-**Use case: Find client**
+#### Use case: Find client
**MSS**
@@ -403,7 +423,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Clear all clients**
+
+#### Use case: Clear all clients
**MSS**
@@ -428,7 +449,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Schedule an event**
+
+#### Use case: Schedule an event
**MSS**
@@ -445,7 +467,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Delete an event**
+#### Use case: Delete an event
**MSS**
@@ -462,7 +484,79 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
Use case ends.
-**Use case: Exit the application**
+
+#### Use case: Undo a command
+
+**MSS**
+
+1. User requests to undo a command
+2. ConnectCare undoes the command
+3. ConnectCare restores the application to the previous state
+
+ Use case ends.
+
+**Extensions**
+
+* 1a. There are no more commands to undo
+
+ * 1a1. ConnectCare shows an error message.
+
+ Use case ends.
+
+#### Use case: Redo a command
+
+**MSS**
+
+1. User requests to redo a command
+2. ConnectCare redoes the command
+3. ConnectCare restores the application to the desired state
+
+ Use case ends.
+
+**Extensions**
+
+* 1a. There are no more commands to redo
+
+ * 1a1. ConnectCare shows an error message.
+
+ Use case ends.
+
+#### Use case: Shortcut (Up-Arrow Key) Display previous command
+
+**MSS**
+
+1. User requests to display a previous command
+2. ConnectCare displays the command
+
+ Use case ends.
+
+**Extensions**
+
+* 1a. There are no more commands to display
+
+ * 1a1. ConnectCare shows an error message.
+
+ Use case ends.
+
+#### Use case: Shortcut (Down-Arrow Key) Display next command
+
+**MSS**
+
+1. User requests to display next command
+2. ConnectCare displays the command
+
+ Use case ends.
+
+**Extensions**
+
+* 1a. There are no more commands to display
+
+ * 1a1. ConnectCare shows an error message.
+
+ Use case ends.
+
+
+#### Use case: Exit the application
**MSS**
@@ -480,14 +574,14 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli
5. The user interface should be intuitive and easy to navigate, requiring minimal training for social workers to use effectively.
6. The system should work without access to the internet.
-*{More to be added}*
-
### Glossary
* **Mainstream OS**: Windows, Linux, Unix, MacOS
* **Private contact detail**: A contact detail that is not meant to be shared with others
* **Command Line Interface (CLI)**: A CLI is a text-based interface used to run programs, manage computer file sand interact with the computer
* **Main Success Scenario (MSS)**: The primary sequence of steps in a use case that describes the ideal path of interaction between a user and the system without encountering any errors
+* **Clients**: People that social workers who are using this application want to keep contact of
+*
--------------------------------------------------------------------------------------------------------------------
## **Appendix: Instructions for manual testing**
@@ -514,7 +608,6 @@ testers are expected to do more *exploratory* testing.
1. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
-1. _{ more test cases … }_
### Deleting a person
@@ -531,15 +624,76 @@ testers are expected to do more *exploratory* testing.
1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
Expected: Similar to previous.
-1. _{ more test cases … }_
+
+### Undoing a command
+
+1. Undoing a command when no commands have been entered
+
+ 1. Prerequisites: No commands have been entered and the application has just been initialised.
+
+ 2. Test case: `undo`
+ Expected: No changes to person or event lists. Error shown in the result display. No more history to rollback.
+
+2. Undoing a command when no reversible commands have been entered
+
+ 1. Prerequisites: No reversible commands have been entered. For a full list of reversible commands see the [implementation section for undo](#undoredo-feature)
+
+ 2. Test case: `undo`
+ Expected: No changes to person or event lists. Error shown in the result display. No more history to rollback.
+
+
+3. Undoing a command when reversible commands have been entered
+
+ 1. Prerequisites: Reversible commands have been entered. For a full list of reversible commands see the [implementation section for undo](#undoredo-feature)
+
+ 2. Test case: `undo` while there are commands to revert
+ Expected: Application reverts back to the state before the reversible commands are executes. Success message shown on result display. This continues until there are no more commands to revert.
+
+ 3. Test case: `undo` when there are no commands to revert (start state)
+ Expected: Application has been reverted back to the start state. Error shown in the result display. No more history to rollback.
+
+
+### Redoing a command
+
+1. Redoing a command when no commands have been entered
+
+ 1. Prerequisites: No commands have been entered and the application has just been initialised.
+
+ 2. Test case: `redo`
+ Expected: No changes to person or event lists. Error shown in the result display. No more history to roll forward.
+
+
+2. Redoing a command when reversible commands have been entered
+
+ 1. Prerequisites: Reversible commands have been entered. For a full list of reversible commands see the [implementation section for undo](#undoredo-feature)
+
+ 2. Test case: `undo` while there are commands to revert and then `redo`
+ Expected: Application reverts back to the desired state before the `undo`. Success message shown on result display.
+
+ 3. Test case: `redo` when there are no "`undo`" commands to revert
+ Expected: Application remains in current state. Error shown in the result display. No more history to forward.
+
+ 4. Test case: `undo` while there are commands to revert and then execute a command (that is not `redo`). Next execute `redo`
+ Expected: Application remains in current state. Error shown in the result display. No more history to roll forward. This is due to the states being truncated.
+
### Saving data
-1. Dealing with missing/corrupted data files
+1. Dealing with missing/corrupted data files on start-up
+
+ 1. Test case: Edit the `addressbook.json` and add or remove fields or add special characters that are not allowed.
+ Expected: The application will initialise but with an empty persons list instead. Logger will log a warning
+
+ 2. Test case: Edit the `calendar.json` and add or remove fields or add special characters that are not allowed.
+ Expected: The application will initialise but with an empty events list instead. Logger will log a warning.
+
+2. Dealing with missing/corrupted data files while application is running
- 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_
+ 1. Test case: Edit the `addressbook.json` and add or remove fields or add special characters that are not allowed.
+ Expected: The application will overwrite the changes made with the correct details, and will continue as per normal
-1. _{ more test cases … }_
+ 2. Test case: Edit the `calendar.json` and add or remove fields or add special characters that are not allowed.
+ Expected: The application will overwrite the changes made with the correct details, and will continue as per normal
### Planned Enhancements
diff --git a/src/main/java/seedu/address/logic/commands/DisplayCommand.java b/src/main/java/seedu/address/logic/commands/DisplayCommand.java
index 98f546c491e..560b0b895aa 100644
--- a/src/main/java/seedu/address/logic/commands/DisplayCommand.java
+++ b/src/main/java/seedu/address/logic/commands/DisplayCommand.java
@@ -26,6 +26,9 @@ public class DisplayCommand extends Command {
private final NameContainsKeywordsPredicate predicate;
+ /**
+ * @param predicate The predicate for the finding the correct client to display
+ */
public DisplayCommand(NameContainsKeywordsPredicate predicate) {
this.predicate = predicate;
}
diff --git a/src/main/java/seedu/address/ui/EventCard.java b/src/main/java/seedu/address/ui/EventCard.java
index eba83644b37..4882471de46 100644
--- a/src/main/java/seedu/address/ui/EventCard.java
+++ b/src/main/java/seedu/address/ui/EventCard.java
@@ -7,20 +7,12 @@
import seedu.address.model.event.Event;
/**
- * An UI component that displays information of a {@code Person}.
+ * A UI component that displays information of a {@code Event}.
*/
public class EventCard extends UiPart {
private static final String FXML = "EventListCard.fxml";
- /**
- * Note: Certain keywords such as "location" and "resources" are reserved keywords in JavaFX.
- * As a consequence, UI elements' variable names cannot be set to such keywords
- * or an exception will be thrown by JavaFX during runtime.
- *
- * @see The issue on AddressBook level 4
- */
-
public final Event event;
@FXML
@@ -35,7 +27,7 @@ public class EventCard extends UiPart {
private Label description;
/**
- * Creates a {@code PersonCode} with the given {@code Person} and index to display.
+ * Creates a {@code EventCard} with the given {@code Event}.
*/
public EventCard(Event event) {
super(FXML);
diff --git a/src/main/java/seedu/address/ui/EventListPanel.java b/src/main/java/seedu/address/ui/EventListPanel.java
index 5f3c82f5492..3115bb47324 100644
--- a/src/main/java/seedu/address/ui/EventListPanel.java
+++ b/src/main/java/seedu/address/ui/EventListPanel.java
@@ -11,7 +11,7 @@
import seedu.address.model.event.Event;
/**
- * Panel containing the list of persons.
+ * Panel containing the list of events.
*/
public class EventListPanel extends UiPart {
private static final String FXML = "EventListPanel.fxml";
@@ -21,7 +21,7 @@ public class EventListPanel extends UiPart {
private ListView eventListView;
/**
- * Creates a {@code PersonListPanel} with the given {@code ObservableList}.
+ * Creates a {@code EventsListPanel} with the given {@code ObservableList}.
*/
public EventListPanel(ObservableList eventList) {
super(FXML);
@@ -30,7 +30,7 @@ public EventListPanel(ObservableList eventList) {
}
/**
- * Custom {@code ListCell} that displays the graphics of a {@code Person} using a {@code PersonCard}.
+ * Custom {@code EventListViewCell} that displays the graphics of a {@code Event} using a {@code EventCard}.
*/
class EventListViewCell extends ListCell {
@Override