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

fix: Registration occurs with a password that does not meet the requirements to Quince #1182

Conversation

DmytroAlipov
Copy link
Contributor

@DmytroAlipov DmytroAlipov commented Feb 29, 2024

This is a backport from the master branch.

Description

The behavior of the registration form is very different from the behavior of this form for the Palm release.
Even with incorrectly filled fields, the form can still be submitted. In certain instances, registration may succeed, such as when the password consists of merely two characters.

There’s an issue where the error message doesn’t disappear even after the error is corrected and the focus is shifted to another field. Here’s how to reproduce it:

  1. Fill in all fields correctly.
  2. Enter a username or email with a space.
  3. Submit a request to create an account.
  4. An error will appear in the field where there is a space.
  5. The cursor should already be in the field with the error (so there’s no need to click on this field again). Remove the space.
  6. Move the cursor to another field.
  7. The error message remains for the field where the space was initially present, even though it has been corrected.

My proposals are aimed at returning the behavior as happened on Palm.

PS: I’ve noticed that you’ve been conducting numerous experiments on the master branch. To avoid any conflicts, I’ve refrained from making these changes directly to the master. If there are any upcoming plans for the registration page, please consider these issues before the release of Redwood.

Screenshots/sandbox (optional):

  • Before

screen_3

after clicking on "Create an account for free" button (the request to the backend is still sent even if there is a space):
screen_4

  • After

prevent a request to the backend if the password does not meet the conditions:
screen_1

screen_2

Post-merge Checklist

  • Deploy the changes to prod after verifying on stage or ask @openedx/2u-vanguards to do it.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

@openedx-webhooks
Copy link

Thanks for the pull request, @DmytroAlipov! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 29, 2024
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (open-release/quince.master@abea379). Click here to learn what that means.

Additional details and impacted files
@@                      Coverage Diff                      @@
##             open-release/quince.master    #1182   +/-   ##
=============================================================
  Coverage                              ?   87.14%           
=============================================================
  Files                                 ?      124           
  Lines                                 ?     2295           
  Branches                              ?      635           
=============================================================
  Hits                                  ?     2000           
  Misses                                ?      286           
  Partials                              ?        9           

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

@arbrandes
Copy link

@DmytroAlipov, nice catch, thanks! Can you submit a PR to master first, if it doesn't already exist? If it does, can you point to it here?

@DmytroAlipov
Copy link
Contributor Author

Hi @arbrandes I noticed that experiments were being conducted in the master branch of this MFE. I wanted to ask the contributors whether changes should be made to the master branch.

@DmytroAlipov
Copy link
Contributor Author

@DmytroAlipov, nice catch, thanks! Can you submit a PR to master first, if it doesn't already exist? If it does, can you point to it here?

done

@DmytroAlipov DmytroAlipov changed the title fix: Registration occurs with a password that does not meet the requirements fix: Registration occurs with a password that does not meet the requirements to Quince Mar 1, 2024
@DmytroAlipov DmytroAlipov force-pushed the fix-registration-page-quince branch 2 times, most recently from f30d62e to ad8d780 Compare March 11, 2024 12:23
@DmytroAlipov
Copy link
Contributor Author

@arbrandes @syedsajjadkazmii Everything is done for both Master and Quince.

@DmytroAlipov DmytroAlipov force-pushed the fix-registration-page-quince branch 2 times, most recently from 988fead to 868dc63 Compare March 13, 2024 10:34
@arbrandes
Copy link

Great! Let's wait to merge this until the master PR lands, though.

@syedsajjadkazmii
Copy link
Contributor

Hi @DmytroAlipov, master PR have been merged. Please look at this comment and make that change in this branch too.

@DmytroAlipov
Copy link
Contributor Author

Hi @syedsajjadkazmii
If we are talking about this, then I already did this when it was changed in the master:

if (registrationError[name]) {
  dispatch(clearRegistrationBackendError(name));
}

import validateName from '../RegistrationFields/NameField/validator';
import validateUsername from '../RegistrationFields/UsernameField/validator';

export const emailRegex = new RegExp(VALID_EMAIL_REGEX, 'i');
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @syedsajjadkazmii
Why remove validateUsername and validateName? Or was this noted by chance?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @syedsajjadkazmii Why remove validateUsername and validateName? Or was this noted by chance?

I only meant for emailRegex. Github picked those lines as well. :)

@syedsajjadkazmii syedsajjadkazmii merged commit 9f503eb into openedx:open-release/quince.master Mar 18, 2024
7 checks passed
@openedx-webhooks
Copy link

@DmytroAlipov 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@DmytroAlipov DmytroAlipov deleted the fix-registration-page-quince branch March 18, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants