-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Earn: Add a plans check to the Donations block. #43088
Conversation
This doesn't work yet. |
Caution: This PR affects files in the FSE Plugin on WordPress.com D44610-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2 |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
apps/full-site-editing/full-site-editing-plugin/donations/edit.js
Outdated
Show resolved
Hide resolved
30f34d9
to
ef280b4
Compare
This should be ready to go. The Stripe prompt and full Donations block functionality will be handled in later PRs. |
apps/full-site-editing/full-site-editing-plugin/donations/fetch-status.js
Show resolved
Hide resolved
apps/full-site-editing/full-site-editing-plugin/donations/fetch-status.js
Show resolved
Hide resolved
Whoops I ran out of time Kirk, the misc notes I added aren't important, I'll go through manual testing steps tomorrow if folks don't beat me to it |
apps/full-site-editing/full-site-editing-plugin/donations/upgrade-plan.js
Outdated
Show resolved
Hide resolved
apps/full-site-editing/full-site-editing-plugin/donations/upgrade-plan.js
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.
I'm not sure if I'm missing any step, but the upgrade nudge doesn't show up for me when testing on a site not having a paid plan.
Scratch that, I didn't have the branch updated. It works great!
Verified that blocking the request from the dev tools shows a proper message.
Once upgraded, the tabs are displayed as expected.
Also noted multiple requests are fired, likely because we run the effect on every component update. Feel free to land if folks tidy the case, no need for re-review.
apps/full-site-editing/full-site-editing-plugin/donations/edit.js
Outdated
Show resolved
Hide resolved
apps/full-site-editing/full-site-editing-plugin/donations/edit.js
Outdated
Show resolved
Hide resolved
apps/full-site-editing/full-site-editing-plugin/donations/fetch-status.js
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.
This tests well for me @kwight and should be safe to land. Overall we might want to think about how to make the upgrade flow a little easier for folks, but this is an existing issue for other blocks as well.
This PR adds a check for a valid plan when inserting the Donations block, and displays a prompt to upgrade if the user is required to do so. Based on the Premium Content block process.
See: #42856
Testing instructions
yarn dev --sync
to sync the changes to your sandbox./wp-admin/post-new.php
.https://public-api.wordpress.com/wpcom/v2/sites/:site_id/memberships/status
.