-
Notifications
You must be signed in to change notification settings - Fork 43
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/donate block tiers layout #1311
Conversation
Haven't reviewed yet, but for this:
I'd suggest just "Frequency" and "Tiers". |
This is cool! I'm very pleased with this. Just a few questions/suggestions:
|
Done in 49a99ef :
Please submit a separate issue for this, this PR is pretty large as it is. |
1260b51
to
d7bca81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big new feature—thanks for implementing! It's mostly clean, and I confirmed that existing Donate blocks continue to behave nicely with the new features as well.
I did run into some issues, some questions, and some non-blocking nitpicks.
src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-tiers-based.php
Show resolved
Hide resolved
src/blocks/donate/frontend/class-newspack-blocks-donate-renderer-tiers-based.php
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing some new behavior now which needs mitigation.
For some reason, on the front-end the block form loads without a selected state. Confirmed that this happens for both new and pre-existing block instances, and both manually-configured and default settings. The block looks like this on initial page load, and doesn't show any tier info until I click on the Monthly or Annual tabs:
-
When I submit the form, the JS doesn't seem to capture the submit event. On AMP or AMP Plus, the page simply reloads with my form inputs appended to the URL (as in default HTML form submit behavior), and on non-AMP, submitting the form does nothing. -
If the default Reader Revenue > Donation settings are untiered, then "Tiers" still appears as a layout option for Donate blocks, but is unselectable.
All issues confirmed resolved after the latest round of changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adekbadek thank you for all of the updates and improvements on this PR. Getting really close now. There are still a couple of minor unresolved threads above, and I found another minor bug which I hadn't noticed before.
On the Stripe-enabled block, if you submit a tiered form by filling out all required fields and hitting "enter" (on the keyboard), the form display goes back to the initial view with all tiers, and the success message isn't visible.
Fixed in de2ae2b!
Can't reproduce that. As concluded in a DM, this is not reproducible, must've been a build issue.
Fixed in de6212e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preapproving since the last remaining thread may not be an issue at all. Feel free to merge after @thomasguillot weighs in on the desired behavior.
# [1.60.0-alpha.1](v1.59.1...v1.60.0-alpha.1) (2022-12-20) ### Bug Fixes * allow all img tag attributes in avatar output ([#1333](#1333)) ([2f57019](2f57019)) ### Features * **donate block:** tiers layout ([#1311](#1311)) ([9228ee4](9228ee4)) * handle 'other' reader revenue platform in the editor ([0e6ca8a](0e6ca8a))
🎉 This PR is included in version 1.60.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.60.0](v1.59.1...v1.60.0) (2023-01-09) ### Bug Fixes * allow all img tag attributes in avatar output ([#1333](#1333)) ([2f57019](2f57019)) ### Features * **donate block:** tiers layout ([#1311](#1311)) ([9228ee4](9228ee4)) * **donate:** additional fields on the form ([#1330](#1330)) ([1f6869d](1f6869d)) * handle 'other' reader revenue platform in the editor ([0e6ca8a](0e6ca8a)) * unregister Jetpack Subscriptions block to avoid confusion with Newspack blocks ([#1337](#1337)) ([7dab5fc](7dab5fc))
🎉 This PR is included in version 1.60.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Adds an alternative, "tiers-based" layout to the Donate block:
Above in the "Alternate" block style version
It's called "Tiers-based" layout (vs. the default "Frequency-based" layout), but I'm not sure about the naming here. Suggestions are welcome.
Closes https://github.com/Automattic/newspack-product/issues/53
How to test the changes in this Pull Request:
master
, create a page with three Donate blocks, set each to different styleOther information: