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(subscription-block): remove default list when misconfigured #1608

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Aug 12, 2024

All Submissions:

Changes proposed in this Pull Request:

1200530782742699-as-1207876225097086

Changes how we handle the subscription form block when a subscription list becomes unavailable. The current behavior defaults to the first list available when none of the configured lists are found, which is not ideal.

If none of the lists are found, the form should not render and the editor should display a notice so it can be revised and fixed:

image

If the form has multiple lists selected and at least 1 one exists, the render is preserved with the lists available. While editing the page, the block should still display a notice to alert the editor that the block is not reflecting all the intended lists.

When adding a Newsletter Subscription Form block for the first time, the default behavior should still be auto-selecting the first available list for convenience.

How to test the changes in this Pull Request:

  1. Check out this branch and make sure you have an ESP connected with at least 3 subscription lists available
  2. Edit a page and add the Newsletter Subscription Form block
  3. Confirm the first available list is selected by default
  4. Deactivate the subscription list in the Newsletters' settings page (make sure you have others enabled as well)
  5. Visit the page and confirm the form no longer renders
  6. Edit the page and confirm you see the notice as in the image above
  7. Change the selection and confirm the notice disappears
  8. Save the page, visit, and confirm the form renders
  9. Edit the page again and select multiple lists
  10. Deactivate one of them in the Newsletters' settings
  11. Visit the page and confirm the deactivated list is not listed but others are
  12. Edit the page and confirm the selection is preserved and you also get the same notice as above

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?

@miguelpeixe miguelpeixe self-assigned this Aug 12, 2024
@miguelpeixe miguelpeixe requested a review from a team as a code owner August 12, 2024 14:54
Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

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

Works as described

@miguelpeixe miguelpeixe merged commit 6d0b440 into trunk Aug 14, 2024
7 checks passed
@miguelpeixe miguelpeixe deleted the fix/subscription-block-default-list branch August 14, 2024 13:26
matticbot pushed a commit that referenced this pull request Aug 15, 2024
# [3.1.0-alpha.1](v3.0.0...v3.1.0-alpha.1) (2024-08-15)

### Bug Fixes

* add preview text fallback to make sure HTML is removed ([b4de251](b4de251))
* human-readable timestamp of sent newsletters ([#1590](#1590)) ([c3ddd29](c3ddd29))
* **subscription-block:** remove default list when misconfigured ([#1608](#1608)) ([6d0b440](6d0b440))

### Features

* consolidate data flows ([#1602](#1602)) ([dd56ab8](dd56ab8)), closes [#1567](#1567) [#1593](#1593) [#1601](#1601)
@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 26, 2024
# [3.1.0](v3.0.1...v3.1.0) (2024-08-26)

### Bug Fixes

* add preview text fallback to make sure HTML is removed ([b4de251](b4de251))
* human-readable timestamp of sent newsletters ([#1590](#1590)) ([c3ddd29](c3ddd29))
* **subscription-block:** remove default list when misconfigured ([#1608](#1608)) ([6d0b440](6d0b440))

### Features

* consolidate data flows ([#1602](#1602)) ([dd56ab8](dd56ab8)), closes [#1567](#1567) [#1593](#1593) [#1601](#1601)
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants