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

Show RRM buttons on the edit post page for non-Site Kit users #10400

Open
4 tasks done
techanvil opened this issue Mar 10, 2025 · 3 comments
Open
4 tasks done

Show RRM buttons on the edit post page for non-Site Kit users #10400

techanvil opened this issue Mar 10, 2025 · 3 comments
Assignees
Labels
Module: RRM Reader Revenue Manager module related issues P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Mar 10, 2025

Feature Description

At present, when RRM blocks are included in a post, and a non-admin user who hasn't had any Site Kit modules shared with them edits the post, the blocks aren't registered and the following warnings are shown instead.

Image

In this scenario, we should ensure the blocks are registered and the buttons display in the disabled state with an appropriate warning notice in the block sidebar.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • When RRM blocks are included in a post, and a non-admin user who hasn't had any Site Kit modules shared with them (a "non-Site Kit user") edits the post:
    • The RRM buttons should be displayed in the disabled state.
    • An undismissible warning should be displayed in the block sidebar with this copy:
      • This block can only be configured by Site Kit users. Please contact your administrator.
    • The warnings about the blocks being unsupported should not be displayed.
    • No Site Kit data that's not directly needed for this functionality should be exposed to the non-Site Kit user.

Implementation Brief

  • Add two new gutenberg block assets for non-Site Kit user versions of the RRM blocks.
  • Update the RRM module to enqueue these assets for non-Site Kit users on the edit post page.
  • Also enqueue them for non-Site Kit users on the site editor page to prevent potential issues there.
  • Complete and merge PR POC to fix RRM blocks in block editor pages for non-Site Kit users. #10401.

Test Coverage

  • Add test coverage for the changes to Modules/Reader_Revenue_Manager.

QA

  1. In publisher center > RRM, create a publication associated with the test website and configure contribution or subscription payment method.

  2. Activate Site Kit and make sure rrmModule and rrmModuleV2 features are enabled.

  3. Activate RRM module and connect to the publication for which we have configured payment option above.

  4. Go to Posts > Add New, add the block Contribute with Google or Subscribe with Google based on which payment option was configured in publisher center. Save the post.

  5. Create a new Editor role user in WordPress and make sure that SK daskboard is not shared with this role.

  6. Login with Editor user in new browser window and open the same post in block editor. The Subscribe with Google block should be in disabled state with the same notice as that of AC.

Changelog entry

@techanvil techanvil added Module: RRM Reader Revenue Manager module related issues P0 High priority Type: Enhancement Improvement of an existing feature labels Mar 10, 2025
@techanvil techanvil self-assigned this Mar 10, 2025
@techanvil techanvil assigned nfmohit and unassigned techanvil Mar 10, 2025
@techanvil techanvil added the Team M Issues for Squad 2 label Mar 10, 2025
@nfmohit
Copy link
Collaborator

nfmohit commented Mar 11, 2025

AC ✅

@nfmohit
Copy link
Collaborator

nfmohit commented Mar 11, 2025

IB LGTM ✅

Thank you @techanvil! Please note that I've posted a question in the PoC PR. I feel we can also improve namings and such, but that can be handled during execution.

@nfmohit nfmohit removed their assignment Mar 11, 2025
@techanvil
Copy link
Collaborator Author

techanvil commented Mar 11, 2025

Thanks @nfmohit! Great question on the PR, which I've replied to.

@ankitrox ankitrox self-assigned this Mar 12, 2025
@ankitrox ankitrox removed their assignment Mar 13, 2025
@nfmohit nfmohit assigned nfmohit and ankitrox and unassigned nfmohit Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: RRM Reader Revenue Manager module related issues P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants