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

Recurring Payments: Replace submit button #15915

Merged

Conversation

aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw commented May 25, 2020

Fixes #15713

Changes proposed in this Pull Request:

  • Replace the SubmitButton in the Recurring Payments block with new shared Button block.

Does this pull request change what data or activity we track or use?

No.

Prerequisites

  • Sandboxed public-api.wordpress.com and subscribe.wordpress.com. See instructions for sandboxing for Recurring Payments in the Field Guide.
  • Site connected to Stripe and a plan created.
  • A post with a Recurring Payment block added prior to checking out this PR branch.

Testing instructions:

  1. On the frontend, visit post containing previous version of Recurring Payments block.
  2. Confirm the blocks display and function as they did when you set them up.
    Button should still be contained within div with .wp-block-button class.
  3. Edit the post.
  4. Confirm the Recurring Payment block still appears correctly and its settings are correct.
  5. Update the Recurring Payment button using the new settings controls provided by button block.
  6. Add new Recurring Payment block select a plan. Ensure the button text is updated with text including the price of the plan selected.
  7. Save the post.
  8. Re-visit the post on the frontend and confirm display and function of Recurring Payment block.

Before:

Screen Shot 2020-05-25 at 2 53 25 pm

After:

Screen Shot 2020-05-25 at 2 50 03 pm

Proposed changelog entry for your changes:

  • Update Recurring Payments block to use new shared Button block

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello aaronrobertshaw! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D43891-code before merging this PR. Thank you!
This revision will be updated with each commit to this PR

@jetpackbot
Copy link

jetpackbot commented May 25, 2020

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-15915

Scheduled Jetpack release: August 4, 2020.
Scheduled code freeze: July 28, 2020

Generated by 🚫 dangerJS against c6f45df

@aaronrobertshaw
Copy link
Contributor Author

This block apparently allows for custom button HTML attributes from WPCOM VIP sites. I don't know how to test with VIP sites or even how their versions of this block might differ.

If anyone can point me in the right direction of what needs doing, that would be great.

@aaronrobertshaw aaronrobertshaw changed the title [WIP] Recurring Payments: Replace submit button Recurring Payments: Replace submit button May 26, 2020
@aaronrobertshaw aaronrobertshaw marked this pull request as ready for review May 26, 2020 01:15
@aaronrobertshaw aaronrobertshaw added [Block] Button [Block] Payment Button aka Recurring Payments [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Status] In Progress [Status] Needs Team Review and removed [Status] Needs Team Review [Status] In Progress labels May 26, 2020
@jeherve jeherve added this to the 8.7 milestone May 29, 2020
@aaronrobertshaw aaronrobertshaw force-pushed the update/replace-recurring-payments-submit-button branch from 5115bc6 to fd2921f Compare June 12, 2020 04:16
@jeherve jeherve removed this from the 8.7 milestone Jun 29, 2020
@scruffian
Copy link
Member

I've tested this and it works as advertised. I'll look at the code tomorrow 👍

scruffian
scruffian previously approved these changes Jul 1, 2020
Copy link
Member

@scruffian scruffian left a comment

Choose a reason for hiding this comment

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

Code changes LGTM 👍

@scruffian scruffian added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Team Review labels Jul 1, 2020
@aaronrobertshaw aaronrobertshaw force-pushed the update/replace-recurring-payments-submit-button branch from 8fdc722 to e21d5a7 Compare July 7, 2020 08:58
@aaronrobertshaw
Copy link
Contributor Author

@glendaviesnz I've rebased this PR and resolved the conflict.

It could use another quick test to have someone else confirm the custom button text remains when switching plans for the block. I've updated the test instructions and tested the block myself and it's working for me.

@fgiannar fgiannar added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jul 13, 2020
Now we have a shared Button component we can replace the SubmitButton used in some blocks to provide more consistent and additional features.
It turned out that all the VIP uses of the button just called render button directly passing attributes. As these won't pass inner block content they are treated as deprecated buttons for rendering. This means we won't be getting submitButtonAttributes while rendering the newest versions of the block added through the editor.
@aaronrobertshaw aaronrobertshaw force-pushed the update/replace-recurring-payments-submit-button branch from e21d5a7 to c6f45df Compare July 14, 2020 01:58
@aaronrobertshaw
Copy link
Contributor Author

Hi @fgiannar ,

Thanks for testing this one.

Not being easily able to select the parent block while the inner button block is aligned left or right is an issue. It is a side-effect of the switch to using inner blocks.

That said, we do have the block navigation button in the main editor toolbar as well as the parent selector when hovering the button block’s toolbar. There is also currently work in progress ( PR ) to improve the UX around the parent selector, making it more discoverable and obvious.

If you are happy with these options in the short term, I’d be inclined to proceed with this PR. What do you think?

Copy link
Contributor

@fgiannar fgiannar left a comment

Choose a reason for hiding this comment

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

Hi @aaronrobertshaw ,

Thanks for the rebase.
I think, as you mentioned, not being easily able to select the parent block while the inner button block is aligned left or right is a generic issue that needn't affect this PR.
I believe you can proceed.

@fgiannar fgiannar added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jul 14, 2020
@fgiannar fgiannar added this to the 8.8 milestone Jul 14, 2020
@aaronrobertshaw aaronrobertshaw merged commit 5aa7360 into master Jul 15, 2020
@aaronrobertshaw aaronrobertshaw deleted the update/replace-recurring-payments-submit-button branch July 15, 2020 04:56
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Jul 15, 2020
jeherve added a commit that referenced this pull request Jul 28, 2020
@jeherve
Copy link
Member

jeherve commented Aug 4, 2020

r211585-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Button [Block] Payment Button aka Recurring Payments [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recurring Payments: Replace with SubmitButton new Button block
7 participants