-
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
Correctly sync planId between PremiumContent and Payments block #47944
Correctly sync planId between PremiumContent and Payments block #47944
Conversation
Correctly passes the subscribeButton prop in to the Buttons block so that it can sync the planId between Premium Content and its nested Recurring Payments block.
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. |
Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com D53598-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2 |
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.
Confirmed this is now working correctly. 👍
* First pass at moving over the premium content block from editing toolkit to Jetpack. * Fix include paths. * Add premium content plan requirement, and allow the block to skip the jetpack/ prefix. This will let existing users transition without interruption. * Correctly register child blocks. * Add Premium content child blocks to the paid plan check. * Move the container block to the root, and register the child blocks via the child block functionality built into the Jetpack register block function. * Add the editor css styles. * Include the server side render functions for child blocks. * Add fix for Automattic/wp-calypso#47944 * Allow login and buttons blocks to appear in the inserter and be inserted independently. This matches the ETK version of the block. * Update the default template content for the subscriber view. * Fix icon.js lint errors * First pass at fixing PHP linting errors. * Replace all full-site-editing textdomain usage. * Second pass at PHP lint errors. * Third pass at PHP lint errors. * Final pass at php lint issues. * Remove references to Dashicon component. * Keep deprectated setup consistent across blocks. * Incorporate changes from @stacimc's PR Automattic/wp-calypso#47388 * Fix phpcs issues. * Remove upgrade nudges New functionality will be added in follow-up PRs. * Use prefix instead of noPrefix for remvoing the Jetpack prefix. * Better block descriptions. * Add missing translation. * Move to shared icon store. * Prepend action with jetpack_ and document. * Convert all indentation to tabs. * Plan checks for premium content buttons and login button. * Remove tabs.js since it's no longer used. * Remove log2logstash because this is not available outside of WordPress.com * Only load the premium content blocks on WordPress.com. * Use shared supported currencies data. * Remove plan check from buttons blocks and instead hide from inserter. Move to experimental blocks. * Make sure the block loads on Atomic sites that do not use IS_WPCOM * Add get_current_user() call. * Fix phpcs issues. * Consolidate currency functions * Switch to Gutenberg colors * Add missing translations * Ensure CSS gets enqueued on the frontend * Add inline docs for filters * Fix reference to Subscription_Service * Add missing arguments when rendering legacy buttons * Merge in fix for block transformations menu, to ensure the block preview is disarmed The fix was originally merged into wp-calypso in: Automattic/wp-calypso#48988 * Try fixing linting issues * Add our new js files to the lint exclude list for now * Revert "Add our new js files to the lint exclude list for now" This reverts commit f1498e9. * Try to address all linting warnings in new files I've taken the opportunity to suppress some of those warnings for all extensions, as I do not think they can be realistically all filled for all our blocks at the moment. * Remove file from excludelist now that it is free of linting errors Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Staci Cooper <staci.cooper@automattic.com> Co-authored-by: Jeremy Herve <jeremy@jeremy.hu> Co-authored-by: Andrew Serong <andrewserong@users.noreply.github.com>
* First pass at moving over the premium content block from editing toolkit to Jetpack. * Fix include paths. * Add premium content plan requirement, and allow the block to skip the jetpack/ prefix. This will let existing users transition without interruption. * Correctly register child blocks. * Add Premium content child blocks to the paid plan check. * Move the container block to the root, and register the child blocks via the child block functionality built into the Jetpack register block function. * Add the editor css styles. * Include the server side render functions for child blocks. * Add fix for Automattic/wp-calypso#47944 * Allow login and buttons blocks to appear in the inserter and be inserted independently. This matches the ETK version of the block. * Update the default template content for the subscriber view. * Fix icon.js lint errors * First pass at fixing PHP linting errors. * Replace all full-site-editing textdomain usage. * Second pass at PHP lint errors. * Third pass at PHP lint errors. * Final pass at php lint issues. * Remove references to Dashicon component. * Keep deprectated setup consistent across blocks. * Incorporate changes from @stacimc's PR Automattic/wp-calypso#47388 * Fix phpcs issues. * Remove upgrade nudges New functionality will be added in follow-up PRs. * Use prefix instead of noPrefix for remvoing the Jetpack prefix. * Better block descriptions. * Add missing translation. * Move to shared icon store. * Prepend action with jetpack_ and document. * Convert all indentation to tabs. * Plan checks for premium content buttons and login button. * Remove tabs.js since it's no longer used. * Remove log2logstash because this is not available outside of WordPress.com * Only load the premium content blocks on WordPress.com. * Use shared supported currencies data. * Remove plan check from buttons blocks and instead hide from inserter. Move to experimental blocks. * Make sure the block loads on Atomic sites that do not use IS_WPCOM * Add get_current_user() call. * Fix phpcs issues. * Consolidate currency functions * Switch to Gutenberg colors * Add missing translations * Ensure CSS gets enqueued on the frontend * Add inline docs for filters * Fix reference to Subscription_Service * Add missing arguments when rendering legacy buttons * Merge in fix for block transformations menu, to ensure the block preview is disarmed The fix was originally merged into wp-calypso in: Automattic/wp-calypso#48988 * Try fixing linting issues * Add our new js files to the lint exclude list for now * Revert "Add our new js files to the lint exclude list for now" This reverts commit f1498e9f551998e1a80e2e9cb2c550b854e54094. * Try to address all linting warnings in new files I've taken the opportunity to suppress some of those warnings for all extensions, as I do not think they can be realistically all filled for all our blocks at the moment. * Remove file from excludelist now that it is free of linting errors Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Staci Cooper <staci.cooper@automattic.com> Co-authored-by: Jeremy Herve <jeremy@jeremy.hu> Co-authored-by: Andrew Serong <andrewserong@users.noreply.github.com>\n\nCommitted via a GitHub action: https://github.com/automattic/jetpack/runs/499322406
Changes proposed in this Pull Request
There was a syntax error causing the subscribeButton to not be passed in correctly as a prop to the Premium Content's
Buttons
block. This caused theplanId
to not sync correctly between the two. As a consequence, if the user updated the plan on their Premium Content block from the default, it was not being updated on the Payments button, which would continue pointing to a url for subscribing to the default plan.This PR correctly passes the subscribeButton in through props, allowing the syncing to function correctly again.
Testing instructions
* Return to the editor and select a different plan for the premium content block (for example, change from $5/month to $10/month) * Preview the post again and inspect the subscribe button. Verify that the planId in the url has changed.
Fixes #47939