Skip to content

Commit

Permalink
Merge pull request #179 from getsquared/fix-ped
Browse files Browse the repository at this point in the history
Fix PE-D Bugs for UG and Email
  • Loading branch information
ReganChoy authored Apr 10, 2024
2 parents 6825be1 + 4bdd23b commit 13f28d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ All other fields (with the exception of tags) cannot have duplicate fields. For
**Note:** The name of the client is case-sensitive. `John` and `john` will be regarded as different people.
</box>


Fields usage for client details:

| Field | Usage | Example |
Expand All @@ -385,6 +386,11 @@ Examples:
* `add n/John Doe c/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 d/1990-01-01 p/low t/friends t/owesMoney`
* `add n/Betsy Crowe t/friend p/vip e/betsycrowe@example.com a/Hougang Road 12 c/1234567 t/buddy d/1979-03-04`

<box type="tip">

**Tip:** If you are missing information for some fields, you can enter placeholder values like `e/placeholder@email.com`!
</box>

**Before Command:**

Suppose you just met a new client! Let's add James Wee to your client list and his following details:
Expand Down Expand Up @@ -579,20 +585,21 @@ Format: `remark INDEX [r/REMARK]`
* Adds a note to the client at the specified `INDEX`.
* The index refers to the index number shown in the displayed client list.
* The index **must be a positive integer** 1, 2, 3, …​
* If `r/REMARK` is not present, or if nothing is typed after `r/`, the current remark for the client will be removed.

Examples:
* `remark 2 r/Has 2 school-age children and 1 elderly dependent` adds a remark for the 2nd client in the client list.
* `remark 1` deletes the remark for the 1st client in the client list.
* `remark 1` or `remark 1 r/` deletes the remark for the 1st client in the client list.


<box type="tip">

**Tip:** To remove a remark, you can use either `remark INDEX` or `remark INDEX r/`!
**Tip:** If you make a typo in your remark, you don't have to delete everything again! Just add a second prefix, for example: `remark 1 r/Speeks Enngliish r/Speaks English` will only save `Speaks English`.
</box>

<box type="info">

**Note:** ClientCare allows you to put up to 550 characters long for remark before characters are truncated in fullscreen.
**Note:** ClientCare allows you to put up to 550 characters for `REMARK` before characters are truncated in fullscreen.
</box>

**Before Command:**
Expand Down Expand Up @@ -1029,7 +1036,7 @@ Furthermore, certain edits can cause the ClientCare to behave in unexpected ways


**Q** : Why is ClientCare saying my date format is wrong?<br/>
**A** : Ensure that your date format is in YYYY-MM-DD instead of MM-DD-YYYY.
**A** : Ensure that your date format is in YYYY-MM-DD instead of DD-MM-YYYY.


**Q** : Why is my client not showing up in Last Met Display?<br/>
Expand Down Expand Up @@ -1190,7 +1197,7 @@ For example: mike@gmail.com

This means that the new value added will not be added on top of the existing information. This is especially so for Tags.
For example, if a Client currently has 2 tags `friend` and `important`, editing the tags with `high` will override the previous 2 tags.
The Client will only have the high `high` tag upon a success edit. To preserve all the tags, users must key in all previous tags in addition
The Client will only have the `high` tag upon a success edit. To preserve all the tags, users must key in all previous tags in addition
to their new tag they wish to add.

<div style="page-break-after: always;"></div>
Expand All @@ -1205,6 +1212,9 @@ The default period is 90 days. You can change this value using the `set` command

This refers to features or commands in ClientCare that are not related to Client, Schedules or Policies.

15. **Truncated**

If a text is truncated in the display, this means that the full text has been shortened, with an ellipsis `...` at the end.

<div style="page-break-after: always;"></div>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Email implements Comparable<Email> {
+ " - have each domain label consist of alphanumeric characters, separated only by hyphens, if any.";
// alphanumeric and special characters
private static final String ALPHANUMERIC_NO_UNDERSCORE = "[^\\W_]+"; // alphanumeric characters except underscore
private static final String LOCAL_PART_REGEX = "^" + ALPHANUMERIC_NO_UNDERSCORE + "([" + SPECIAL_CHARACTERS + "]"
private static final String LOCAL_PART_REGEX = "^" + ALPHANUMERIC_NO_UNDERSCORE + "([" + SPECIAL_CHARACTERS + "]+"
+ ALPHANUMERIC_NO_UNDERSCORE + ")*";
private static final String DOMAIN_PART_REGEX = ALPHANUMERIC_NO_UNDERSCORE
+ "(-" + ALPHANUMERIC_NO_UNDERSCORE + ")*";
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/model/person/EmailTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public void isValidEmail() {
assertFalse(Email.isValidEmail("peter@jack@example.com")); // '@' symbol in local part
assertFalse(Email.isValidEmail("-peterjack@example.com")); // local part starts with a hyphen
assertFalse(Email.isValidEmail("peterjack-@example.com")); // local part ends with a hyphen
assertFalse(Email.isValidEmail("peter..jack@example.com")); // local part has two consecutive periods
assertFalse(Email.isValidEmail("peterjack@example@com")); // '@' symbol in domain name
assertFalse(Email.isValidEmail("peterjack@.example.com")); // domain name starts with a period
assertFalse(Email.isValidEmail("peterjack@example.com.")); // domain name ends with a period
Expand All @@ -57,6 +56,7 @@ public void isValidEmail() {
assertTrue(Email.isValidEmail("PeterJack.1190@example.com")); // period in local part
assertTrue(Email.isValidEmail("PeterJack+1190@example.com")); // '+' symbol in local part
assertTrue(Email.isValidEmail("PeterJack-1190@example.com")); // hyphen in local part
assertTrue(Email.isValidEmail("peter..jack@example.com")); // local part has two consecutive periods
assertTrue(Email.isValidEmail("a@bc")); // minimal
assertTrue(Email.isValidEmail("test@localhost")); // alphabets only
assertTrue(Email.isValidEmail("123@145")); // numeric local part and domain name
Expand Down

0 comments on commit 13f28d3

Please sign in to comment.