-
Notifications
You must be signed in to change notification settings - Fork 297
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
Add RRM inline CTA button blocks #9963
Comments
@aaemnnosttv Nahid told me you've talked about this, but would still like your final green flag on it. Could you take a look today, as we need to move RRM tickets forward? |
Thanks @nfmohit – this LGTM 👍 We may tweak the language during review but nothing blocking here. AC ✅ |
@aaemnnosttv Just a heads-up that I've removed the fallback content/notice for the block in case the module is not connected. This follows the approach that the Sign in with Google block took and thus simplifies the block further, as the module's |
Hey @nfmohit, the linked PoC is looking good - I have just added a couple of comments to it for your consideration: here and here. With regard to the IB, it's really leaving things quite open to interpretation at execution time with quite a large draft PR and not a huge amount of guidance in the IB. I would suggest providing a bit of high level direction in the IB about how we'll adapt the PR to add support for the "Subscribe with Google" block. It doesn't have to go into too much detail, but it would be good to provide an outline, this will show that we've thought about it, provide the executing engineer with a bit of direction, and help to substantiate the estimate. It would also be good to call out anything from the PoC that might not be entirely clear to whoever picks this up, although if you don't see anything that's worth highlighting that's fine. |
Hi @techanvil!
I've responded to your comments, thank you!
I've expanded the IB a little further hoping to provide a general direction for the implementation. Please let me know if it looks good, thanks so much! |
Thanks @nfmohit! That's great, the IB LGTM. I'm just sending this back your way to address the last point of discussion in the PoC PR. |
I've addressed the last point, thanks so much Tom! |
Thanks @nfmohit! Sending back to you for one last tweak to the PoC as discussed on Slack, this will then be good to go. |
Thank you @techanvil! I've updated the PoC PR as suggested. |
Thanks @nfmohit! That's great, and this IB is LGTM. IB ✅ |
Feature Description
As part of RRM Phase 2, the WordPress post editor will offer one of the two following blocks:
contributions
, obtainable using the newpaymentOption
module setting. The block should render the following:<button swg-standard-button="contribution"></button>
subscriptions
, obtainable using the newpaymentOption
module setting. The block should render the following:<button swg-standard-button="subscription"></button>
The blocks should be “dynamic”. Learn more about dynamic blocks here. A
Modules\Reader_Revenue_Manager\Blocks\Inline_Buttons
class should be created to register the above dynamic WordPress editor blocks offering the user to place inline contribute/subscribe buttons within their content and create a new block category that would nest blocks from the Site Kit plugin.The new
googlesitekit-reader-revenue-manager-post-editor.js
JavaScript entry point will include the JavaScript block definitions.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
rrmModuleV2
feature flag is enabled, two new dynamic blocks should be added to the WordPress block editor with render content as follows:<button swg-standard-button="contribution"></button>
<button swg-standard-button="subscription"></button>
https://publishercenter.google.com/reader-revenue-manager?publication={ PUBLICATION_ID }
.https://publishercenter.google.com/reader-revenue-manager?publication={ PUBLICATION_ID }
.Implementation Brief
blocks/reader-revenue-manager/subscribe-with-google
.block.json
similar to the one in the Contribute with Google block and adapt details accordingly. For thedescription
, useAllow users to subscribe using Reader Revenue Manager to access content behind a paywall.
.Edit.js
similar to the one in the Contribute with Google block and adapt details accordingly. Instead of checking for thecontributions
payment option, check forsubscriptions
instead.index.js
, similar to the one in the Contribute with Google block.includes/Modules/Reader_Revenue_Manager/Blocks
, createSubscribe_With_Google.php
based onContribute_With_Google.php
and adapt details accordingly. In the rendered button, set the value of theswg-standard-attribute
tosubscription
.includes/Modules/Reader_Revenue_Manager.php
:register
method, instantiate theSubscribe_With_Google
class and call itsregister
method, similar to how it is done forContribute_With_Google
.setup_assets
method, enqueue the block's distributableindex.js
file, similar to how it is done for the Contribute with Google block.Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: