-
Notifications
You must be signed in to change notification settings - Fork 804
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
Blog Subscription Widget: deprecate widget and transform to block #21184
Blog Subscription Widget: deprecate widget and transform to block #21184
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
The WPCOM test will fail due to the check against Also, the Subscription Form block does not appear to have a section for a success message. Am I missing that somewhere, or is this not a setting available? |
We did not implement that setting for the block yet. I logged this here: |
9e5069e
to
bc9c3a9
Compare
…ption-widget-transform
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 works well for me. Do you think we could also keep the widget title, in a heading block?
transform: ( { instance } ) => { | ||
return createBlock( 'jetpack/subscriptions', { | ||
showSubscribersTotal: instance.raw.show_subscribers_total, | ||
submitButtonText: instance.raw.subscribe_button, |
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.
@arcangelini 👋 have you tried changing it to some different custom string!
Example: submitButtonText: 'Subscribe to my newsletter'
.
I tried something similar but it is not working for me somehow! 😞 submitButtonText
value is set to default value that you mentioned in the attributes.js
file
Can you please try at your end and confirm?
Thanks
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.
Yeah, if you look at my last screenshot it shows the placeholder text as "Placeholder" and the submit button as "Button".
I can test again though!
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 trying to understand what this block of code does?
return createBlock( 'jetpack/subscriptions', {
showSubscribersTotal: instance.raw.show_subscribers_total,
submitButtonText: instance.raw.subscribe_button,
subscribePlaceholder: instance.raw.subscribe_placeholder,
} );
If you see in the screenshot, I have commented default value of submitButtonText
and if it has to read the value from index.js
file instance.raw.subscribe_button
then I have given some hard coded value custom button value
which is not getting reflected. Button text is empty actually.
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.
@arcangelini, no need to test it again. It is working as expected. I understand now when that block of code is going to run.
Thank You 😄
@jeherve I could, but the problem we have run into is that this heading block doesn't not get placed immediately above the subscription block. The only way to get it to do this would be using a Group block, but due to the way Gutenberg checks the transforms output we can not transform directly to a group block. In the future, I think there will be a Widget group block to transform to, but this has not gone live in core yet so I have opted to not use this. This is what it looks like: |
This works for me! Shame we don't have an option for transforming to a group block just yet (maybe we can open an issue to track that when it's available) but not sure that's a blocker for this PR. What do you think @jeherve ? |
Thanks for the explanation. Let's move forward without the titles then! 👍 |
…ption-widget-transform
…ption-widget-transform
…ption-widget-transform
🥳 Deployed to WPCOM r233512-wpcom |
Great news! One last step: head over to your WordPress.com diff, D67356-code, and commit it. Thank you! |
* master: Releases: start 10.3-a.4 cycle (#21454) Atomic Release: prepare changelogs for today's release (#21453) Connection: fixing the bug with connect button not appearing for secondary users (#21450) CLI: Add readme to 'jetpack release' (#21418) Update handling and setting CCPA related cookies (#21337) Publicize: do not disable toggle connection control when RePublicize is enabled (#21373) External Media: Add bottom padding to Google Photos modal (#21201) Blog Subscription Widget: deprecate widget and transform to block (#21184)
# By Jeremy Herve (2) and others # Via GitHub * master: Releases: start 10.3-a.4 cycle (#21454) Atomic Release: prepare changelogs for today's release (#21453) Connection: fixing the bug with connect button not appearing for secondary users (#21450) CLI: Add readme to 'jetpack release' (#21418) Update handling and setting CCPA related cookies (#21337) Publicize: do not disable toggle connection control when RePublicize is enabled (#21373) External Media: Add bottom padding to Google Photos modal (#21201) Blog Subscription Widget: deprecate widget and transform to block (#21184) # Conflicts: # projects/plugins/boost/tests/e2e/package.json
Changes proposed in this Pull Request:
With the new current widget block editor, the Blog Subscription widget is redundant. The current Subscription Form block already exists and offers the same functions. This PR removes it from the
core/legacy-widget
and adds the widget to the REST API to allow a blocktransforms:
to be created.This will preserve the following settings that exist in the block: show_subscribers_total, subscribe_button, subscribe_placeholder.
Jetpack product discussion
Part of the widget => block project #21069
Does this pull request change what data or activity we track or use?
Nope
Testing instructions: