diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 42e19fa2c44..ea352d0597b 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -195,9 +195,44 @@ This is to make sure at least one field is modified, or the command will not hav Call `model.updateFilteredPersonList())` with a `Predicate` that always evaluates to true: This is to refresh the list of `Person` in `Model`. +### Find feature + +#### How the feature is implemented + +The sequence diagram below explains how the find command `find Alex` goes through the `Logic` component. + +![Interactions Inside the Logic Component for the `find Alex` Command](images/FindSequenceDiagram.png) + +
:information_source: **Note:** The lifeline for `FindCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram. +
+ +1. When user types in `find Alex`, it is passed to `StaffConnectParser`. +2. `StaffconnectParser` then creates a `FindCommandParser` that will parse `Alex` to create a `FindCommand` which utilizes a predicate judge whether `Alex` is contained in the person's name. +3. In `FindCommand`, `Model` executes `updateFilteredPersonList()` method using the predicate mentioned above. +4. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`, to show in the `UI` component the number of persons listed with `Alex` in the name. + +The below sequence diagram goes into more detail on how the command is parsed in `EditCommandParser`. + +![Interactions Inside FindCommandParser for the `parse("f/Computing")` Command](images/FindSequenceDiagram-Parser.png) + +1. Within `FindCommandParser`, the command string is first trimmed and checked whether it is empty, then splitted into an string array by space characters. +2. `FindCommandParser` then constructs a predicate to test whether the names of `Person` contain any one of the strings in the array mentioned above. This predicate is passed as an argument for the constructor of `FindCommand`. + +The below activity diagram illustrates the process when a user executes a find command. + + + +#### Why find is implemented this way + +The main operation for the find feature is the `updateFilteredPersonList(Predicate predicate)` method in the `Model` component. +Below are some explanations for the special considerations in the implementation. + +`FindCommmandParser` parsing the `Predicate` objects: +This is to prevent `FindCommand` from taking on more responsibilities (Separation of Concerns). + ### Filter feature -#### How the filter is implemented +#### How the feature is implemented The sequence diagram below shows how the filter command `filter f/Computing` goes through the `Logic` component. @@ -236,9 +271,9 @@ This is to prevent `FilterCommand` from taking on more responsibilities (Separat `FilterCommand` having `setPersonPredicate()` method: This is so that `FilterCommand` has the required argument of type `Predicate` to be used in the `updateFilteredPersonList()` method. Since the `Predicate` object is created by chaining the multiple predicates, no parsing is involved to create this `Predicate`. -### Sort Feature +### Sort feature -##### Implementation +##### How the feature is implemented The sort mechanism is facilitated by JavaFX's `SortedList` within ModelManager, `SortCommand` and `SortCommandParser`. `SortCommandParser` extends the types of command parsers in StaffBookParser, and returns a `SortCommand` to be executed by the LogicManager. This execution also updates the `SortedList` in Model via ModelManager. Additionally, it implements the following operations: @@ -247,13 +282,13 @@ The sort mechanism is facilitated by JavaFX's `SortedList` within ModelManager, Given below is an example usage scenario and how the sort mechanism behaves at each step. -Step 1. The user enters **“sort n/”** to sort the list by their name. +1. The user enters **“sort n/”** to sort the list by their name. -Step 2. The `LogicManager` takes this command text and calls `StaffBookParser.parseCommand("sort n/")` and identifies the sort command. It then creates a new instance of `SortCommandParser` to `parse(“n/”)` on the attribute. +2. The `LogicManager` takes this command text and calls `StaffBookParser.parseCommand("sort n/")` and identifies the sort command. It then creates a new instance of `SortCommandParser` to `parse(“n/”)` on the attribute. -Step 3. `SortCommandParser.parse(“n/”)` then constructs a SortCommand with the appropriate attribute comparator, `NameComparator`. +3. `SortCommandParser.parse(“n/”)` then constructs a SortCommand with the appropriate attribute comparator, `NameComparator`. -Step 4. The `SortCommand` is returned to Logic manager which calls on its `execute()` to return a `CommandResult()`. During its execution, `ModelManager.updateSortedPersonList(NameComparator)` is invoked which updates the model to show the list of persons being sorted by name. +4. The `SortCommand` is returned to Logic manager which calls on its `execute()` to return a `CommandResult()`. During its execution, `ModelManager.updateSortedPersonList(NameComparator)` is invoked which updates the model to show the list of persons being sorted by name. The sequence diagram for executing a **"sort n/"** is shown below: @@ -264,12 +299,26 @@ The following activity diagram summarizes what happens when a user executes a ne -#### Design considerations: -**Aspect: Determining order of sorting of an attribute:** +#### Why sort is implemented this way -* **Current Design:** Get order of sorting from user, prompting for an input in the form of toCompare. +The main operation for the sort feature is the `updateSortedPersonList(Comparator comparator)` method in the `Model` component. +The following are some explanations for decisions made in the implementation of the sort feature. + +Need for multiple `Comparator` objects: +This is to keep in view for when other commands or enhancements may need the separate attribute predicates. + +Need for `MultiComparator` object: +This is to map the 1 or more comparator objects and act as a layer of abstraction where `SortCommmand` does need to know how many attributes are used in sorting. + +`SortCommmandParser` parsing the `Comparator` objects: +This is to prevent `SortCommand` from taking on more responsibilities (Separation of Concerns). + +#### What designs were considered: +**Aspect: Determining order of sorting of attribute(s):** + +* **Current Design:** Get sorting order of attribute(s) from user input. * Pros: More functionality and more suited to the user's needs. - * Cons: Harder to implement and guide user to use, may have more leeway for error. User unlikely to use this advancement. + * Cons: Harder to implement and guide user to use, may have more leeway for error. * **Alternative 1:** Use a configured comparator for each attribute in ascending order. * Pros: Controlled and more simple for user. @@ -285,40 +334,52 @@ The following activity diagram summarizes what happens when a user executes a ne * Pros: Easy to implement, controlled and less likely to be used incorrectly. This increase ease of use for users. * Cons: Limited sorting and lesser functionality. -### Find feature +### Meeting feature + +Meeting is feature that allows the user to keep track of any events they may have with the particular contact. It contains the description of the meeting event with the date and time it would occur. #### How the feature is implemented -The sequence diagram below explains how the find command `find Alex` goes through the `Logic` component. +Meeting contains two attributes ```MeetingDescription``` and ```MeetingDateTime``` class. ```MeetingDescription``` +is used to handle any valid description of the meeting with only alphanumeric values, while the ```MeetingDateTime``` +is used to handle any valid date time values. Each of this meeting are stored in a list data class ```MeetingList``` that +contains each of the meetings related to each other stored in an ```ObservableList```. The ``` MeetingManager ``` is +used to manage any operations that require viewing or sorting of meetings from the ```MeetingList``` class. -![Interactions Inside the Logic Component for the `find Alex` Command](images/FindSequenceDiagram.png) +#### What designs were considered: -
:information_source: **Note:** The lifeline for `FindCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram. -
+**Aspect: How the meetings are stored :** -1. When user types in `find Alex`, it is passed to `StaffConnectParser`. -2. `StaffconnectParser` then creates a `FindCommandParser` that will parse `Alex` to create a `FindCommand` which utilizes a predicate judge whether `Alex` is contained in the person's name. -3. In `FindCommand`, `Model` executes `updateFilteredPersonList()` method using the predicate mentioned above. -4. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`, to show in the `UI` component the number of persons listed with `Alex` in the name. +* **Current Design:** Store meetings in an ObservableList. + * Pros: Better segregation of the OOP functionalities, and good integration with the UI ListView. + * Cons: Larger code complexity. -The below sequence diagram goes into more detail on how the command is parsed in `EditCommandParser`. +* **Alternative 1:** Store meetings in a Set. + * Pros: Easier implementation. + * Cons: There is an efficiency gap as each element has to be placed into a list before it can be shown to the UI ListView. -![Interactions Inside FindCommandParser for the `parse("f/Computing")` Command](images/FindSequenceDiagram-Parser.png) +### Fav/unfav feature -1. Within `FindCommandParser`, the command string is first trimmed and checked whether it is empty, then splitted into an string array by space characters. -2. `FindCommandParser` then constructs a predicate to test whether the names of `Person` contain any one of the strings in the array mentioned above. This predicate is passed as an argument for the constructor of `FindCommand`. +The feature enables us to sets/remove a particular contact using an index as favourite. -The below activity diagram illustrates the process when a user executes a find command. +#### How the feature is implemented - +The Fav/Unfav feature is implemented via the `FavCommand` and `UnfavCommand`, which is supported by the `FavCommandParser` and `UnfavCommandParser` respectively. +The `FavCommandParser` and `UnfavCommandParser` implements the `Parser` interface. -#### Why find is implemented this way +1. `LogicManager` receives the user input which is parsed by the `StaffConnectParser`. +2. After splitting the user input into `commandWord` and `arguments` based on the regex pattern of the user input, the `StaffConnectParser` invokes the `FavCommandParser`/`UnfavCommandParser` based on the `commandWord`, calling the method `parse` with `arguments` as the method arguments +3. `FavCommandParser`/`UnfavCommandParser` takes in the `args` string and parse it into with the static `ParserUtil#parseIndex(args)` function. If the `INDEX` format is invalid, a `ParseException` will be thrown. +4. `FavCommandParser`/`UnfavCommandParser` then creates the `FavCommand`/`UnfavCommand` and returns it. +5. The `LogicManager` executes the `FavCommand`/`UnfavCommand`, which creates a `Person` with the `Favourite` attribute set as `true`/`false` respectively and updates the model with this new `Person`. -The main operation for the find feature is the `updateFilteredPersonList(Predicate predicate)` method in the `Model` component. -Below are some explanations for the special considerations in the implementation. +The following sequence diagram shows how the `fav` command works: -`FindCommmandParser` parsing the `Predicate` objects: -This is to prevent `FindCommand` from taking on more responsibilities (Separation of Concerns). +![Fav Command Sequence Diagram](images/FavSequenceDiagram.png) + +Similarly, how the `unfav` command works is shown below: + +![Unfav Command Sequence Diagram](images/UnfavSequenceDiagram.png) ### \[Proposed\] Undo/redo feature @@ -402,60 +463,6 @@ The following activity diagram summarizes what happens when a user executes a ne * Pros: Will use less memory (e.g. for `delete`, just save the person being deleted). * Cons: We must ensure that the implementation of each individual command are correct. -_{more aspects and alternatives to be added}_ - -### \[Proposed\] Data archiving - -_{Explain here how the data archiving feature will be implemented}_ - - -### Meeting - -Meeting is feature that allows the user to keep track of any events they may have with the particular contact. It contains the description of the meeting event with the date and time it would occur. - -#### Implementation - -Meeting contains two attributes ```MeetingDescription``` and ```MeetingDateTime``` class. ```MeetingDescription``` -is used to handle any valid description of the meeting with only alphanumeric values, while the ```MeetingDateTime``` -is used to handle any valid date time values. Each of this meeting are stored in a list data class ```MeetingList``` that -contains each of the meetings related to each other stored in an ```ObservableList```. The ``` MeetingManager ``` is -used to manage any operations that require viewing or sorting of meetings from the ```MeetingList``` class. - -#### Design considerations: - -**Aspect: How the meetings are stored :** - -* **Alternative 1 (current choice):** Store meetings in an ObservableList. - * Pros: Better segregation of the OOP functionalities, and good integration with the UI ListView. - * Cons: Larger code complexity. - -* **Alternative 2:** Store meetings in a Set. - * Pros: Easier implementation. - * Cons: There is an efficiency gap as each element has to be placed into a list before it can be shown to the UI ListView. - -### Fav/unfav feature - -The feature enables us to sets/remove a particular contact using an index as favourite. - -#### Implementation - -The Fav/Unfav feature is implemented via the `FavCommand` and `UnfavCommand`, which is supported by the `FavCommandParser` and `UnfavCommandParser` respectively. -The `FavCommandParser` and `UnfavCommandParser` implements the `Parser` interface. - -1. `LogicManager` receives the user input which is parsed by the `StaffConnectParser`. -2. After splitting the user input into `commandWord` and `arguments` based on the regex pattern of the user input, the `StaffConnectParser` invokes the `FavCommandParser`/`UnfavCommandParser` based on the `commandWord`, calling the method `parse` with `arguments` as the method arguments -3. `FavCommandParser`/`UnfavCommandParser` takes in the `args` string and parse it into with the static `ParserUtil#parseIndex(args)` function. If the `INDEX` format is invalid, a `ParseException` will be thrown. -4. `FavCommandParser`/`UnfavCommandParser` then creates the `FavCommand`/`UnfavCommand` and returns it. -5. The `LogicManager` executes the `FavCommand`/`UnfavCommand`, which creates a `Person` with the `Favourite` attribute set as `true`/`false` respectively and updates the model with this new `Person`. - -The following sequence diagram shows how the `fav` command works: - -![Fav Command Sequence Diagram](images/FavSequenceDiagram.png) - -Similarly, how the `unfav` command works is shown below: - -![Unfav Command Sequence Diagram](images/UnfavSequenceDiagram.png) - -------------------------------------------------------------------------------------------------------------------- ## **Documentation, logging, testing, configuration, dev-ops** @@ -475,8 +482,8 @@ Similarly, how the `unfav` command works is shown below: **Target user profile**: Bob is a 22 year old NUS SOC student who often struggles with finding details about his professors' and tutors' consultation hours. -He prefers certain professors and tutors but often misplaces their contact information -as such information can be hard to find online. He also has difficulty identifying his professors and changing tutors. +He has difficulty identifying his professors and changing tutors, and prefers certain professors and tutors but often misplaces their contact information as such information can be hard to find online. +He also sometimes forgets that he has scheduled consultations with a professor or tutor, but this is not a big problem as he can always arrange for another consultation. **Value proposition**: @@ -489,19 +496,31 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli | Priority | As a …​ | I want to …​ | So that I can…​ | | -------- | ------------------------------------------ | ------------------------------ | ---------------------------------------------------------------------- | -| `* * *` | sociable user | save a contact's name, email, phone number, title in one line | save time per entry | -| `* * *` | disorganised student | store a professor's name | recall how to address the professor | -| `* * *` | forgetful user | store a professor's faculty | see the faculty that a professor belongs to | -| `* * *` | student who get lost easily | view the locations of my meetings/classes | search the locations for my meetings easily | -| `* * *` | disorganised student | store a professor's consultation hours | arrange times to meet my professor for consultation | -| `* * *` | slow reader | filter through contact entry by their name | not waste time in finding a specific contact/s and access their info easily | -| `* * *` | slow reader | filter through contact entry by their availability | not waste time in finding a specific contact/s and access their info easily | -| `* * *` | slow reader | filter through contact entry by their module | not waste time in finding a specific contact/s and access their info easily | -| `* * *` | disorganised student | store the modules a professor is teaching | contact the professors who teach a module which I am currently taking | -| `* * *` | slow reader | filter through contact entry by their module | not waste time in finding a specific contact/s and access their info easily | -| `* * *` | forgetful user | filter the professors by their faculty or the course they teach | not waste time in finding a specific contact/s and access their info easily | - -*{More to be added}* +| `* * *` | sociable user | save a professor's/tutor's name, phone number, faculty, consultation venue, module, email, tag(s) and availabilities in one line | save time when adding each professor/tutor | +| `* * *` | clumsy user | edit a professor's/tutor's name, phone number, faculty, consultation venue, module, email, tag(s) and availabilities in one line | save time when editing multiple attributes of a professor/tutor | +| `* * *` | disorganised student | store a professor's/tutor's name | recall how to address the professor/tutor | +| `* * *` | disorganised student | store the module a professor/tutor is teaching | contact the professor/tutor who teach a module which I am currently taking | +| `* * *` | forgetful user | store a professor's/tutor's faculty | see the faculty that a professor/tutor belongs to | +| `* * *` | student who get lost easily | view the consultation venues of my professors/tutors | search for their consultation venues easily | +| `* * *` | disorganised student | store a professor's/tutor's availabilities | schedule meetings to meet my professor/tutor for consultation | +| `* * *` | organised user | delete a staff book entry | remove outdated or redundant entries of professors/tutors that I will not contact anymore | +| `* * *` | slow reader | filter through staff book entries by their name | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | filter through staff book entries by their availability | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | filter through staff book entries by their module | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | filter through staff book entries by their faculty | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | filter through staff book entries by their tag | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | sort staff book entries by name | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | sort staff book entries by phone number | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | sort staff book entries module | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | sort staff book entries faculty | not waste time in finding a specific professor/tutor and access their information easily | +| `* * *` | slow reader | sort staff book entries' consultation venues | not waste time in finding a specific professor/tutor and access their information easily | +| `* *` | slow reader | sort staff book entries' meeting times | not waste time in finding a specific meeting and access their information easily | +| `* *` | time-conscious user | save a specific professor as "favourite" | have quick access to the professors/tutors I frequent the most for consultations | +| `* *` | time-conscious user | remove a specific professor as "favourite" | remove outdated professors/tutors that I do not frequent for consultations anymore | +| `* *` | easily-distracted user | record my scheduled meeting agenda and start time with professors/tutors | see which professor/tutor I have set up to meet with | +| `* *` | organised user | delete my scheduled meeting agenda and start time with professors/tutors | remove outdated or redundant entries of meetings that have passed or cancelled | +| `* *` | time-conscious user | clear my outdated meetings with professors/tutors | save time by removing outdated meetings with one command | +| `* *` | proficient typer | select a professor/tutor to see their contact details with a command | use the app with my more proficient method of typing instead of using other input devices (i.e. mouse) | ### Use cases @@ -602,29 +621,28 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli Use case resumes at step 1. -*{More to be added}* - ### Non-Functional Requirements -1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed. -2. Should be able to answer a user's prompt within 1 second. -3. Should require less computational resources to allow users with older hardware can use the app without trouble. -4. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage. -5. Should be able to provide error messages when a user does not type in expected prompts. -6. Should be able to store the users' information securely without leakage. -7. Should provide understandable and informative responses whenever a user provides a prompt. -8. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. -9. A user without much experience in admin commands should be able to handle the usage in rather short time. - -*{More to be added}* +1. The app should work on any _mainstream OS_ as long as it has Java `11` or above installed. +2. The app should be able to respond to a user's prompt within 2 seconds. +3. The app should not exceed using 1GB of RAM while it is operating. +4. The app should work on both 32-bit and 64-bit environments. +5. The app should be able to store up to 1000 persons without affecting the response time of 2 seconds. +6. The app should be able to store up to a total of 1000 meetings across all persons without affecting the response time of 2 seconds. +7. The app should only be able to read and write in the generated `[JAR file location]/data/staffconnect.json` file. +8. The app should be usable by a student who is familiar with CLI interfaces. +9. The app should be up-to-date with the latest NUS faculty names. +10. The data stored in the app should not change unless the user has modified the data through usage of the app with user-issued commands, or the `[JAR file location]/data/staffconnect.json` file has been modified with valid values. ### Glossary * **Mainstream OS**: Windows, Linux, Unix, MacOS, with versions that support Java 11 -* **Private contact detail**: A contact detail that is not meant to be shared with others -* **Users' Information**: Same as above +* **Person**: A professor or tutor (i.e. Teaching Assistant) +* **Attribute**: A useful piece of information belonging to a `Person`. e.g `Venue` is the consultation venue to consult a `Person` +* **Staff Book**: Name for the list containing `Person` objects +* **Contacts' Information**: All `Persons` in the staff book * **Error Message**: A prompt printed to the user that the program execution cannot run normally and specifies the most possible cause -* **MSS**: Main Success Scenario +* **MSS**: Main Success Scenario, a sequence of steps to reach the end of a use case -------------------------------------------------------------------------------------------------------------------- @@ -652,8 +670,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 1. Deleting a person while all persons are being shown @@ -669,12 +685,31 @@ 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 …​ }_ - ### Saving data 1. Dealing with missing/corrupted data files - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ + 1. Prerequisites: Ensure that the `[JAR file location]/data/staffconnect.json` file is generated by running the JAR file of the app at least once. + + 1. Test case: No modifications to data file after it has been generated.
+ In the image below shows the contents of the untouched data file: + ![Before Corrupt Data File](images/beforeCorruptDataFile.png) + + Expected: The app should show a list of 6 persons + ![Before Corrupt Data File Result](images/beforeCorruptDataFileResult.png) + + 1. Test case: Invalid modification to data file.
+ Modify the `Favourite` attribute value to `Not avourite` (an invalid value) in the data file: + ![After Corrupt Data File](images/afterCorruptDataFile.png) + + Expected: The app should show an empty list (no persons) + ![After Corrupt Data File Result](images/afterCorruptDataFileResult.png) + + 1. Test case: Valid modification to data file.
+ Before, `Alex Yeoh` has the module `CS1101S` in the untouched data file as seen in `Test case: No modifications to data file after it has been generated`. + + Modify the `Module` attribute value to `CS2030S` (a valid value) in the data file: + ![After Valid Modification To Data File](images/afterValidModificationToDataFile.png) -1. _{ more test cases …​ }_ + Expected: The app should show `Alex Yeoh` with the module `CS2030S`: + ![After Valid Modification To Data File Result](images/afterValidModificationToDataFileResult.png) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index aace2e41241..c097c440ea1 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -3,7 +3,7 @@ layout: page title: User Guide --- -StaffConnect (SC) is a **desktop app for managing contacts of Professors and Tutors, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, SC can get your contact management tasks done faster than traditional GUI apps. +StaffConnect (SC) is a **desktop app for managing Professors' and Tutors' contact information and associated meetings, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, SC can get your contact management tasks done faster than traditional GUI apps. * Table of Contents {:toc} @@ -25,13 +25,13 @@ StaffConnect (SC) is a **desktop app for managing contacts of Professors and Tut 5. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.
Some example commands you can try: - * `list` : Lists all contacts. + * `list` : Lists all persons. - * `add n/John Doe p/98765432 e/johnd@example.com m/CS2103 f/Computing v/John street, block 123, #01-01` : Adds a contact named `John Doe` to the contacts list. + * `add n/John Doe p/98765432 e/johnd@example.com m/CS2103 f/Computing v/John street, block 123, #01-01` : Adds a person named `John Doe` to the persons list. - * `delete 3` : Deletes the 3rd contact shown in the current list. + * `delete 3` : Deletes the 3rd person shown in the current list. - * `clear` : Deletes all contacts. + * `clear` : Deletes all persons. * `exit` : Exits the app. @@ -50,7 +50,7 @@ StaffConnect (SC) is a **desktop app for managing contacts of Professors and Tut Before we get started StaffConnect offers a unique suite of UI controls for users to customise their own unique experience! -1. Clicking any items on the left contacts panel will allow you to select the person contact to display. +1. Clicking any items on the left contacts panel will allow you to select the person whose attributes and meeting list are to be display.
Alternatively, clicking anywhere in the contacts panel then using your arrow keys to navigate and hitting enter to select would give the same result.
**Intended Behaviour:**
Hovering the selection with mouse or arrow keys would not cause the details panel to switch to the selected person. This is to allow users to browse the contacts panel without switching. @@ -129,10 +129,14 @@ Format: `help` ### Adding a person: `add` -Adds a person to the contacts. +Adds a person to the staff book. Format: `add n/NAME p/PHONE_NUMBER e/EMAIL m/MODULE f/FACULTY v/VENUE [t/TAG]…​ [a/AVAILABILITY]…​` +* `NAME` is case-sensitive and has to be unique among persons in staff book. +* `PHONE_NUMBER`, `EMAIL`, `MODULE`, `FACULTY`, `VENUE` do not need to be unique and can be duplicated among persons to staff book. +* `TAG` and `AVAILABILITY` have to be unique for a person but can be duplicated among persons in staff book. +
:bulb: **Tip:** A person can have any number of tags and availabilities (including 0)
@@ -146,13 +150,13 @@ Examples: ### Listing all persons : `list` -Shows a list of all persons in the contacts. +Shows a list of all persons in the staff book. Format: `list` ### Editing a person : `edit` -Edits an existing person in the contacts. +Edits an existing person in the staff book.
@@ -169,11 +173,12 @@ Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [m/MODULE] [f/FACULTY] [v/VENUE * At least one of the optional fields must be provided. * Existing values will be updated to the input values. * When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. -* You can remove all the person’s tags by typing `t/` without - specifying any tags after it. +* You can remove all the person’s tags by typing `t/` without specifying any tags after it. * When editing availabilities, the existing availabilities of the person will be removed i.e adding of availabilities is not cumulative. -* You can remove all the person’s availabilities by typing `a/` without - specifying any availabilities after it. +* You can remove all the person’s availabilities by typing `a/` without specifying any availabilities after it. +* `NAME` is case-sensitive and has to be unique among persons in staff book. +* `PHONE_NUMBER`, `EMAIL`, `MODULE`, `FACULTY`, `VENUE` do not need to be unique and can be duplicated among persons in staff book. +* `TAG` and `AVAILABILITY` have to be unique for a person but can be duplicated among persons in staff book. Examples: * `edit 1 p/91234567 e/johndoe@example.com` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. @@ -185,6 +190,25 @@ Examples:
**After editing the second person:**
![After editing the second person](images/AfterEditCommand.png) +### Locating persons by name: `find` + +Finds persons whose names contain any of the given keywords. + +Format: `find KEYWORD [MORE_KEYWORDS]` + +* The search is case-insensitive. e.g `hans` will match `Hans` +* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` +* Only the name is searched. +* Only full words will be matched e.g. `Han` will not match `Hans` +* Persons matching at least one keyword will be returned (i.e. `OR` search). + e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` + +Examples: +* `find John` returns `john` and `John Doe` +* `find li` returns `David Li` +* `find alex david` returns `Alex Yeoh`, `David Li`
+ ![result for 'find alex david'](images/findAlexDavidResult.png) + ### Filtering persons: `filter` Filters persons whose module, faculty, tags or availabilities match the given filtering criteria. @@ -209,39 +233,20 @@ Examples: * `filter t/tutor` returns `Bernice Yu`, `Irfan Ibrahim`
![result for 'filter t/tutor'](images/filterTutorTagResult.png) -### Locating persons by name: `find` - -Finds persons whose names contain any of the given keywords. -Format: `find KEYWORD [MORE_KEYWORDS]` - -* The search is case-insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). - e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` - -Examples: -* `find John` returns `john` and `John Doe` -* `find li` returns `David Li` -* `find alex david` returns `Alex Yeoh`, `David Li`
- ![result for 'find alex david'](images/findAlexDavidResult.png) - -### Sorting persons by attribute: `sort` +### Sorting persons: `sort` Sorts the list of persons based on specified attribute. -Format: `sort [ATTRIBUTE]` +Format: `sort [n/] [p/] [m/] [f/] [v/] [s/] [meet/]` * By default, sorting is done in alphanumeric order. * The order of character priority would be letters (A-Z), numbers (0-9), special characters (!@#$%^&*). * The capitalisation of the letters do not affect their priority such that `Aaron` will have same priority as `aaron`. * For attribute with exact same values, the tie-breaker is determined by their added order. -* For sorting of multiple attributes, the weightage will be determined by the order in which it was entered. E.g `sort m/ p/ v/` will sort by contact by their module, among those with equal modules would then be sorted by their phone number and similarly for venue. -* `[ATTRIBUTE]` is to be noted by their prefix. e.g `name` will be `n/`. -* `s/` sorts contacts by person with the earliest meeting -* `meet/` sorts contacts by person with the earliest meeting, followed by alphanumeric order of meeting description +* For sorting of multiple attributes, the weightage will be determined by the order in which it was entered. E.g `sort m/ p/ v/` will sort persons by their module, among those with equal modules would then be sorted by their phone number and similarly for venue. +* `s/` sorts the list by person with the earliest meeting +* `meet/` sorts the list by person with the earliest meeting, followed by alphanumeric order of meeting description Examples: * `sort m/ p/` returns person by ascending module codes followed by ascending phone numbers `CS2000 80000000`, `CS2000 90000000`, `CS3000 80000000`followed by `CS3000 90000000` @@ -282,6 +287,7 @@ Format: `meeting-add INDEX d/DESCRIPTION s/DATETIME` 2. `H:mm` 3. `HHmm` * Duplicate meetings with the same `DESCRIPTION` and `DATETIME` in the same person is not allowed. +* Meetings with the same `DESCRIPTION` and `DATETIME` does not need to be unique among persons in staff book. Examples: * `meeting-add 1 d/Meet for finals preparation s/12/04/2024 18:00` adds a meeting to the first person with the description of `Meet for finals preparation` and the date and time of `12/04/2024 18:00` @@ -305,16 +311,16 @@ Format: `meeting-delete INDEX i/MEETING-INDEX ` * The index refers to the index number shown in the displayed person list. * The index **must be a positive integer** 1, 2, 3,…​ and tally within range index of the displayed person list. * The meeting-index refers to the index number shown in the displayed meeting list. -* The index **must be a positive integer** 1, 2, 3,…​ and tally within range index of the displayed meeting list. +* The meeting-index **must be a positive integer** 1, 2, 3,…​ and tally within range index of the displayed meeting list. * The meeting from the person must exist before it can be deleted otherwise an error will be displayed. Examples: * The following commands assumes that meetings have been added prior to the command. Otherwise, an error will be thrown.
**(Refer to the section above on how to add a meeting)** - * `list` followed by `meeting-delete 1 i/1` deletes the 1st meeting from the 1st person in the contacts. + * `list` followed by `meeting-delete 1 i/1` deletes the 1st meeting from the 1st person in the list. * `find Bernice Yu` followed by `meeting-delete 1 i/2` deletes the 1st meeting form the 1st person in the results of the `find` command.
**Results for delete meeting:**
The following command was applied: `find Bernice Yu` followed by `meeting-delete 1 i/2`. -
__(Disclaimer: The content shown in the examples may not match what you have added to your own meetings within the contact book).__ +
__(Disclaimer: The content shown in the examples may not match what you have added to your own meetings within the staff book).__

**After `find Bernice Yu`:**
![result for before `find Bernice Yu` followed by `meeting-delete 1 i/2`](images/meetingDeleteResultBefore.png)

**After `meeting-delete 1 i/2`:**
@@ -328,7 +334,7 @@ The following command was applied: `find Bernice Yu` followed by `meeting-delet There will be no further prompt after entering the command to delete a person in the staff book. This action is irreversible and the person to be deleted cannot be retrieved afterwards.
-Deletes the specified person from the contacts. +Deletes the specified person from the staff book. Format: `delete INDEX` @@ -337,8 +343,8 @@ Format: `delete INDEX` * The index **must be a positive integer** 1, 2, 3, …​ Examples: -* `list` followed by `delete 2` deletes the 2nd person in the contacts. -* `sort p/` followed by `delete 1` deletes the 1st person in the contacts in the results of the `sort` command, which should be the person with the smallest phone number. +* `list` followed by `delete 2` deletes the 2nd person in the list. +* `sort p/` followed by `delete 1` deletes the 1st person in the list in the results of the `sort` command, which should be the person with the smallest phone number. * `find Bernice Yu` followed by `delete 1` deletes the 1st person in the results of the `find` command.
**Before deletion:**
![All persons listed](images/BeforeDeleteCommand1.png) @@ -351,7 +357,7 @@ Examples: ### Setting a person as favourite: `fav` -Sets the specified person from the contacts as favourite. +Sets the specified person from the list as favourite.
:information_source: **Note:** The displayed view in StaffConnect will reset to the default view after the `fav` command is called. @@ -364,15 +370,15 @@ Format: `fav INDEX` * The index **must be a positive integer** 1, 2, 3, …​ Examples: -* `list` followed by `fav 2` sets the 2nd person as favourite in the contacts. -* `sort p/` followed by `fav 1` sets the 1st person as favourite in the contacts in the results of the `sort` command, which should be the person with the smallest phone number. +* `list` followed by `fav 2` sets the 2nd person as favourite in the staff book. +* `sort p/` followed by `fav 1` sets the 1st person as favourite in the staff book in the results of the `sort` command, which should be the person with the smallest phone number. * `find Betsy` followed by `fav 1` sets the 1st person as favourite in the results of the `find` command. ![Result of fav command](images/AfterFavCommand.png) ### Removes a person as favourite: `unfav` -Removes the specified person from the contacts as favourite. +Removes the specified person from the staff book as favourite.
:information_source: **Note:** The displayed view in StaffConnect will reset to the default view after the `unfav` command is called. @@ -385,8 +391,8 @@ Format: `unfav INDEX` * The index **must be a positive integer** 1, 2, 3, …​ Examples: -* `list` followed by `unfav 2` removes the 2nd person as favourite in the contacts. -* `sort p/` followed by `fav 1` removes the 1st person as favourite in the contacts in the results of the `sort` command, which should be the person with the smallest phone number. +* `list` followed by `unfav 2` removes the 2nd person as favourite in the staff book. +* `sort p/` followed by `fav 1` removes the 1st person as favourite in the staff book in the results of the `sort` command, which should be the person with the smallest phone number. * `find Betsy` followed by `unfav 1` removes the 1st person as favourite in the results of the `find` command. ### Refresh and clear all outdated meetings: `refresh` @@ -417,14 +423,14 @@ Examples: Refresh is only used when the user decides to remove clutter in the staff book, and wants to remove outdated meetings. This process is not done automatically as sometimes the user would like to retain old meetings for bookkeeping purposes. -### Selecting the detailed contact to display: `select` +### Selecting the person to display: `select` -Selects the person identified by the index number used in the displayed person list for display. +Selects the person identified by their current displayed index number to display their attributes and meeting list. Format: `select INDEX` -* Select the person and loads its contact with meeting details for display at the specified **INDEX** -* The index refers to the index number shown in the displayed person list. +* Select the person at the specified **INDEX** to display its attributes and meeting list. +* The index refers to the index number shown in the current displayed person list. * The index **must be a positive integer** 1, 2, 3, …​ Examples: @@ -460,7 +466,10 @@ StaffConnect data are saved automatically as a JSON file `[JAR file location]/da
:exclamation: **Caution:** If your changes to the data file makes its format invalid, StaffConnect 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.
-Furthermore, certain edits can cause the StaffConnect to behave in unexpected ways (e.g., if a value entered is outside of the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly. +Furthermore, certain edits can cause StaffConnect to behave in unexpected ways (e.g., if a value entered is outside of the acceptable range). +The application will not prompt the user if the format of the data file is incorrect, but instead provide the user with an empty staff book. +Therefore, edit the data file only if you are confident that you can update it correctly. +
-------------------------------------------------------------------------------------------------------------------- @@ -475,24 +484,30 @@ Furthermore, certain edits can cause the StaffConnect to behave in unexpected wa ## Known issues 1. **When using multiple screens**, if you move the application to a secondary screen, and later switch to using only the primary screen, the GUI will open off-screen. The remedy is to delete the `preferences.json` file created by the application before running the application again. - +2. **When adding/editing phone number with a descriptor**, If you try to add a number with a descriptor such as `98731094 (home)`, the application rejects this input and advise the user to only provide phone numbers with numerical values only. The phone number is not intended to store phone number descriptor but users can consider using tags such as t/homePhone as a workaround. +3. **When adding/editing name containing special characters**, If you try to add a name such as `Jason s/o William`, the application rejects this input and advise the user to only provide name with alphanumeric values only. The name is not intended to store special characters but users can consider using `so` or `son of` as a workaround. If a person's name includes special characters (characters not included in modern English) like arabic characters (such as أ, ب, ت, etc.), it should be latinized first. +4. **When adding/editing name that already exists in the staff book**, if you try to do so, an error message will be prompted, as two persons are considered the same person as long as they have the same name. It is inplausible to has two persons with the same name but other different attributes. +5. **When adding/editing venues containing space with an attribute prefix**, If you try to add a venue such as `Room 12 t/r`, the application will add a person with a venue `Room 12` and a tag `r` instead of the intended venue `Room 12 t/r`. The venue is not intended to store venues that contains a space followed by an attribute prefix but users can consider omitting the space or replace with a hyphen such as `Room 12t/r` or `Room 12-t/r` as a workaround. +6. **When generating the default file and exiting via the `Exit` button**, If you try to generate the default JSON file `[JAR file location]/data/staffconnect.json` by running the JAR file, without manipulating any data and exiting via the `Exit` button, the JSON file would not be generated. You may consider using the `exit` command via the command line interface to generate the default JSON file instead. -------------------------------------------------------------------------------------------------------------------- ## Attribute summary Attribute | Prefix | Restrictions | Examples ----------|--------|--------------|--------------------- -Name | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` -Phone Number | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` -Email | e/ | Valid email of the format `local-part@domain`.
1. `local-part` should only contain alphanumeric characters and the special characters `+_.-`
2. `local-part` may not start or end with any special characters.
3. `local-part` must be followed by exactly one `@` and then a `domain` name.
4. `domain` must be made up of at least 2 `domain` labels separated by periods.
5. Each `domain` name must be at least 2 alphanumeric characters long.
6. Each `domain` name must start and end with alphanumeric characters.
7. Each `domain` name can only consist of alphanumeric characters, separated by hyphens, if any. | `e@123.com`, `hello@h-h.com`, `one+two@h-h.hh`, `hello@e-h.e-hh` -Module | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 1 character long. | `gess1025`, `hsi1000`, `cs2103t` -Faculty | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below). | `soc`, `biz`, `School of Business` -Venue | v/ | Any characters allowed, cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` -Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed. | `tutor`, `professor`, `BestProf`, `Number1TA` -Availability | a/ | Valid format of `day start-time end-time`.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` +Name[^1] | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` +Phone Number[^1] | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` +Email[^1] | e/ | Valid email of the format `local-part@domain`.
1. `local-part` should only contain alphanumeric characters and the special characters `+_.-`
2. `local-part` may not start or end with any special characters.
3. `local-part` must be followed by exactly one `@` and then a `domain` name.
4. `domain` must be made up of at least 2 `domain` labels separated by periods.
5. Each `domain` name must be at least 2 alphanumeric characters long.
6. Each `domain` name must start and end with alphanumeric characters.
7. Each `domain` name can only consist of alphanumeric characters, separated by hyphens, if any. | `e@123.com`, `hello@h-h.com`, `one+two@h-h.hh`, `hello@e-h.e-hh` +Module[^1] | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 2 characters long. | `gess1025`, `hsi1000`, `cs2103t` +Faculty[^1] | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below).
A valid faculty name and its variations (other names) all refer to the same faculty. | `soc`, `biz`, `School of Business` +Venue[^1] | v/ | Any characters allowed.
Cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` +Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed.
Person can have any number of tags. | `tutor`, `professor`, `BestProf`, `Number1TA` +Availability | a/ | Valid format of `day start-time end-time`.
Person can have any number of availabilities.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` Meeting Description | d/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `Meet for finals`, `Midterm revision` Meeting Start Time | s/ | Valid date and time format.
1. Valid date formats: `yyyy-MM-dd`, `yyyy-M-d`, `dd-MM-yyyy`, `yyyy-MM-d`, `d-MM-yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `d/MM/yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `dd/MM/yyyy`, `yyyy/MM/dd`, `yyyy/MM/d`, `yyyy/M/dd`, `yyyy/M/d`
where `yyyy` is a 4-digit year (0000-9999), `M` is a single digit month (1-9), `MM` is a valid month (01-12), `d` is a single digit day (1-9), `dd` is a valid day (01-31)
2. Valid time formats: `HH:mm`, `H:mm`, `HHmm`
where `H` is a single digit hour (1-9), `HH` is a valid 24-hour (00-23), `mm` are valid minutes (00-59). | `2002-11-02 19:00`, `1-12-2022 9:00`, `2024/1/1 0000` +[^1]: These are mandatory attributes when adding a person into the staff book, as these are important information for students to know when/where to consult their professors/TAs. + ### Valid `Faculty` values Faculty | Other names @@ -502,9 +517,8 @@ Business School | Business, Biz School, Biz School of Computing | Computing, SoC School of Continuing and Lifelong Education | Continuing and Lifelong Education, SCALE Faculty of Dentistry | Dentistry -School of Design and Environment | Design and Environment, SDE +College of Design and Engineering | Design and Engineering, CDE Duke-NUS Medical School | Duke-NUS -Faculty of Engineering, Engineering | FoE Integrative Sciences and Engineering | ISEP Faculty of Law | Law Yong Loo Lin School of Medicine | Medicine diff --git a/docs/diagrams/SortActivityDiagram.puml b/docs/diagrams/SortActivityDiagram.puml index f1964bae42a..5c2024ba06f 100644 --- a/docs/diagrams/SortActivityDiagram.puml +++ b/docs/diagrams/SortActivityDiagram.puml @@ -6,18 +6,22 @@ start :User enters a sort command; -if() then ([attributes are not sortable]) - :get person from list; - while (have person to compare) - while(attribute value with the next person in the list are equal or no more attributes) - :use next attribute to check; - endwhile - if() then ([person smaller]) - :shift front; - else([person bigger]) - :shift back; +if() then ([attributes are sortable]) + if () then ([list is not empty]) + repeat + :get next person in list + and adds to sorted list; + :compare with persons in sorted list; + if () then ([person smaller]) + :shift up; + else if () then ([person same]) + else ( [person bigger]) + :shift down; endif - endwhile + repeat while () is ([have next person to sort]) not ([no more person to sort]) + + else ([list is empty]) + endif :Shows sorted person list; else([any attribute is not sortable]) :displays Sort Usage message; diff --git a/docs/images/SortActivityDiagram.png b/docs/images/SortActivityDiagram.png index 95864c6f0be..151913480d6 100644 Binary files a/docs/images/SortActivityDiagram.png and b/docs/images/SortActivityDiagram.png differ diff --git a/docs/images/afterCorruptDataFile.png b/docs/images/afterCorruptDataFile.png new file mode 100644 index 00000000000..bf3bfb0dac6 Binary files /dev/null and b/docs/images/afterCorruptDataFile.png differ diff --git a/docs/images/afterCorruptDataFileResult.png b/docs/images/afterCorruptDataFileResult.png new file mode 100644 index 00000000000..652caff8744 Binary files /dev/null and b/docs/images/afterCorruptDataFileResult.png differ diff --git a/docs/images/afterValidModificationToDataFile.png b/docs/images/afterValidModificationToDataFile.png new file mode 100644 index 00000000000..1fa7d78793d Binary files /dev/null and b/docs/images/afterValidModificationToDataFile.png differ diff --git a/docs/images/afterValidModificationToDataFileResult.png b/docs/images/afterValidModificationToDataFileResult.png new file mode 100644 index 00000000000..ff33f529da9 Binary files /dev/null and b/docs/images/afterValidModificationToDataFileResult.png differ diff --git a/docs/images/beforeCorruptDataFile.png b/docs/images/beforeCorruptDataFile.png new file mode 100644 index 00000000000..b0bed31596c Binary files /dev/null and b/docs/images/beforeCorruptDataFile.png differ diff --git a/docs/images/beforeCorruptDataFileResult.png b/docs/images/beforeCorruptDataFileResult.png new file mode 100644 index 00000000000..d0f1ec5a9a9 Binary files /dev/null and b/docs/images/beforeCorruptDataFileResult.png differ diff --git a/docs/images/beforeValidModificationToDataFileResult.png b/docs/images/beforeValidModificationToDataFileResult.png new file mode 100644 index 00000000000..6733ad8a436 Binary files /dev/null and b/docs/images/beforeValidModificationToDataFileResult.png differ diff --git a/docs/team/tsulim.md b/docs/team/tsulim.md index 2549af94307..b722aaca43c 100644 --- a/docs/team/tsulim.md +++ b/docs/team/tsulim.md @@ -9,38 +9,23 @@ StaffConnect offers convenience and peace of mind to a struggling student with m Given below are my contributions to the project. -* **New Feature**: Added the ability to undo/redo previous commands. - * What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. - * Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. - * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. - * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}* +* **New Feature**: Added a `fav` and `unfav` command that allows the user to set contacts as Favourite, prioritizing them at the top of the list. + * What it does: allows the user to set selected contact as favourite. Preceding `unfav` commands can be reversed by using the redo command. + * Justification: This feature improves the product significantly because a user can view contacts that they prioritize at the top without the need to search below, bringing them more conveniences. -* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys. - -* **Code contributed**: [RepoSense link]() +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s2.github.io/tp-dashboard/?search=tsulim&sort=groupTitle%20dsc&sortWithin=title&since=2024-02-23&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=false&tabOpen=true&tabType=authorship&tabAuthor=tsulim&tabRepo=AY2324S2-CS2103-F08-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false) * **Project management**: * Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub -* **Enhancements to existing features**: - * Updated the GUI color scheme (Pull requests [\#33](), [\#34]()) - * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]()) - * **Documentation**: * User Guide: - * Added documentation for the features `delete` and `find` [\#72]() - * Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]() + * Added documentation for the features `fav` and `unfav`: [\#140](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/140), [\#165](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/165), [\#237](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/237) * Developer Guide: - * Added implementation details of the `delete` feature. + * Added implementation details of the `fav`/`unfav` feature: [\#151](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/151), [\#165](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/165) * **Community**: - * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]() - * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]()) - * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]()) - * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]()) - -* **Tools**: - * Integrated a third party library (Natty) to the project ([\#42]()) - * Integrated a new Github plugin (CircleCI) to the team repo + * PRs reviewed (with non-trivial review comments): [\#32](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/32), [\#104](https://github.com/AY2324S2-CS2103-F08-3/tp/pull/104) + * Reported bugs and suggestions for other teams in the module (examples: [1](https://github.com/AY2324S2-CS2103T-T10-1/tp/issues/368)) * _{you can add/remove categories in the list above}_ diff --git a/src/main/java/staffconnect/logic/Messages.java b/src/main/java/staffconnect/logic/Messages.java index 77a6d1ad992..ca71ad9fa48 100644 --- a/src/main/java/staffconnect/logic/Messages.java +++ b/src/main/java/staffconnect/logic/Messages.java @@ -44,9 +44,9 @@ public static String format(Person person) { .append("; Phone: ") .append(person.getPhone()) .append("; Email: ") - .append(person.getFaculty()) - .append("; Faculty: ") .append(person.getEmail()) + .append("; Faculty: ") + .append(person.getFaculty()) .append("; Venue: ") .append(person.getVenue()) .append("; Module: ") diff --git a/src/main/java/staffconnect/logic/commands/SortCommand.java b/src/main/java/staffconnect/logic/commands/SortCommand.java index 98bb5089fa9..4c79dbfd019 100644 --- a/src/main/java/staffconnect/logic/commands/SortCommand.java +++ b/src/main/java/staffconnect/logic/commands/SortCommand.java @@ -26,7 +26,7 @@ public class SortCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Sort all persons by the attribute specified " + "and displays them as a list with index numbers.\n" - + "Parameters: [ATTRIBUTE]\n" + + "Parameters: " + "[" + PREFIX_NAME + "] " + "[" + PREFIX_PHONE + "] " + "[" + PREFIX_MODULE + "] " diff --git a/src/main/java/staffconnect/model/person/Faculty.java b/src/main/java/staffconnect/model/person/Faculty.java index 2b1d2127bee..0c92562f3d5 100644 --- a/src/main/java/staffconnect/model/person/Faculty.java +++ b/src/main/java/staffconnect/model/person/Faculty.java @@ -26,9 +26,8 @@ public enum FacultyName { CONTINUING_AND_LIFELONG_EDUCATION("School of Continuing and Lifelong Education", "Continuing and Lifelong Education", "SCALE"), DENTISTRY("Faculty of Dentistry", "Dentistry"), - DESIGN_AND_ENVIRONMENT("School of Design and Environment", "Design and Environment", "SDE"), + DESIGN_AND_ENGINEERING("College of Design and Engineering", "Design and Engineering", "CDE"), DUKE_NUS_MEDICAL_SCHOOL("Duke-NUS Medical School", "Duke-NUS"), - ENGINEERING("Faculty of Engineering", "Engineering", "FoE"), INTEGRATIVE_SCIENCES_AND_ENGINEERING("Integrative Sciences and Engineering", "ISEP"), LAW("Faculty of Law", "Law"), MEDICINE("Yong Loo Lin School of Medicine", "Medicine", "School of Medicine"), diff --git a/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java b/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java index 3db3009ced2..58b17d1c507 100644 --- a/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java +++ b/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java @@ -58,7 +58,7 @@ public void test_personDoesNotHaveFaculty_returnsFalse() { @Test public void toStringMethod() { - Faculty faculty = new Faculty("Engineering"); + Faculty faculty = new Faculty("CDE"); PersonHasFacultyPredicate predicate = new PersonHasFacultyPredicate(faculty); String expected = PersonHasFacultyPredicate.class.getCanonicalName() + "{faculty=" + faculty + "}";