Skip to content

Commit fb0fdab

Browse files
committed
Update sorting, user guide and json path
* Remove criterias from sorting, such that sorting is now only left with the criterias name, birthdays and priority, and update sorting section in user guide. * Update user guide images clients section, policy section and reminders section, as well as update command structure image such that parameters is changed to fields. * Change remaining addressbook.json to clientcare.json.
1 parent b70d606 commit fb0fdab

18 files changed

+15
-123
lines changed

docs/UserGuide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ download ClientCare.
127127

128128
2. Download the latest version of ClientCare by downloading the `clientcare.jar` file found [here](https://github.com/AY2324S2-CS2103T-W12-1/tp/releases).
129129

130-
![Tag](images/ug/ReleaseTag%20v1.2.jpg =600x)
130+
![Tag](images/ug/ReleaseTag%20v1.2.png =600x)
131131

132132
<box type="info">
133133

134134
**Note:** The ClientCare application file can be found at the bottom of the release notes, under Assets!
135135
</box>
136136

137-
![jar](images/ug/clientcare%20jar%20file%20v1.2.jpg =600x)
137+
![jar](images/ug/clientcare%20jar%20file%20v1.2.png =600x)
138138

139139
3. Create a new empty folder (with any name you like) in your computer where you'd like to store ClientCare.
140140

@@ -207,7 +207,7 @@ Let's learn the language that ClientCare speaks in.
207207
### ClientCare Commands
208208
A ClientCare command has the following parts:
209209

210-
![Command Structure](images/ug/commandStructure.jpg =450x)
210+
![Command Structure](images/ug/commandStructure.png =450x)
211211

212212
##### 1) Command Keyword
213213
This keyword tells ClientCare what you want to do. If you want to add a new client, then `add` will be the keyword.
@@ -656,13 +656,13 @@ Want to see all your VIP clients first? You can sort the client list with `sort`
656656
Format: `sort CRITERIA o/ORDER`
657657

658658
* Sorts the client list by the specified `CRITERIA`. Sorting `CRITERIA` is *case-insensitive*.
659-
* Sortng `CRITERIA` can be `name`, `phone`, `email`, `address`, `birthday`, `priority`, `lastmet`, `schedule`.
659+
* Sortng `CRITERIA` can be `name`, `birthday`, `priority`.
660660
* Sorting `ORDER` is specified by `ORDER` and can be `asc` for ascending or `desc` for descending. Sorting `ORDER` is *case-insensitive*
661661

662662
Examples:
663663
* `sort name o/asc` sorts the client list by name in ascending order.
664664
* `sort priority o/desc` sorts the client list by priority in descending order.
665-
* `sort lastmet o/asc` sorts the client list by last met date in ascending order.
665+
* `sort birthday o/asc` sorts the client list by birthday date in ascending order.
666666

667667
**Before Command:**
668668

docs/images/ug/clientViewAndList.png

84.7 KB
Loading

docs/images/ug/commandStructure.jpg

-44.2 KB
Binary file not shown.

docs/images/ug/commandStructure.png

78 KB
Loading

docs/images/ug/policies.png

95 KB
Loading

docs/images/ug/reminders.png

85.5 KB
Loading

docs/tutorials/AddRemark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ While the changes to code may be minimal, the test data will have to be updated
296296

297297
<box type="warning" seamless>
298298

299-
You must delete AddressBook’s storage file located at `/data/addressbook.json` before running it! Not doing so will cause AddressBook to default to an empty address book!
299+
You must delete AddressBook’s storage file located at `/data/clientcare.json` before running it! Not doing so will cause AddressBook to default to an empty address book!
300300

301301
</box>
302302

src/main/java/seedu/address/model/person/PersonComparator.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,12 @@ public static Comparator<Person> getComparator(SortCriteria sortCriteria, SortOr
2121
case NAME:
2222
comparator = Comparator.comparing(Person::getName);
2323
break;
24-
case PHONE:
25-
comparator = Comparator.comparing(Person::getPhone);
26-
break;
27-
case EMAIL:
28-
comparator = Comparator.comparing(Person::getEmail);
29-
break;
30-
case ADDRESS:
31-
comparator = Comparator.comparing(Person::getAddress);
32-
break;
3324
case PRIORITY:
3425
comparator = Comparator.comparing(Person::getPriority);
3526
break;
3627
case BIRTHDAY:
3728
comparator = Comparator.comparing(Person::getBirthday);
3829
break;
39-
case LASTMET:
40-
comparator = Comparator.comparing(Person::getLastMet);
41-
break;
42-
case SCHEDULE:
43-
comparator = Comparator.comparing(Person::getSchedule);
44-
break;
4530
default:
4631
return COMPARATOR_SHOW_ORIGINAL_ORDER;
4732
}

src/main/java/seedu/address/model/person/SortCriteria.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,14 @@
55
*/
66
public enum SortCriteria {
77
NAME,
8-
PHONE,
9-
EMAIL,
10-
ADDRESS,
118
BIRTHDAY,
129
PRIORITY,
13-
LASTMET,
14-
SCHEDULE,
1510
INVALID;
1611

1712
public static final String MESSAGE_CONSTRAINTS = "Sort criteria should be either "
1813
+ SortCriteria.NAME + ", "
19-
+ SortCriteria.PHONE + ", "
20-
+ SortCriteria.EMAIL + ", "
21-
+ SortCriteria.ADDRESS + ", "
22-
+ SortCriteria.BIRTHDAY + ", "
2314
+ SortCriteria.PRIORITY + ", "
24-
+ SortCriteria.LASTMET + " or "
25-
+ SortCriteria.SCHEDULE + ".";
15+
+ SortCriteria.BIRTHDAY + ".";
2616

2717
/**
2818
* Returns the sort criteria given the string.

src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"z" : 99
1010
}
1111
},
12-
"addressBookFilePath" : "addressbook.json"
12+
"addressBookFilePath" : "clientcare.json"
1313
}

src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"y" : 100
88
}
99
},
10-
"addressBookFilePath" : "addressbook.json"
10+
"addressBookFilePath" : "clientcare.json"
1111
}

src/test/java/seedu/address/logic/LogicManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class LogicManagerTest {
4848
@BeforeEach
4949
public void setUp() {
5050
JsonAddressBookStorage addressBookStorage =
51-
new JsonAddressBookStorage(temporaryFolder.resolve("addressBook.json"));
51+
new JsonAddressBookStorage(temporaryFolder.resolve("clientcare.json"));
5252
JsonUserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(temporaryFolder.resolve("userPrefs.json"));
5353
StorageManager storage = new StorageManager(addressBookStorage, userPrefsStorage);
5454
logic = new LogicManager(model, storage);

src/test/java/seedu/address/logic/parser/SortCommandParserTest.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
public class SortCommandParserTest {
1616
public static final String VALID_SORT_NAME_ASC = SortCriteria.NAME + " " + PREFIX_SORT_ORDER + SortOrder.ASC;
1717
public static final String VALID_SORT_NAME_DESC = SortCriteria.NAME + " " + PREFIX_SORT_ORDER + SortOrder.DESC;
18-
public static final String VALID_SORT_PHONE_ASC = SortCriteria.PHONE + " " + PREFIX_SORT_ORDER + SortOrder.ASC;
19-
public static final String VALID_SORT_PHONE_DESC = SortCriteria.PHONE + " " + PREFIX_SORT_ORDER + SortOrder.DESC;
20-
public static final String VALID_SORT_EMAIL_ASC = SortCriteria.EMAIL + " " + PREFIX_SORT_ORDER + SortOrder.ASC;
21-
public static final String VALID_SORT_EMAIL_DESC = SortCriteria.EMAIL + " " + PREFIX_SORT_ORDER + SortOrder.DESC;
22-
public static final String VALID_SORT_ADDRESS_ASC = SortCriteria.ADDRESS + " " + PREFIX_SORT_ORDER + SortOrder.ASC;
23-
public static final String VALID_SORT_ADDRESS_DESC = SortCriteria.ADDRESS + " " + PREFIX_SORT_ORDER
24-
+ SortOrder.DESC;
2518
public static final String VALID_SORT_PRIORITY_ASC = SortCriteria.PRIORITY + " " + PREFIX_SORT_ORDER
2619
+ SortOrder.ASC;
2720
public static final String VALID_SORT_PRIORITY_DESC = SortCriteria.PRIORITY + " " + PREFIX_SORT_ORDER
@@ -30,13 +23,6 @@ public class SortCommandParserTest {
3023
+ SortOrder.ASC;
3124
public static final String VALID_SORT_BIRTHDAY_DESC = SortCriteria.BIRTHDAY + " " + PREFIX_SORT_ORDER
3225
+ SortOrder.DESC;
33-
public static final String VALID_SORT_LASTMET_ASC = SortCriteria.LASTMET + " " + PREFIX_SORT_ORDER + SortOrder.ASC;
34-
public static final String VALID_SORT_LASTMET_DESC = SortCriteria.LASTMET + " " + PREFIX_SORT_ORDER
35-
+ SortOrder.DESC;
36-
public static final String VALID_SORT_SCHEDULE_ASC = SortCriteria.SCHEDULE + " " + PREFIX_SORT_ORDER
37-
+ SortOrder.ASC;
38-
public static final String VALID_SORT_SCHEDULE_DESC = SortCriteria.SCHEDULE + " " + PREFIX_SORT_ORDER
39-
+ SortOrder.DESC;
4026

4127
private final SortCommandParser parser = new SortCommandParser();
4228

@@ -47,18 +33,6 @@ public void parse_allFieldsPresent_success() {
4733
new SortCommand(SortCriteria.NAME, SortOrder.ASC));
4834
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_NAME_DESC,
4935
new SortCommand(SortCriteria.NAME, SortOrder.DESC));
50-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_PHONE_ASC,
51-
new SortCommand(SortCriteria.PHONE, SortOrder.ASC));
52-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_PHONE_DESC,
53-
new SortCommand(SortCriteria.PHONE, SortOrder.DESC));
54-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_EMAIL_ASC,
55-
new SortCommand(SortCriteria.EMAIL, SortOrder.ASC));
56-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_EMAIL_DESC,
57-
new SortCommand(SortCriteria.EMAIL, SortOrder.DESC));
58-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_ADDRESS_ASC,
59-
new SortCommand(SortCriteria.ADDRESS, SortOrder.ASC));
60-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_ADDRESS_DESC,
61-
new SortCommand(SortCriteria.ADDRESS, SortOrder.DESC));
6236
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_PRIORITY_ASC,
6337
new SortCommand(SortCriteria.PRIORITY, SortOrder.ASC));
6438
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_PRIORITY_DESC,
@@ -67,32 +41,14 @@ public void parse_allFieldsPresent_success() {
6741
new SortCommand(SortCriteria.BIRTHDAY, SortOrder.ASC));
6842
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_BIRTHDAY_DESC,
6943
new SortCommand(SortCriteria.BIRTHDAY, SortOrder.DESC));
70-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_LASTMET_ASC,
71-
new SortCommand(SortCriteria.LASTMET, SortOrder.ASC));
72-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_LASTMET_DESC,
73-
new SortCommand(SortCriteria.LASTMET, SortOrder.DESC));
74-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_SCHEDULE_ASC,
75-
new SortCommand(SortCriteria.SCHEDULE, SortOrder.ASC));
76-
assertParseSuccess(parser, PREAMBLE_WHITESPACE + VALID_SORT_SCHEDULE_DESC,
77-
new SortCommand(SortCriteria.SCHEDULE, SortOrder.DESC));
7844

7945
// without whitespace preamble
8046
assertParseSuccess(parser, VALID_SORT_NAME_ASC, new SortCommand(SortCriteria.NAME, SortOrder.ASC));
8147
assertParseSuccess(parser, VALID_SORT_NAME_DESC, new SortCommand(SortCriteria.NAME, SortOrder.DESC));
82-
assertParseSuccess(parser, VALID_SORT_PHONE_ASC, new SortCommand(SortCriteria.PHONE, SortOrder.ASC));
83-
assertParseSuccess(parser, VALID_SORT_PHONE_DESC, new SortCommand(SortCriteria.PHONE, SortOrder.DESC));
84-
assertParseSuccess(parser, VALID_SORT_EMAIL_ASC, new SortCommand(SortCriteria.EMAIL, SortOrder.ASC));
85-
assertParseSuccess(parser, VALID_SORT_EMAIL_DESC, new SortCommand(SortCriteria.EMAIL, SortOrder.DESC));
86-
assertParseSuccess(parser, VALID_SORT_ADDRESS_ASC, new SortCommand(SortCriteria.ADDRESS, SortOrder.ASC));
87-
assertParseSuccess(parser, VALID_SORT_ADDRESS_DESC, new SortCommand(SortCriteria.ADDRESS, SortOrder.DESC));
8848
assertParseSuccess(parser, VALID_SORT_PRIORITY_ASC, new SortCommand(SortCriteria.PRIORITY, SortOrder.ASC));
8949
assertParseSuccess(parser, VALID_SORT_PRIORITY_DESC, new SortCommand(SortCriteria.PRIORITY, SortOrder.DESC));
9050
assertParseSuccess(parser, VALID_SORT_BIRTHDAY_ASC, new SortCommand(SortCriteria.BIRTHDAY, SortOrder.ASC));
9151
assertParseSuccess(parser, VALID_SORT_BIRTHDAY_DESC, new SortCommand(SortCriteria.BIRTHDAY, SortOrder.DESC));
92-
assertParseSuccess(parser, VALID_SORT_LASTMET_ASC, new SortCommand(SortCriteria.LASTMET, SortOrder.ASC));
93-
assertParseSuccess(parser, VALID_SORT_LASTMET_DESC, new SortCommand(SortCriteria.LASTMET, SortOrder.DESC));
94-
assertParseSuccess(parser, VALID_SORT_SCHEDULE_ASC, new SortCommand(SortCriteria.SCHEDULE, SortOrder.ASC));
95-
assertParseSuccess(parser, VALID_SORT_SCHEDULE_DESC, new SortCommand(SortCriteria.SCHEDULE, SortOrder.DESC));
9652
}
9753

9854
@Test

src/test/java/seedu/address/model/person/PersonComparatorTest.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,6 @@ public void getComparator() {
2525
assertTrue(nameDescComparator.compare(alice, bob) > 0);
2626
assertEquals(0, nameDescComparator.compare(alice, aliceCopy));
2727

28-
// sort by phone
29-
Person phone1 = new PersonBuilder().withPhone("12345678").build();
30-
Person phone1Copy = new PersonBuilder().withPhone("12345678").build();
31-
Person phone2 = new PersonBuilder().withPhone("87654321").build();
32-
// ascending
33-
Comparator<Person> phoneAscComparator = PersonComparator.getComparator(SortCriteria.PHONE, SortOrder.ASC);
34-
assertTrue(phoneAscComparator.compare(phone1, phone2) < 0);
35-
assertEquals(0, phoneAscComparator.compare(phone1, phone1Copy));
36-
// descending
37-
Comparator<Person> phoneDescComparator = PersonComparator.getComparator(SortCriteria.PHONE, SortOrder.DESC);
38-
assertTrue(phoneDescComparator.compare(phone1, phone2) > 0);
39-
assertEquals(0, phoneDescComparator.compare(phone1, phone1Copy));
40-
41-
// sort by email
42-
Person email1 = new PersonBuilder().withEmail("abc@email.com").build();
43-
Person email1Copy = new PersonBuilder().withEmail("abc@email.com").build();
44-
Person email2 = new PersonBuilder().withEmail("bcd@email.com").build();
45-
// ascending
46-
Comparator<Person> emailAscComparator = PersonComparator.getComparator(SortCriteria.EMAIL, SortOrder.ASC);
47-
assertTrue(emailAscComparator.compare(email1, email2) < 0);
48-
assertEquals(0, emailAscComparator.compare(email1, email1Copy));
49-
// descending
50-
Comparator<Person> emailDescComparator = PersonComparator.getComparator(SortCriteria.EMAIL, SortOrder.DESC);
51-
assertTrue(emailDescComparator.compare(email1, email2) > 0);
52-
assertEquals(0, emailDescComparator.compare(email1, email1Copy));
53-
54-
// sort by address
55-
Person address1 = new PersonBuilder().withAddress("123, Clementi Ave 3").build();
56-
Person address1Copy = new PersonBuilder().withAddress("123, Clementi Ave 3").build();
57-
Person address2 = new PersonBuilder().withAddress("456, Clementi Ave 4").build();
58-
// ascending
59-
Comparator<Person> addressAscComparator = PersonComparator.getComparator(SortCriteria.ADDRESS, SortOrder.ASC);
60-
assertTrue(addressAscComparator.compare(address1, address2) < 0);
61-
assertEquals(0, addressAscComparator.compare(address1, address1Copy));
62-
// descending
63-
Comparator<Person> addressDescComparator = PersonComparator.getComparator(SortCriteria.ADDRESS, SortOrder.DESC);
64-
assertTrue(addressDescComparator.compare(address1, address2) > 0);
65-
assertEquals(0, addressDescComparator.compare(address1, address1Copy));
66-
6728
// sort by priority
6829
Person priority1 = new PersonBuilder().withPriority("low").build();
6930
Person priority1Copy = new PersonBuilder().withPriority("low").build();

src/test/java/seedu/address/model/person/SortCriteriaTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public void constructor_invalidPriority_returnsInvalid() {
3131
public void constructor_validPriority_success() {
3232
assertEquals(SortCriteria.getSortCriteria("name"), SortCriteria.NAME); // lowercase
3333
assertEquals(SortCriteria.getSortCriteria("priority"), SortCriteria.PRIORITY); // lowercase
34-
assertEquals(SortCriteria.getSortCriteria("lastmet"), SortCriteria.LASTMET); // lowercase
34+
assertEquals(SortCriteria.getSortCriteria("birthday"), SortCriteria.BIRTHDAY); // lowercase
3535
assertEquals(SortCriteria.getSortCriteria("NAME"), SortCriteria.NAME); // uppercase
3636
assertEquals(SortCriteria.getSortCriteria("PRIORITY"), SortCriteria.PRIORITY); // uppercase
37-
assertEquals(SortCriteria.getSortCriteria("LASTMET"), SortCriteria.LASTMET); // uppercase
37+
assertEquals(SortCriteria.getSortCriteria("BIRTHDAY"), SortCriteria.BIRTHDAY); // uppercase
3838
}
3939

4040
@Test
@@ -54,10 +54,10 @@ public void isValidSortCriteria() {
5454
// valid sort criteria
5555
assertTrue(SortCriteria.isValidSortCriteria("name")); // lowercase
5656
assertTrue(SortCriteria.isValidSortCriteria("priority")); // lowercase
57-
assertTrue(SortCriteria.isValidSortCriteria("lastmet")); // lowercase
57+
assertTrue(SortCriteria.isValidSortCriteria("birthday")); // lowercase
5858
assertTrue(SortCriteria.isValidSortCriteria("NAME")); // uppercase
5959
assertTrue(SortCriteria.isValidSortCriteria("PRIORITY")); // uppercase
60-
assertTrue(SortCriteria.isValidSortCriteria("LASTMET")); // uppercase
60+
assertTrue(SortCriteria.isValidSortCriteria("BIRTHDAY")); // uppercase
6161
}
6262

6363
@Test

src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void readUserPrefs_extraValuesInFile_extraValuesIgnored() throws DataLoad
7373
private UserPrefs getTypicalUserPrefs() {
7474
UserPrefs userPrefs = new UserPrefs();
7575
userPrefs.setGuiSettings(new GuiSettings(1000, 500, 300, 100));
76-
userPrefs.setAddressBookFilePath(Paths.get("addressbook.json"));
76+
userPrefs.setAddressBookFilePath(Paths.get("clientcare.json"));
7777
return userPrefs;
7878
}
7979

0 commit comments

Comments
 (0)