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

Make text of Premium Content's Subscribe button editable #46983

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

stacimc
Copy link
Contributor

@stacimc stacimc commented Oct 30, 2020

Changes proposed in this Pull Request

The Premium Content block's 'Subscribe' button text could not be edited; it reverts instantly back to 'Subscribe'. There was a hook configured to reset the text each time the component was updated. This PR removes that. There is also an update to the block to correctly initialize the button text to 'Subscribe' the first time it is added.

Testing instructions

  1. Create a new post
  2. Add the Premium Content Block. By default you should have a "Subscribe" and "Log In" button.
  3. Click into the "Subscribe" button and edit the text to say something else.
  4. Your edit should persist when you click out of the button.
  5. Save the post and verify that your edited button text displays correctly on the frontend.

Fixes #46347

@matticbot
Copy link
Contributor

@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.

D52108-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 hook configured to reset the text of the Subscribe button
back to 'Subscribe' each time it is updated, which makes it
impossible to edit the text. This commit removes that hook.
@stacimc stacimc force-pushed the update/editable-subscribe-button-text branch from 134af2e to 2c8650e Compare October 31, 2020 00:08
Provides a jetpack/button block within the inner blocks template for the recurring payments block used by premium content. Also includes eslint formatting fix and addition of missing dependency in hook.
@stacimc stacimc marked this pull request as ready for review November 2, 2020 18:51
@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 Nov 5, 2020
@apeatling apeatling requested a review from a team November 5, 2020 21:47
@apeatling apeatling added the Premium Content Controlling specific content for paying site visitors. label Nov 5, 2020
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.

Looks good, went through testing instructions and confirmed I could change the button text. It stuck after publishing and refreshing the editor.

@stacimc stacimc merged commit 5dcc6e5 into master Nov 5, 2020
@stacimc stacimc deleted the update/editable-subscribe-button-text branch November 5, 2020 22:26
@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 Nov 5, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Premium Content Block: Unable to change "Subscribe" button text
4 participants