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 RRM product ID setting #10065

Closed
8 tasks done
nfmohit opened this issue Jan 19, 2025 · 14 comments
Closed
8 tasks done

Add RRM product ID setting #10065

nfmohit opened this issue Jan 19, 2025 · 14 comments
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

@nfmohit
Copy link
Collaborator

nfmohit commented Jan 19, 2025

Feature Description

A dropdown (and associated informational elements) should be added to the Reader Revenue Manager setup and settings to aid the selection of a product ID.

Image


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

Acceptance criteria

  • A new dropdown field should be created in Site Kit that lists all available product IDs for the currently selected Reader Revenue Manager publication.
  • The label of the field should be "Default Product ID".
  • The field should have a static first option of "Open access", with value openaccess.
  • Upon selection, it should set the selected product ID in the module settings.
  • When setting up the Reader Revenue Manager module, in the case where the user has existing publications, if the selected publication has any available product IDs and the rrmModuleV2 feature flag is enabled, the dropdown should be added as a required field according to the Figma designs.
    • The first non-open-access product ID should automatically be selected during module setup.
  • In the Reader Revenue Manager setup screen, in the scenario where the connected Google account has available publications to select from, if the rrmModuleV2 feature flag is enabled and the selected publication has available product IDs:
  • In the Reader Revenue Manager settings edit screen, if the rrmModuleV2 feature flag is enabled and the selected publication has available product IDs or there is a saved product ID:
    • The dropdown should be added according to the Figma designs.
    • If the publication onboarding state notice is visible, the dropdown should appear below it, as depicted in this mock.
    • If the payment option of the selected publication is "subscriptions" and the currently selected product ID is "Open access", a dismissible warning notification should appear beside the dropdown with text "Selecting “Open access” will allow your reader to access your content without a subscription" according to this mock. The dismiss action label should be "Got it". The dismissal should be persistent.
    • The dropdown should have a helper text: "Product IDs offer a way to link content to payment plans. Learn more". "Learn more" should be a link that opens this URL in a new tab.
    • The dropdown should be followed by a dismissible informational subtle notification with text "Use the new settings in the block editor to select different product IDs for individual pages or control where CTAs appear on an individual post. Learn more" according to the Figma designs.
      • "Learn more" should be a link that opens the rrm-content-settings support redirector in a new tab. Note that it hasn't been added to the Support Redirects sheet yet, and the link, for now, will direct to a 404 page.
      • The dismiss action should be labelled as "Got it", and it should dismiss the notification permanently.

Implementation Brief

Create a ProductIDSelect Component

  • In assets/js/modules/reader-revenue-manager/components/common, create a new ProductIDSelect component with the following:
    • Fetch the list of product IDs using the getProductIDs() selector of the Reader Revenue Manager store.
    • Render the ProgressBar component if product IDs are still resolving.
    • Map through the available product IDs and include "Open access" (openaccess) as the first static option in the dropdown.
    • Populate the rest of the dropdown options with the available custom product IDs.
    • Create a callback function that dispatches the selected value to the module settings using the setProductID action.
    • Render the Select, Option components with the necessary props.
    • Pass the callback function to the onEnhancedChange prop of the Select component.
  • The styles should match the Figma design.

Integrate ProductIDSelect into the RRM Setup Flow

  • In assets/js/modules/reader-revenue-manager/components/setup/SetupForm.js:
    • Conditionally render the ProductIDSelect component next to the publication dropdown if:
      • The rrmModuleV2 feature flag is enabled.
      • The user has chosen a publication that has product IDs available.
    • Auto-selection:
      • On page load (i.e. on mount), check if the user has already selected a product ID (productID is empty or openaccess) and there is at least one custom product ID using the getProductIDs selector.
      • Dispatch the setProductID( firstCustomProductID ) to select the first non-openaccess product ID by default using the useEffect hook.
      • Note: This auto-selection should only happen in the setup flow.
  • The styles should match the Figma design.

Integrate ProductIDSelect to the RRM Settings Edit Screen

  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.js:
    • Conditionally render the ProductIDSelect component below the publication dropdown if:
      • The rrmModuleV2 feature flag is enabled.
      • The user has chosen a publication that has product IDs available.
      • Warning Notification:
        • Check if the paymentOption is subscriptions using the getPaymentOption selector and the user selects “Open access,”, render the SubleNotification component with the following:
          • variant: warning
          • description: Selecting “Open access” will allow your reader to access your content without a subscription
          • dismissLabel: Got it
          • onDismiss: pass a callback function that dispatches the dismissItem action to dismiss the notification permanently.
          • This should should appear next to the dropdown and should match the Figma design.
      • Informational Notice:
        • Render the SubleNotification component with the following:
          • variant: info
          • description: Use the new settings in the block editor to select different product IDs for individual pages or control where CTAs appear on an individual post. You can also configure a different product ID for a group of posts in the Categories or Tags section. Learn more
          • dismissLabel: Got it
          • onDismiss: pass a callback function that dispatches the dismissItem action to dismiss the notification permanently.
          • This should appear below the dropdown and should match the Figma design.
          • The links should open in a new tab with the URLs provided in the AC.
  • The styles should match the Figma design.

Modify SubtleNotification Component

  • In assets/js/components/notifications/SubtleNotification.js:
    • Update the VARIANTS constants to add a new property INFO with the value info.
    • Locate the googlesitekit-subtle-notification parent element and add a conditional class googlesitekit-subtle-notification--info if the variant is info.
    • Locate the googlesitekit-subtle-notification__icon element and render the info-circle.svg icon if the variant is info.
  • Add the necessary styles for the new info variant in assets/sass/components/dashboard/_googlesitekit-subtle-notification.scss.

Test Coverage

  • Add a Storybook story for the ProductIDSelect component.
  • Add storybook stories for the SetupForm and SettingsEdit components to showcase the ProductIDSelect in various states.
  • Add test cases for the ProductIDSelect component.
  • Add test cases for the SetupForm and SettingsEdit components.

QA Brief

  • Setup Reader Revenue Manager with the rrmModuleV2 feature flag enabled.
  • Setup a paywall for a publication that has custom product IDs available.
  • Ensure the ProductIDSelect dropdown is displayed in the setup flow as per the ACs.
  • Ensure the first non-Open access product ID is auto-selected during setup if the user hasn't selected a product ID yet.
  • Ensure the ProductIDSelect dropdown is displayed in the settings edit screen as per the ACs.
  • Ensure the warning notification is displayed if the user selects "Open access" and the payment option is "subscriptions". Please verify this with the updated Figma design.
  • Ensure the informational notification is displayed below the dropdown in the settings edit screen.
  • Verify that the links in the informational notification navigate to the correct pages.
  • Please note that there may be some differences in styling between the implementation and the Figma designs, especially in regard to the spacing between different elements. This is intentional to be consistent with the settings edit screens of other modules.

Changelog entry

  • Add a dropdown and associated informational elements to the Reader Revenue Manager setup and settings screens, to aid the selection of a product ID.
@nfmohit nfmohit self-assigned this Jan 19, 2025
@nfmohit nfmohit added P0 High priority Type: Enhancement Improvement of an existing feature Team M Issues for Squad 2 Module: RRM Reader Revenue Manager module related issues labels Jan 19, 2025
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Jan 21, 2025
@nfmohit nfmohit removed their assignment Jan 23, 2025
@techanvil techanvil self-assigned this Jan 23, 2025
@techanvil
Copy link
Collaborator

techanvil commented Jan 23, 2025

The AC does raise the same question about what to do with a stale product ID when changing the publication in the dropdown as discussed in #9953 (comment), but I think we can address that in #9953 (or, maybe it will be covered in the IB for this issue anyway if it gets specced first).

AC ✅

@techanvil techanvil removed their assignment Jan 23, 2025
@hussain-t hussain-t self-assigned this Jan 23, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 24, 2025

@techanvil Just FYI, I've added two new ACs as follows:

  • It should appear below the publication onboarding state notice, as depicted in this mock.
  • If the payment option of the selected publication is "subscriptions" and the currently selected product ID is "Open access", a dismissible warning notification should appear beside the dropdown with text "Selecting “Open access” will allow your reader to access your content without a subscription" according to this mock. The dismiss action label should be "Got it". The dismissal should not be persistent, i.e. it should appear again under the same circumstances on the next page load.

I had missed them earlier, my apologies. Thank you!

CC: @hussain-t

@techanvil
Copy link
Collaborator

Cool, thanks for the heads up @nfmohit! I've actually further tweaked the first of those AC points just to be super explicit:

If the publication onboarding state notice is visible, the dropdown should appear below it, as depicted in this mock.

@hussain-t
Copy link
Collaborator

Hi @nfmohit, the AC mentions integrating the dropdown only in the settings edit screen. However, it should also be included on the setup screen as well. Do we have another issue with implementing the setup screen, or did the AC overlook it? Thanks!

@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 29, 2025

@hussain-t Good catch. I indeed overlooked it in the ACs. I've updated the ACs to include that:

In the Reader Revenue Manager setup screen, in the scenario where the connected Google account has available publications to select from, if the rrmModuleV2 feature flag is enabled and the selected publication has available product IDs:

CC: @techanvil

@hussain-t
Copy link
Collaborator

hussain-t commented Jan 31, 2025

@nfmohit, as we discussed, the warning notification next to the product ID dropdown should now be permanently dismissible. I’ve updated the IB to reflect this. Could you please update the AC accordingly while reviewing the IB? Thank you!

  • If the payment option of the selected publication is "subscriptions" and the currently selected product ID is "Open access", a dismissible warning notification should appear beside the dropdown with text "Selecting “Open access” will allow your reader to access your content without a subscription" according to this mock. The dismiss action label should be "Got it". The dismissal should not be persistent, i.e. it should appear again under the same circumstances on the next page load.

@hussain-t hussain-t assigned nfmohit and unassigned hussain-t Jan 31, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 31, 2025

Thank you @hussain-t!

I've updated the ACs accordingly, as discussed, specifically the following:

  • If the payment option of the selected publication is "subscriptions" and the currently selected product ID is "Open access", a dismissible warning notification should appear beside the dropdown with text "Selecting “Open access” will allow your reader to access your content without a subscription" according to this mock. The dismiss action label should be "Got it". The dismissal should be persistent.

I've changed the dismissal to be persistent to simplify it, as a session-based temporary dismissal wasn't a design requirement.

Thanks!

CC: @techanvil

@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 31, 2025

IB LGTM ✅

Nice work, @hussain-t! Just a note that I've updated the IB to explicitly mention that the product ID should only be auto-selected once on page load.

  • On page load (i.e. on mount), check if the user has already selected a product ID (productID is empty or openaccess) and there is at least one custom product ID using the getProductIDs selector.

Thanks!

@nfmohit
Copy link
Collaborator Author

nfmohit commented Feb 28, 2025

Moved this to Merge Review as I've made a bunch of changes to the PR during CR, in Hussain's absence. Thanks!

@techanvil techanvil self-assigned this Feb 28, 2025
techanvil added a commit that referenced this issue Feb 28, 2025
…id-settings

Enhancement/#10065 - Add RRM product ID setting
@techanvil techanvil removed their assignment Feb 28, 2025
@mohitwp mohitwp self-assigned this Feb 28, 2025
@mohitwp
Copy link
Collaborator

mohitwp commented Mar 4, 2025

QA Update ❌

  • Tested on dev envrironment.
  • Tested when rrmModuleV2 feature flag enabled.
  • Tested RRM product ID dropdown and settings view on different viewports.
  • Verified all the points mentioned under QAB and AC.

@hussain-t

Issue 1:

The dismissible informational subtle notification, placed below the dropdown with the text 'Use the new settings in the block editor to select different product IDs for individual pages or control where CTAs appear on an individual post. Learn more', moves beside the dropdown on large viewports with a width of 1714px or more.

Image

Image

Issue 2:

Default product ID text field is not properly aligned under RRM settings view.

Image

PASS CASES

Image

Image

Recording.1853.mp4

Open Access warning -

Image

@mohitwp mohitwp assigned hussain-t and unassigned mohitwp Mar 4, 2025
@hussain-t
Copy link
Collaborator

Thanks, @mohitwp!

Issue 1 is a bug. I will address it in a follow-up PR. Issue 2 is outside the scope of this ticket. @nfmohit, do we have an issue to address, or should we create a new ticket?

@nfmohit
Copy link
Collaborator Author

nfmohit commented Mar 4, 2025

Issue 2:

Default product ID text field is not properly aligned under RRM settings view.

This actually falls under the scope of #10067, and it has been mentioned in the QAB that the alignment will not be correct. We'll address the alignment across all modules as part of a new epic/set of issues. Thanks!

@hussain-t hussain-t assigned nfmohit and unassigned hussain-t Mar 4, 2025
nfmohit added a commit that referenced this issue Mar 4, 2025
…id-info-notice-width

Enhancement/#10065 - Fix product id info notice width (follow-up)
@nfmohit nfmohit assigned mohitwp and unassigned nfmohit Mar 4, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Mar 4, 2025

Hi @mohitwp. The follow-up PR has been merged with a fix for Issue 1, and this is now back to you for another round. Thanks!

@mohitwp
Copy link
Collaborator

mohitwp commented Mar 5, 2025

QA Update ✅

  • Tested on dev environment.
  • Tested when rrmModuleV2 feature flag enabled.
  • Tested RRM product ID dropdown and settings view on different viewports.
  • Verified all the points mentioned under QAB and AC.
  • Verified that issue 1 mentioned above is resolved now.
  • Issue 2 will be address under Update RRM settings view screen to reflect new settings #10067.
  • Verified that the ProductIDSelect dropdown is displayed in the setup flow as per the ACs.
  • Verified that the first non-Open access product ID is auto-selected during setup if the user hasn't selected a product ID yet.
  • Verified that theProductIDSelectdropdown is displayed in the settings edit screen as per the ACs.
  • Verified that the warning notification is displayed if the user selects "Open access" and the payment option is "subscriptions". Please verify this with the updated Figma design.
  • Verified that the informational notification is displayed below the dropdown in the settings edit screen.
  • Verified that the links in the informational notification navigate to the correct pages.

Image

Image

Recording.1853.mp4

Image

Image

Image

Image

Image

Image

Image

Image

@mohitwp mohitwp removed their assignment Mar 5, 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

6 participants