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

Add post-level RRM settings #9962

Open
1 task
nfmohit opened this issue Jan 2, 2025 · 3 comments
Open
1 task

Add post-level RRM settings #9962

nfmohit opened this issue Jan 2, 2025 · 3 comments
Assignees
Labels
Module: RRM Reader Revenue Manager module related issues Next Up Issues to prioritize for definition P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@nfmohit
Copy link
Collaborator

nfmohit commented Jan 2, 2025

Feature Description

As part of RRM Phase 2, the WordPress post editor will allow users to override the snippet configuration at the post level. This issue should implement the fields to allow the said configuration.

Example mock:
Image

The select field having a label of “Product ID Override”* will reflect and change the value of the googlesitekit_rrm_{Publication ID}:productID post meta setting with the following options:

  1. No change”*; Default; Value: Empty string.
  2. Off”*; Value: none.
  3. Open access”*; Value: openaccess.
  4. Any available product IDs for the connected publication, obtainable using the new productIDs module setting.

* The final version of the labels should be checked and confirmed with Sigal and Mariya.

As this will be rendered within the WordPress post editor, the new googlesitekit-reader-revenue-manager-post-editor.js JavaScript entry point should be used here.

The PluginDocumentSettingPanel component from @wordpress/editor should be used to compose a setting panel for Site Kit. It should use relevant components from @wordpress/components to implement the necessary setting field.

A PoC has already implemented this largely which can be used as a starting point.


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

Acceptance criteria

  • If the rrmModuleV2 feature flag is enabled, the Reader Revenue Manager module is connected, and the current user has access to the Reader Revenue Manager module:
    • A new panel should be added to the document settings sidebar of the WordPress block editor. It should have a title of "Google Site Kit" and an icon of Site Kit.
    • It should include a heading of "Reader Revenue Manager".
    • It should include a select field with a label of "Choose snippet configuration".
    • It should have the following options:
      • "Use default"
      • "None"
      • "Open access"
      • Available product IDs
    • It should have a helper text that changes based on the selection, as follows:
      • "Use default": "The snippet configuration will be inherited from a parent taxonomy term, or the Site Kit settings."
      • "None": "No snippet will be added for this post."
      • "Open access": "An open-access snippet will be added for this post."
      • Available product IDs: "The snippet will be added with the {PRODUCT_ID} product ID."
    • When the post is updated in the block editor, the selection should be saved using the added post meta setting.
    • The styling for the added elements should follow the WordPress design language and be in line with other parts of the block editor.
    • The added setting should be backwards-compatible up to WP 5.3.

Implementation Brief

Test Coverage

QA Brief

Changelog entry

@nfmohit nfmohit self-assigned this Jan 2, 2025
@nfmohit nfmohit added P0 High priority Type: Enhancement Improvement of an existing feature Team M Issues for Squad 2 labels Jan 2, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 6, 2025

@aaemnnosttv Going back to our discussion regarding the settings in the block editor, we have two options:

  1. Separate plugin panel: This is supported in WordPress 5.2 and above. The plugin is pinned to the header by default but can be unpinned by the user. When unpinned, it can be accessed using the "more" menu.

Image

  1. Within the document sidebar: This is not supported in WordPress 5.2 but is supported on 5.3 and above (according to when I last checked).

Image

In my PoC, I have added both options. IIRC, you were inclined towards option 1 as it has wider support. Just to confirm, should we go with option 1 and abandon option 2?

Once I have some feedback on this, I'll draft the ACs accordingly and seek advice from Sigal and Mariya on the copy.

Thank you!

@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 9, 2025

Update: Upon discussion on the above with @aaemnnosttv internally, we found ourselves inclined towards option 1 as it has wider support, and it also adds a dedicated place for Site Kit in the block editor for potential future field additions. I'll draft the ACs and seek assistance from Sigal regarding UX if required.

@nfmohit nfmohit assigned aaemnnosttv and unassigned aaemnnosttv and nfmohit Jan 9, 2025
@nfmohit nfmohit added the Module: RRM Reader Revenue Manager module related issues label Jan 18, 2025
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Jan 21, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 22, 2025

@marrrmarrr I've co-assigned this to you in hopes of receiving feedback on the copy of the setting field in the ACs. These were drafted before your brilliant suggestions in #9961. I hope that is okay, thank you! 🙏

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 Next Up Issues to prioritize for definition 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

4 participants