Skip to content

Commit

Permalink
Merge pull request #216 from pjanthony2001/106-ug-ped
Browse files Browse the repository at this point in the history
Update DG
  • Loading branch information
Jolonauh authored Apr 15, 2024
2 parents afd9734 + 9bde3de commit eefdba4
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 32 deletions.
192 changes: 173 additions & 19 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## **Acknowledgements**


This application is based off of the AddressBook Level-3 by SE-EDU.

--------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -222,7 +222,7 @@ Step 4. The user now decides that adding the person was a mistake, and decides t

<box type="info" seamless>

**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.

</box>

Expand Down Expand Up @@ -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**
Expand Down Expand Up @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**

Expand All @@ -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**
Expand All @@ -514,7 +608,6 @@ testers are expected to do more *exploratory* testing.
1. Re-launch the app by double-clicking the jar file.<br>
Expected: The most recent window size and location is retained.

1. _{ more test cases …​ }_

### Deleting a person

Expand All @@ -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)<br>
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` <br>
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` <br>
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 <br>
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) <br>
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` <br>
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` <br>
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 <br>
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` <br>
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. <br>
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. <br>
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. <br>
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. <br>
Expected: The application will overwrite the changes made with the correct details, and will continue as per normal

### Planned Enhancements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/seedu/address/ui/EventCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Region> {

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 <a href="https://github.com/se-edu/addressbook-level4/issues/336">The issue on AddressBook level 4</a>
*/

public final Event event;

@FXML
Expand All @@ -35,7 +27,7 @@ public class EventCard extends UiPart<Region> {
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);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/ui/EventListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Region> {
private static final String FXML = "EventListPanel.fxml";
Expand All @@ -21,7 +21,7 @@ public class EventListPanel extends UiPart<Region> {
private ListView<Event> eventListView;

/**
* Creates a {@code PersonListPanel} with the given {@code ObservableList}.
* Creates a {@code EventsListPanel} with the given {@code ObservableList}.
*/
public EventListPanel(ObservableList<Event> eventList) {
super(FXML);
Expand All @@ -30,7 +30,7 @@ public EventListPanel(ObservableList<Event> 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<Event> {
@Override
Expand Down

0 comments on commit eefdba4

Please sign in to comment.