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(ras-acc): add config flag to skip newsletters signup modal #3404

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

chickenn00dle
Copy link
Contributor

@chickenn00dle chickenn00dle commented Sep 8, 2024

All Submissions:

Changes proposed in this Pull Request:

Closes https://app.asana.com/0/inbox/1206274567818680/1208232700780031/1208232700780049/f

This PR addresses an issue where if checkout data is present in local storage, the auth flow will always skip the newsletters signup step. We fix this by adding an explicit skipNewslettersSignup flag to the auth modal config object and using this to decide whether to bypass the newsletters modal instead.

How to test the changes in this Pull Request:

  1. As admin, ensure the Present newsletter signup after checkout and registration setting is enabled and newsletter lists are selected via Newspack > Engagement > Show Advanced Settings
  2. As a logged out reader, visit any page with a donate or checkout button
  3. Trigger the auth + checkout flow by clicking the button
  4. Do not submit the form. Instead close it via the close button at the top right of the modal
  5. Click the Sign in button in the site header to trigger just the auth flow
  6. Select the Create an account button in the auth modal and register a new account
  7. Confirm the newsletter signup modal appears as the final step of the auth flow

Bonus:

  • Smoke test the auth + checkout flow with newsletters signup modal
  • Smoke test accessing restricted content after purchasing the necessary subscription/donation product on the content restricted post/page (the page should reload AFTER auth/checkout is complete)

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 [Status] Needs Review The issue or pull request needs to be reviewed ras-acc testing labels Sep 9, 2024
@chickenn00dle chickenn00dle marked this pull request as ready for review September 9, 2024 00:33
@chickenn00dle chickenn00dle requested a review from a team as a code owner September 9, 2024 00:33
Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

Ah, I'm so glad you figured out how to recreate this! Before testing this PR, I confirmed I could get the newsletter modal to not-show following your steps on the epic/ras-acc branch.

This fix looks good! I ran through the test steps, plus smoke tested the checkout and registration modal, and the content gate. The newsletter form appeared when expected, and didn't once I ran out of newsletters.

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Sep 9, 2024
@chickenn00dle chickenn00dle merged commit 9c67e0f into epic/ras-acc Sep 9, 2024
10 checks passed
@chickenn00dle chickenn00dle deleted the fix/clear-checkout-store-on-auth branch September 9, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ras-acc testing [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants