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

feat: added input validation in registration form #1376

Merged
merged 14 commits into from
Jan 6, 2024

Conversation

MahendraDani
Copy link
Contributor

What kind of change does this PR introduce?
bugfix

Issue Number:

Fixes #1222

Did you add tests for your changes?
No

Snapshots/Videos:

firstname field is invalid

screen-capture.mp4

lastname field is invalid

screen-capture.1.mp4

password field is invalid

0a5f6491-12c1-490a-9670-ba414a9e0e37.mp4

If relevant, did you update the documentation?
No

Summary

  1. Added input validation for firstname, lastname, email and password fields in registration form
  2. firstname and lastname can contain only lowercase or uppercase letters
  3. password should be of atleast 6 characters, it should contain atleast one lowercase letter, one uppercase letter, one numerical value and one special character.

Does this PR introduce a breaking change?
No

Other information

Have you read the contributing guide?

Yes

Copy link

github-actions bot commented Jan 5, 2024

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

@MahendraDani
Copy link
Contributor Author

MahendraDani commented Jan 5, 2024

I created a fresh PR for #1222
I am going to add translations for all languages and add tests.
cc @rishav-jha-mech @aashimawadhwa

Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6ba8db0) 97.22% compared to head (2a0d028) 97.36%.
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1376      +/-   ##
===========================================
+ Coverage    97.22%   97.36%   +0.13%     
===========================================
  Files          137      137              
  Lines         3429     3680     +251     
  Branches       964     1076     +112     
===========================================
+ Hits          3334     3583     +249     
- Misses          90       92       +2     
  Partials         5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MahendraDani
Copy link
Contributor Author

@rishav-jha-mech
I have added tests and translations.
Please let me know if there are changes.

@rishav-jha-mech
Copy link
Contributor

@MahendraDani since we are not showing the users beforehand what characters must be there while creating a password, you should add these texts in red colour below the password field, which will turn green with a check mark if that param is fulfulled

Like this:

  • ❌Password should be of atleast 6 characters
  • ❌one lowercase letter
  • ❌one uppercase letter
  • ❌one numerical value
  • ❌one special character.

When one or more of these params are fulfilled

  • ✅ Password should be of atleast 6 characters
  • ✅ one lowercase letter
  • ✅ one uppercase letter
  • ✅ one numerical value
  • ✅ one special character.

Showing the user after he is trying to submit the registration form, that their password is incorrect, isn't good from the UX perspective.

@MahendraDani
Copy link
Contributor Author

@MahendraDani since we are not showing the users beforehand what characters must be there while creating a password, you should add these texts in red colour below the password field, which will turn green with a check mark if that param is fulfulled

Like this:

  • ❌Password should be of atleast 6 characters
  • ❌one lowercase letter
  • ❌one uppercase letter
  • ❌one numerical value
  • ❌one special character.

When one or more of these params are fulfilled

  • ✅ Password should be of atleast 6 characters
  • ✅ one lowercase letter
  • ✅ one uppercase letter
  • ✅ one numerical value
  • ✅ one special character.

Showing the user after he is trying to submit the registration form, that their password is incorrect, isn't good from the UX perspective.

@MahendraDani since we are not showing the users beforehand what characters must be there while creating a password, you should add these texts in red colour below the password field, which will turn green with a check mark if that param is fulfulled

Like this:

  • ❌Password should be of atleast 6 characters
  • ❌one lowercase letter
  • ❌one uppercase letter
  • ❌one numerical value
  • ❌one special character.

When one or more of these params are fulfilled

  • ✅ Password should be of atleast 6 characters
  • ✅ one lowercase letter
  • ✅ one uppercase letter
  • ✅ one numerical value
  • ✅ one special character.

Showing the user after he is trying to submit the registration form, that their password is incorrect, isn't good from the UX perspective.

@rishav-jha-mech
Should I also use icons for ✅ and ❌ or just show text?

@rishav-jha-mech
Copy link
Contributor

@MahendraDani use mui for icons

@MahendraDani
Copy link
Contributor Author

@rishav-jha-mech
I created the UI as suggested by you, following is the demo

screen-capture.2.mp4

@rishav-jha-mech
Copy link
Contributor

@MahendraDani Good one !, increases the spacing between the first validation text password input field, and reduce the spacing b/w validation texts, also there is too much space b/w the last validation text and confirm password, fix that too then we will do a code review

@MahendraDani
Copy link
Contributor Author

@rishav-jha-mech I have improved the spacing between validation checks.

screen-capture.3.mp4

package-lock.json Outdated Show resolved Hide resolved
@palisadoes palisadoes merged commit 7482d75 into PalisadoesFoundation:develop Jan 6, 2024
9 checks passed
@MahendraDani
Copy link
Contributor Author

@rishav-jha-mech @palisadoes
Thanks for your help and guidance.

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.

3 participants