Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Bug - Fix PED issues #191

Merged
merged 4 commits into from
Apr 8, 2022

Conversation

joszx
Copy link
Collaborator

@joszx joszx commented Apr 6, 2022

Fix PED issues

Key Summary

  • Modified email regex to require top level domain, i.e. ".com", as well as relevant test cases
  • Update main window and reminder window UI pictures in docs/images
  • Define duplicate applications, applications with the same name, job title and optional tags are not allowed
  • Update Add and edit commands to not allow duplicate applications
  • Add and modify test cases related to duplicated applications

Other Updates

  • Images in UG and index.md now show the latest application UI
  • Name, job title and optional tags are case insensitive i.e. application with same fields except name "grab" and "Grab" are considered 2 different applications
  • Manually tested each add and edit command with respect to duplicate applications
  • Update add and edit command duplicate applications error message
  • All Automated tests passed 267/267

Fix #171, #152, #150, #146

Make changes to valid email regex to require top level domain e.g ".com"
Modify and add test cases regarding valid email
Modify add and edit command duplicate application messages.
Change how application checks for a duplicate application.
Add and tweak test cases regarding duplicate applications.
Add note and FAQ on duplicate applications to UG.
@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2022

Codecov Report

Merging #191 (146b076) into master (54a7e48) will increase coverage by 0.15%.
The diff coverage is 90.90%.

@@             Coverage Diff              @@
##             master     #191      +/-   ##
============================================
+ Coverage     61.95%   62.10%   +0.15%     
- Complexity      475      482       +7     
============================================
  Files            96       96              
  Lines          1853     1871      +18     
  Branches        227      232       +5     
============================================
+ Hits           1148     1162      +14     
- Misses          635      639       +4     
  Partials         70       70              
Impacted Files Coverage Δ
.../java/seedu/address/logic/commands/AddCommand.java 100.00% <ø> (ø)
...java/seedu/address/logic/commands/EditCommand.java 86.32% <ø> (ø)
...in/java/seedu/address/model/application/Email.java 80.00% <ø> (ø)
...a/seedu/address/model/application/Application.java 79.01% <90.90%> (+1.54%) ⬆️
.../java/seedu/address/model/tag/PriorityTagType.java 92.30% <0.00%> (-7.70%) ⬇️
...a/seedu/address/logic/sort/PriorityComparator.java 0.00% <0.00%> (ø)
...du/address/logic/sort/InterviewSlotComparator.java 0.00% <0.00%> (ø)
...seedu/address/model/application/InterviewSlot.java 71.42% <0.00%> (+1.05%) ⬆️
...java/seedu/address/model/application/JobTitle.java 80.00% <0.00%> (+10.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54a7e48...146b076. Read the comment docs.

Comment on lines 25 to +34
// 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 + "]"
+ ALPHANUMERIC_NO_UNDERSCORE + ")*";
private static final String DOMAIN_PART_REGEX = ALPHANUMERIC_NO_UNDERSCORE
+ "(-" + ALPHANUMERIC_NO_UNDERSCORE + ")*";
private static final String DOMAIN_LAST_PART_REGEX = "(" + DOMAIN_PART_REGEX + "){2,}$"; // At least two chars
private static final String DOMAIN_REGEX = "(" + DOMAIN_PART_REGEX + "\\.)*" + DOMAIN_LAST_PART_REGEX;
private static final String DOMAIN_MIDDLE_PART_REGEX = "(\\.*(" + DOMAIN_PART_REGEX + ")+)*\\."; // Multiple .co.in
private static final String DOMAIN_REGEX = "(" + DOMAIN_PART_REGEX + ")+" + DOMAIN_MIDDLE_PART_REGEX
+ DOMAIN_LAST_PART_REGEX;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice regex checking!

This might be useful too: https://stackoverflow.com/questions/624581/what-is-the-best-java-email-address-validation-method, but as mentioned in the comments of the first post there might be some edge cases as well

Other than the suggestion, LGTM!

@lchokhoe lchokhoe merged commit da895a4 into AY2122S2-CS2103T-T11-3:master Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants