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

Handle unavailable publication scenario in RRM settings edit screen #9151

Closed
10 tasks
nfmohit opened this issue Aug 6, 2024 · 7 comments
Closed
10 tasks

Handle unavailable publication scenario in RRM settings edit screen #9151

nfmohit opened this issue Aug 6, 2024 · 7 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 Aug 6, 2024

Feature Description

There could be a number of scenarios where the connected publication is no longer available in the RRM settings edit screen. Such as:

  1. No publications available in account (e.g. they were deleted). In this case, the publication select will appear with no options to select from. Instead, a notice should be added to let the user know that their previously configured publication is no longer available. Also, they do not have any other publications to select from.
  2. Configured publication is no longer available (e.g. it was deleted), or they do not have access to it. In this case, a notice should be added along the publication select letting the user know that the configured publication is no longer available or they do not have access to it. They can select a different publication.

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

Acceptance criteria

  • In the Reader Revenue Manager settings edit screen:
    • If the user does not have module access:
      • The publication select field should still be displayed.
      • The publication onboarding state notice should not be rendered.
      • A notice should be added under the publication select field that reads: "{ MODULE OWNER USERNAME } configured Reader Revenue Manager and you don't have access to its configured publication. Contact them to share access or change the configured publication.".
        • If the module owner username is not available, it should be replaced with "Another admin".
        • The notice should look similar to the Analytics "no module access" notice here.
    • Otherwise, if the configured publication is not available:
      • An error notice should be added at the top that says: "Error: The previously selected publication with ID {PUBLICATION_ID} was not found. Please select a new publication.".
        • The notice should look similar to the Analytics "property not available" notice here.

Implementation Brief

  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.js:
    • Render the components unconditionally, i.e. remove the condition for having module access.
    • If the user has module access but a publication with the saved publication ID (getPublicationID) does not exist in the list of publications (getPublications()), render an ErrorNotice component with the message specified in the ACs.
    • Render PublicationSelect as it is done currently.
    • Render PublicationOnboardingStateNotice only if the user has module access.
    • If the user does not have module access, render a SettingsNotice with the notice mentioned in the ACs, with props similar to assets/js/modules/analytics-4/components/settings/AnalyticsSettingsNotice.js.
  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.stories.js:
    • Add Storybook story variants for no module access and publication unavailable scenarios.

Test Coverage

  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.test.js:
    • Add test coverage to verify the presence of different notices in different scenarios.

QA Brief

  • Using the tester plugin, enable the rrmModule feature flag.
  • Set up Site Kit with the Reader Revenue Manager module - create a new publication in the process.
  • Using a different browser, log into the site and connect to Site Kit with a different Google account.
  • Go to Site Kit Settings -> Connected Services -> Reader Revenue Manager and click on "Edit". Verify that the publication select field is disabled, and a notice appears underneath the publication select field regarding the user not having access according to the ACs.
  • Go back to the first browser.
  • Go to the Publisher Center and delete the publication that you just created.
  • Go to Site Kit Settings -> Connected Services -> Reader Revenue Manager and click on "Edit". Verify that an error message appears above the publication select field regarding the publication being not found. Verify that the publication select field shows an empty value.

Changelog entry

  • Improve the Reader Revenue Manager settings edit screen by handling cases where the configured publication is unavailable, or the user lacks access by displaying appropriate notices.
@nfmohit nfmohit self-assigned this Aug 6, 2024
@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 Aug 6, 2024
@nfmohit
Copy link
Collaborator Author

nfmohit commented Aug 8, 2024

@aaemnnosttv This has been added based on our discussions. I'm looking for your opinion in the ACs and its review. Some questions:

  1. For the first scenario, should we add a link to publisher center for publication creation? If so, should we add the refocus reload mechanism for publications here as well?
    • If we add the link to create publication and refocus reload mechanism here, do you think it might be worth offering publication creation in Settings Edit regardless? Currently, we don't offer a way to create publication from the settings edit screen.
  2. At this moment, I don't think we have a way to differentiate between the connected publication not available and user not having access to it, as not having access is also dictated by the absence of the publication in the user's list of publications. Is there a necessity to change the wording in this regard?

Thank you!

@nfmohit nfmohit assigned aaemnnosttv and unassigned nfmohit Aug 8, 2024
@aaemnnosttv
Copy link
Collaborator

Thanks @nfmohit – we should avoid using language that makes definitive statements about there being no publications in the users account since we can't know that without making a different request which isn't worth it just to inform a message. There very well could be many other publications, but we are limited to 1) publications the user has access to, and 2) those that have a matching verified domain. Is it possible to change the domain a publication is verified for after it is verified for a given domain?

In the Settings Edit view, we need to keep the current publication ID in state/settings until it can be replaced by a new one (otherwise submit changes would fail validation). This is partly the reason for the "has access" check with locking behavior for non-module-owner admins, so that is another nuance to consider. The scenarios defined so far only really apply to the module owner as non-owners shouldn't be able to edit the connected publication if they didn't have access.

Let's look at how we handle this for other modules as I'm guessing we should have something similar for GA and GTM. The difference here is that we don't offer the creation via the dropdown which simplifies this case for those modules, but let's check the other modules as I think we can align the language more closely with those as well.

@nfmohit
Copy link
Collaborator Author

nfmohit commented Aug 15, 2024

Thank you for the kind review, @aaemnnosttv !

Is it possible to change the domain a publication is verified for after it is verified for a given domain?

It is possible to change the domain a publication is verified for, yes.

As discussed on our call, I've updated the ACs accordingly and also added an IB for your consideration. Thank you!

@aaemnnosttv
Copy link
Collaborator

Thanks @nfmohit

AC + IB ✅

@aaemnnosttv aaemnnosttv removed their assignment Aug 15, 2024
@nfmohit nfmohit self-assigned this Aug 15, 2024
@nfmohit nfmohit removed their assignment Aug 16, 2024
@hussain-t hussain-t self-assigned this Aug 19, 2024
hussain-t added a commit that referenced this issue Aug 19, 2024
…blication

Update RRM settings screens to handle edge case scenarios
@hussain-t hussain-t removed their assignment Aug 19, 2024
@kelvinballoo
Copy link
Collaborator

QA Update ⚠️

This is tested good overall.
The only item I was unable to test was this point from the AC: ⚠️
If the module owner username is not available, it should be replaced with "Another admin".
Is there a way to make the owner username not available?

Other than that, these were tested good:

  • The publication select field appears in a disabled stated ✅

  • A notice appears under the publication select field that reads: "{ MODULE OWNER USERNAME } configured Reader Revenue Manager and you don't have access to its configured publication. Contact them to share access or change the configured publication.". ✅

    Screenshot 2024-08-19 at 22 30 29
  • When the publication is not available:

    • An error notice appears at the top that says: "Error: The previously selected publication with ID {PUBLICATION_ID} was not found. Please select a new publication.". ✅
    Publication.not.available.mov

@nfmohit
Copy link
Collaborator Author

nfmohit commented Aug 20, 2024

Hi @kelvinballoo.

Unfortunately, there isn't an easy way to simulate this, but you can see the scenario in this Storybook story.

Please let me know if this sounds good, thank you!

@nfmohit nfmohit removed their assignment Aug 20, 2024
@kelvinballoo
Copy link
Collaborator

QA Update ✅

Was able to do the above scenario by having another admin delete the original admin.

The correct notice was shown then:

Screenshot 2024-08-20 at 15 45 02

These were tested good as well:

  • The publication select field appears in a disabled stated ✅

  • A notice appears under the publication select field that reads: "{ MODULE OWNER USERNAME } configured Reader Revenue Manager and you don't have access to its configured publication. Contact them to share access or change the configured publication.". ✅

    Screenshot 2024-08-19 at 22 30 29
  • When the publication is not available:

    • An error notice appears at the top that says: "Error: The previously selected publication with ID {PUBLICATION_ID} was not found. Please select a new publication.". ✅
    Publication.not.available.mov

@kelvinballoo kelvinballoo removed their assignment Aug 20, 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 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