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: replace recaptcha alerts with generic errors #3627

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Dec 12, 2024

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/1207817176293825/1208950357031079/f

This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.

Checkout modal (passes custom error handler when rendering recaptcha):
Screenshot 2024-12-13 at 13 02 47

Registration modal (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 05 41

Newsletters subscribe block (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 06 29

Registration block (uses 'default' recaptcha error):
Screenshot 2024-12-13 at 13 07 47

How to test the changes in this Pull Request:

Checkout the following Newsletters PR before testing: Automattic/newspack-newsletters#1724

  • Setup recaptcha v2, RAS, and the various blocks necessary to test the above forms
  • Change the following line to: callback: () => errorCallback( 'There was an error with reCAPTCHA. Please try again.' ),. This will trigger an error even when recaptcha is successful for testing purposes.
  • Submit each of above forms as reader, and verify the recaptcha errors look fine.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@chickenn00dle chickenn00dle added ras-acc testing [Status] Needs Review The issue or pull request needs to be reviewed labels Dec 12, 2024
@chickenn00dle chickenn00dle marked this pull request as ready for review December 13, 2024 18:11
@chickenn00dle chickenn00dle requested a review from a team as a code owner December 13, 2024 18:11
@chickenn00dle chickenn00dle force-pushed the fix/handle-recaptcha-errors branch from 4ec9675 to 35f34c6 Compare December 16, 2024 17:09
@chickenn00dle chickenn00dle merged commit 44ef2d2 into trunk Dec 16, 2024
7 checks passed
@chickenn00dle chickenn00dle deleted the fix/handle-recaptcha-errors branch December 16, 2024 17:19
Copy link

Hey @chickenn00dle, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

chickenn00dle added a commit that referenced this pull request Dec 16, 2024
This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.
chickenn00dle added a commit that referenced this pull request Dec 16, 2024
This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.
dkoo added a commit that referenced this pull request Dec 17, 2024
* fix(recaptcha): replace alerts with generic errors (#3627)

This PR replaces the default recaptcha failure alert behavior with generic errors appended to the relevant forms.

* fix(recaptcha): only render on submit

* fix: auto retry on recaptcha render failure

* fix: add button event listener early

* fix(recaptcha): render on focus

* fix: specify recaptcha container

* fix: account for refresh

* fix: restore scroll-into-view when rendering v2 widget

* fix: scroll in iframes

* fix: refresh v2 widgets on Woo checkout update or error

---------

Co-authored-by: dkoo <[email protected]>
matticbot pushed a commit that referenced this pull request Dec 17, 2024
## [5.10.2](v5.10.1...v5.10.2) (2024-12-17)

### Bug Fixes

* **recaptcha:** various optimizations ([#3631](#3631)) ([5d816bc](5d816bc)), closes [#3627](#3627)
matticbot pushed a commit that referenced this pull request Jan 10, 2025
## [5.10.7-alpha.1](v5.10.6...v5.10.7-alpha.1) (2025-01-10)

### Bug Fixes

* **cli:** verify-reader CLI command ([#3660](#3660)) ([c639af7](c639af7))
* **recaptcha:** replace alerts with generic errors ([#3627](#3627)) ([44ef2d2](44ef2d2))

### Performance Improvements

* **data-events:** queue dispatches to execute on shutdown ([#3616](#3616)) ([510a1a0](510a1a0))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.10.7-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 14, 2025
# [5.12.0-alpha.1](v5.11.1...v5.12.0-alpha.1) (2025-01-14)

### Bug Fixes

* **cli:** verify-reader CLI command ([#3660](#3660)) ([c639af7](c639af7))
* **recaptcha:** replace alerts with generic errors ([#3627](#3627)) ([44ef2d2](44ef2d2))
* remove newspack_corrections_ids meta ([#3675](#3675)) ([dad258b](dad258b))

### Features

* **corrections:** add corrections and clarifications behind feature flag ([#3638](#3638)) ([ea745cf](ea745cf))

### Performance Improvements

* **data-events:** queue dispatches to execute on shutdown ([#3616](#3616)) ([510a1a0](510a1a0))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.12.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Jan 20, 2025
# [5.12.0](v5.11.3...v5.12.0) (2025-01-20)

### Bug Fixes

* **cli:** verify-reader CLI command ([#3660](#3660)) ([c639af7](c639af7))
* **recaptcha:** replace alerts with generic errors ([#3627](#3627)) ([44ef2d2](44ef2d2))
* remove newspack_corrections_ids meta ([#3675](#3675)) ([dad258b](dad258b))
* **wcs:** migrate-expired-subscriptions handle manual subscriptions ([#3663](#3663)) ([e0f32e8](e0f32e8))

### Features

* **corrections:** add corrections and clarifications behind feature flag ([#3638](#3638)) ([ea745cf](ea745cf))

### Performance Improvements

* **data-events:** queue dispatches to execute on shutdown ([#3616](#3616)) ([510a1a0](510a1a0))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants