Skip to content
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 form error messages #675

Merged
merged 19 commits into from
May 8, 2021
Merged

Add form error messages #675

merged 19 commits into from
May 8, 2021

Conversation

khainl1110
Copy link
Contributor

Added messages to user if they left any input fields empty or invalid
Resolves #660
image

Copy link
Collaborator

@aashrav aashrav left a comment

Choose a reason for hiding this comment

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

Looks good. Just remove the unnecessary lines I mentioned below

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@aashrav aashrav left a comment

Choose a reason for hiding this comment

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

Dope

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@IsitaB IsitaB left a comment

Choose a reason for hiding this comment

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

Change the way you handle invalid emails.

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@law-nguyen law-nguyen left a comment

Choose a reason for hiding this comment

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

Make sure you address the other comments and then rebase your code.

@khainl1110
Copy link
Contributor Author

khainl1110 commented Nov 5, 2020

The Travis bot keeps saying "Some checks haven't completed yet" and "Expected - Waiting for status to be reported". Can you help me out with that, thanks! I tried git push force but nothing changed.

Copy link
Collaborator

@IsitaB IsitaB left a comment

Choose a reason for hiding this comment

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

All tests succeed

@jerrylee17 jerrylee17 self-requested a review November 18, 2020 21:45
@jerrylee17
Copy link
Member

image

Copy link
Member

@jerrylee17 jerrylee17 left a comment

Choose a reason for hiding this comment

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

In addition to the email check, probably add a confirm password option

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
@khainl1110
Copy link
Contributor Author

image
This error is in verification_js, which I'm not working on

Copy link
Contributor

@seemavora seemavora left a comment

Choose a reason for hiding this comment

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

branch needs to be updated!

@khainl1110
Copy link
Contributor Author

Can you elaborate?

@seemavora
Copy link
Contributor

seemavora commented Jan 11, 2021

it says that your branch is 7 commits behind dev, meaning your branch is out of date. Checkout wiki for the steps to rebase, if its your first time me or isita can help you!

@khainl1110
Copy link
Contributor Author

oh ok, I will look into the wiki first and try to do it. Thanks

@khainl1110 khainl1110 force-pushed the membershipFormBug branch 2 times, most recently from 0a52d23 to f170478 Compare January 11, 2021 21:30
@khainl1110
Copy link
Contributor Author

Branch rebased

Copy link
Collaborator

@charlotte-zhuang charlotte-zhuang left a comment

Choose a reason for hiding this comment

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

There are some errors.

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
khainl1110 and others added 5 commits April 12, 2021 21:36
Co-authored-by: charlotte <61573792+charlotte-zhuang@users.noreply.github.com>
Co-authored-by: charlotte <61573792+charlotte-zhuang@users.noreply.github.com>
Co-authored-by: charlotte <61573792+charlotte-zhuang@users.noreply.github.com>
@khainl1110
Copy link
Contributor Author

I changed code as requested, thanks

Copy link
Collaborator

@charlotte-zhuang charlotte-zhuang left a comment

Choose a reason for hiding this comment

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

Check comments. PS it's nice to have a space before parentheses for non-functions like if () and before curly braces like function foo() {

The form isn't working either. Invalid password/email messages don't appear, and nothing happens when all input is valid.

I think it could help to simplify your name and account fields to have a checkRequirements attribute that points to a function to check requirements. If requirements are met, return { pass: true }. If requirements are not met, return { pass: false, message: <span>message here<span> }. Or something like that.

src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
src/Pages/MembershipApplication/MembershipForm.js Outdated Show resolved Hide resolved
khainl1110 and others added 3 commits April 22, 2021 20:28
Co-authored-by: charlotte <61573792+charlotte-zhuang@users.noreply.github.com>
Co-authored-by: charlotte <61573792+charlotte-zhuang@users.noreply.github.com>
@khainl1110
Copy link
Contributor Author

Fix some bugs

I think it could help to simplify your name and account fields to have a checkRequirements attribute that points to a function to check requirements. If requirements are met, return { pass: true }. If requirements are not met, return { pass: false, message: <span>message here<span> }. Or something like that.

There's addon and ifRequirementsNotMet, somebody before me did the addon part and I think it's meant to appear after the user click the submitted button, while ifRequirementsNotMet is for when user is filling out the form. I still don't get the 'checkRequirements' attribute part, like all of them point to a single function?

khainl1110 and others added 4 commits April 22, 2021 21:20
1. Removed addon attribute
2. Changed when alert messages appear
3. Fixed password validation
4. Make password requirements clearer
1. Changed submit button to type="submit"
2. Added Form component
3. There's a bug in Firefox where you can't scroll when a password field is selected. This might not be our problem as changing the input type to text fixes the issue.
Copy link
Collaborator

@charlotte-zhuang charlotte-zhuang left a comment

Choose a reason for hiding this comment

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

sorry, I went and just made the changes that still needed to be made

Changes

  1. Fixed a few bugs
  2. Removed addon attribute from form
  3. Changed invalid alerts to only show after user clicks submit
  4. Added more detailed password requirement feedback
  5. Wrapped the entire form in a Form component to allow users to submit with enter

Issues

  1. Firefox can't scroll when a password field is selected. Changing type="text" fixes the issue for some reason (but is undesirable).
  2. Some links and buttons aren't in the tab order. Adding tabindex="0" and role="tablist", role="tab" didn't change anything.

Pictures

Error Messages

Password Requirements

@khainl1110
Copy link
Contributor Author

khainl1110 commented Apr 27, 2021

thanks for improving the code, @charlotte-zhuang!

@charlotte-zhuang
Copy link
Collaborator

@khainl1110 I think you can merge this PR.

@khainl1110
Copy link
Contributor Author

@charlotte-zhuang it said merging is blocked for me, can you or someone do it instead? Thanks

@charlotte-zhuang charlotte-zhuang merged commit 0b61096 into dev May 8, 2021
@charlotte-zhuang charlotte-zhuang deleted the membershipFormBug branch May 8, 2021 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Membership Application Form Validation
7 participants