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 error if the saved product ID is no longer available #10131

Open
5 tasks
nfmohit opened this issue Jan 29, 2025 · 4 comments
Open
5 tasks

Handle error if the saved product ID is no longer available #10131

nfmohit opened this issue Jan 29, 2025 · 4 comments
Labels
Good First Issue Good first issue for new engineers 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 29, 2025

Feature Description

The Reader Revenue Manager settings edit screen should be updated to handle an error if the saved product ID is no longer available in the publication.


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 settings edit screen should display the following error at the top if a formerly selected product ID no longer exists in the publication, i.e. it was deleted:
      • "The previously selected product ID {PRODUCT_ID} was not found. Please select a new product ID."
    • The current user must have access to the module to see the above error.
    • The above error should not appear when the publication itself is no longer available, in which case, a different existing error will be displayed.

Implementation Brief

  • In assets/js/modules/reader-revenue-manager/components/settings/SettingsEdit.js:
    • At the very first, before rendering any errors or inputs, render the StoreErrorNotices component with the module slug and store name of Reader Revenue Manager.
    • After the existing error for unavailable publication, check if the rrmModuleV2 feature flag is enabled, the user has module access, the publication is available, and the saved product ID (within the productID module setting) no longer exists within the productIDs module setting.
      • If all the above conditions are met, render an ErrorText with a message according to the ACs.
  • Add Storybook story variant showing the said error.

Test Coverage

  • Add test coverage to verify the visibility of the above error.

QA Brief

Changelog entry

@nfmohit nfmohit self-assigned this Jan 29, 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 29, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 29, 2025

Note to AC Reviewer

I also added the IB while working on the ACs. If they look good to you, please move this directly to EB. Thank you!

@nfmohit nfmohit removed their assignment Jan 29, 2025
@techanvil techanvil self-assigned this Jan 30, 2025
@techanvil
Copy link
Collaborator

Thanks @nfmohit, good catch!

These AC/IB are looking good, one question though - do you know what the state of the product ID dropdown will be in this scenario, will it show the old value or an empty one, or possibly revert to the default openaccess value?

@techanvil techanvil assigned nfmohit and unassigned techanvil Jan 30, 2025
@nfmohit
Copy link
Collaborator Author

nfmohit commented Jan 31, 2025

Thank you for the review, @techanvil!

do you know what the state of the product ID dropdown will be in this scenario, will it show the old value or an empty one, or possibly revert to the default openaccess value?

This would basically act the same as the publication dropdown or the Analytics property dropdown in the situation where no publications or GA properties are available. In this case, it would just show the existing value of the productID module setting. WDYT? Thanks!

@nfmohit nfmohit assigned techanvil and unassigned nfmohit Jan 31, 2025
@techanvil
Copy link
Collaborator

Thanks @nfmohit, that SGTM!

IB ✅

@techanvil techanvil removed their assignment Feb 5, 2025
@nfmohit nfmohit added the Good First Issue Good first issue for new engineers label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good first issue for new engineers 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

2 participants