: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 + "}";