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

Correctly sync planId between PremiumContent and Payments block #47944

Merged

Conversation

stacimc
Copy link
Contributor

@stacimc stacimc commented Dec 2, 2020

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 the planId 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

  • Create a post and insert a premium content block
  • Preview the post and inspect the subscribe button. Note the planId in the url:

Screen Shot 2020-12-01 at 5 04 51 PM

* 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

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.
@matticbot
Copy link
Contributor

@stacimc stacimc added Premium Content Controlling specific content for paying site visitors. [Type] Bug labels Dec 2, 2020
@stacimc stacimc requested a review from a team December 2, 2020 01:08
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 2, 2020
@stacimc stacimc self-assigned this Dec 2, 2020
@matticbot
Copy link
Contributor

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.

@matticbot
Copy link
Contributor

Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

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

@ockham ockham mentioned this pull request Dec 2, 2020
31 tasks
Copy link
Member

@apeatling apeatling left a 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. 👍

@stacimc stacimc merged commit eac073f into trunk Dec 2, 2020
@stacimc stacimc deleted the fix/sync-planId-between-premium-content-and-payments branch December 2, 2020 17:42
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 2, 2020
apeatling added a commit to Automattic/jetpack that referenced this pull request Dec 2, 2020
apeatling added a commit to Automattic/jetpack that referenced this pull request Dec 9, 2020
apeatling added a commit to Automattic/jetpack that referenced this pull request Dec 16, 2020
stacimc pushed a commit to Automattic/jetpack that referenced this pull request Jan 5, 2021
apeatling added a commit to Automattic/jetpack that referenced this pull request Jan 11, 2021
stacimc pushed a commit to Automattic/jetpack that referenced this pull request Jan 13, 2021
apeatling added a commit to Automattic/jetpack that referenced this pull request Jan 20, 2021
* 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>
matticbot pushed a commit to Automattic/jetpack-production that referenced this pull request Jan 20, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Premium Content Controlling specific content for paying site visitors. [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Premium Content Block] Issues with multiple pricing plans
3 participants