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

Setup CTA Banner doesn't follow the multiple dismissal/settings tooltip pattern #9257

Closed
3 tasks done
wpdarren opened this issue Aug 30, 2024 · 3 comments
Closed
3 tasks done
Labels
Module: RRM Reader Revenue Manager module related issues P1 Medium priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@wpdarren
Copy link
Collaborator

wpdarren commented Aug 30, 2024

Bug Description

The Setup CTA banner has a "Maybe later" dismissal CTA. Pressing this dismisses the banner permanently without further information as to where the feature can be set up later. It would be good for the banner to follow the pattern we've introduced whereby: The banner is reshown after a delay (e.g. two weeks), either two or three times, with the dismissal CTA changing to "Don't show again" on the final showing. Upon pressing the dismissal CTA, a tooltip is shown pointing to the Settings menu item advising the user they can set up the feature later in Settings.

Asana ticket can be found here


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

Acceptance criteria

  • When the RRM Setup CTA Banner's "Maybe later" dismissal CTA is clicked:
    • The banner should be dismissed for two weeks.
    • A tooltip should appear pointing to the Settings menu item with the following copy:
      • You can always set up Reader Revenue Manager from Settings later
    • The tooltip should have the same look and feel as other similar tooltips, for example the corresponding Consent Mode tooltip:
      image
  • After two weeks has elapsed, the banner should be shown again, this time with "Don’t show again" for the dismissal CTA text. Upon clicking the CTA:
    • The banner should be dismissed permanently.
    • The tooltip pointing to the Settings menu item should appear again, as described above.

Implementation Brief

  • In assets/js/modules/reader-revenue-manager/components/dashboard/ReaderRevenueManagerSetupCTABanner.js.
    • Use of prompts infrastructure.
      • Use dismissPrompt and remove use of dismissItem as the banner needs to be shown again after two weeks.
      • Use getPromptDismissCount selector to get the dismiss count.
      • Use hasFinishedResolution( 'getDismissedPrompts', [] ) to check if dismissed prompts have been loaded or not. This is necessary in order to avoid glitches in banner when it shows Maybe later at first, but immediately change it to Don't show again text once the dismissed prompts data is available.
      • In onDismiss function, inside finally block, if dismissCount is less than 1, dismiss the banner using dismissPrompt by passing slug as READER_REVENUE_MANAGER_SETUP_BANNER_DISMISSED_KEY and expiration as two week in seconds. A similar implementation can be seen here.
    • Tooltip after dismissal.
      • Import AdminMenuTooltip, useShowTooltip and useTooltipState from AdminMenuTooltip component.
      • Check if tooltip should be visible using useTooltipState hook and pass READER_REVENUE_MANAGER_SETUP_BANNER_DISMISSED_KEY to it. This will return isTooltipVisible, a boolean.
      • Use useShowTooltip hook which will return a function that would be used to display the tooltip. Receive it in a constant showTooltip.
      • In onDismiss function before dismissing the banner in finally block, call showTooltip(). This will set isTooltipVisible to true.
      • Inside the component, check if isTooltipVisible is true, if it is, return AdminTooltip component.
        • Title should be empty.
        • Content would be: You can always enable reader revenue manager from Settings later
        • dismiss label as Got it
        • tooltipStateKey set to READER_REVENUE_MANAGER_SETUP_BANNER_DISMISSED_KEY.

Test coverage

  • In assets/js/modules/reader-revenue-manager/components/dashboard/ReaderRevenueManagerSetupCTABanner.test.js
    • Fix any failing tests.
    • Add tests for prompt behaviour.
    • Add test for tooltip behaviour.

QA Brief

  1. Enable RRM feature in the tester plugin and make sure to disable RRM module in Site Kit settings.

  2. Go to dashboard, it should display the setup CTA banner.

  3. Click on Maybe later, it will dismiss the banner and will display the tooltip with the text as mentioned in IB.

  4. Install Time Travel extension in chrome and set the date to 15 days or 1 month later. Reload the page.

  5. The banner should be visible again. Dismiss the banner again using Maybe later CTA, it would again display the tooltip.

  6. Change the date in extension further to 1 month and reload the page, the banner should not be visible anymore.

Changelog entry

  • Show the Reader Revenue Manager module's setup banner again two weeks after being dismissed, and show a tooltip to let the user know it can be set up later in Settings.
@wpdarren wpdarren added Module: RRM Reader Revenue Manager module related issues P1 Medium priority Type: Enhancement Improvement of an existing feature labels Aug 30, 2024
@techanvil techanvil assigned techanvil and unassigned techanvil Sep 2, 2024
@nfmohit nfmohit self-assigned this Sep 4, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Sep 4, 2024

AC ✅

@nfmohit nfmohit removed their assignment Sep 4, 2024
@nfmohit nfmohit added the Team M Issues for Squad 2 label Sep 4, 2024
@ankitrox ankitrox assigned ankitrox and unassigned ankitrox Sep 4, 2024
@techanvil techanvil self-assigned this Sep 4, 2024
@techanvil
Copy link
Collaborator

IB ✅

@techanvil techanvil removed their assignment Sep 4, 2024
@ankitrox ankitrox self-assigned this Sep 5, 2024
@ankitrox ankitrox removed their assignment Sep 9, 2024
@techanvil techanvil assigned techanvil and ankitrox and unassigned techanvil Sep 9, 2024
@ankitrox ankitrox assigned techanvil and unassigned ankitrox Sep 10, 2024
@techanvil techanvil removed their assignment Sep 10, 2024
@wpdarren wpdarren self-assigned this Sep 11, 2024
@wpdarren
Copy link
Collaborator Author

QA Update: ✅

Verified:

  • When I clicked on Maybe later, it dismissed the banner and the tooltip with the text as mentioned in AC is displayed.
  • When I set the date to 1 month later, the banner is visible again.
  • When I dismiss the banner again using Maybe later CTA, it displays the tooltip.
  • When I set the date to 1 month later and reload the page, the banner is not visible anymore.
Screenshots

image
image

@wpdarren wpdarren removed their assignment Sep 11, 2024
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 P1 Medium priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

5 participants