-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add All Errors #413
Add All Errors #413
Conversation
64a84d0
to
6546807
Compare
src/main/java/org/ladocuploader/app/submission/actions/ValidateBirthdate.java
Fixed
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateHomeAddress.java
Fixed
Show fixed
Hide fixed
src/main/java/org/ladocuploader/app/submission/actions/ValidateMailingAddress.java
Fixed
Show fixed
Hide fixed
src/main/java/org/ladocuploader/app/submission/actions/ValidateContactMethod.java
Fixed
Show fixed
Hide fixed
9707df4
to
c4be799
Compare
65bdfe1
to
f91ccd7
Compare
0ccad96
to
d17236e
Compare
src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateBirthdate.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateContactMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateHomeAddress.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateContactMethod.java
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/submission/actions/ValidateHomeAddress.java
Show resolved
Hide resolved
2f8f9c9
to
a1ba826
Compare
a1ba826
to
628c834
Compare
householdSsnInputs.add(""); | ||
} | ||
|
||
ArrayList<LinkedHashMap> householdMembers = (ArrayList) submission.getInputData().get("household"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section looks so much better ✨
Map<String, List<String>> errorMessages = new HashMap<>(); | ||
Map<String, Object> inputData = formSubmission.getFormData(); | ||
String day = (String) inputData.get("householdMemberBirthDay"); | ||
String month = (String) inputData.get("householdMemberBirthMonth"); | ||
String year = (String) inputData.get("householdMemberBirthYear"); | ||
|
||
// valid range does not enforce year so added an additional validation here | ||
if (!Pattern.matches("\\d{4}",year)) { | ||
errorMessages.put(INPUT_NAME, List.of(translateMessage("error.format-dob"))); | ||
} else if(!this.validRange(month+"/"+day+"/"+year)){ | ||
errorMessages.put(INPUT_NAME, List.of(translateMessage("error.invalid-dob"))); | ||
} | ||
|
||
return errorMessages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not crucial - this looks like it could be extracted into a common method with the inputData keys as params
private final String ZIP_INPUT_NAME = "mailingAddressZipCode"; | ||
|
||
@Override | ||
public Map<String, List<String>> runValidation(FormSubmission formSubmission, Submission submission) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - seems like some of this can also be extracted into a common method?
@@ -41,6 +43,9 @@ public String getHeader() { | |||
} | |||
|
|||
public void goBack() { | |||
await().atMost(20, TimeUnit.SECONDS).until( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make this like 5 seconds. If it's taking longer than that, we should look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sree-cfa by default await takes 10 seconds and it was failing. It is for one specific test and it is flaky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i extended it to an atMost and set it to 20 minutes so that the flaky test would be less flaky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
@Range(min=1, max=100) | ||
@NotBlank | ||
@Range(message="{error.invalid-range}", min=1, max=100) | ||
@NotBlank(message="{error.missing-general}") | ||
private String hoursPerWeek; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noticing that this isn't getting repopulated if I go back to edit a user's information.
Perhaps this could be solved in a different PR, though, so this doesn't hold up this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Page jobHoursPerWeek
If you fill out that page, click continue and then go back the data isn't there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bseeger - I looked into this one and it's unrelated to my PR but it is a fun find!
That page is using the Number template which is looking for the input key in the the input; however hours worked is nested so it can never find that value and therefore always defaults to blank: https://github.com/codeforamerica/la-doc-uploader/blob/738c4cfde27e76322cf0a3bd6c18264bebee4873/src/main/resources/templates/fragments/inputs/number.html#L27C15-L27C15
The number fragment is being used in the LA doc uploader so I think it will require a bit digging into to understand the implications of the change. SO for now, creating a follow up ticket (https://app.asana.com/0/1204547723915585/1206144609816303/f)
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
Outdated
Show resolved
Hide resolved
eb6b25b
to
c503e03
Compare
No description provided.