Closed nfmohit closed 1 month ago
Nice work, @ankitrox ! IB LGTM 👍 ✅
One flag is that whenever the publications have already been retrieved and I click on the dropdown, there is a console error. Refer to the video attached. ⚠️ However, it's worth noting that after I did Scenario 3, I could not replicate this issue anymore.
Other items successfully verified are as follows: ✅
Scenario i. Publication ID is not set.
Scenario ii. Populating publications when synced. The scenario is verified good overall as per the first video attached in this comment.
Scenario iii. Publication ID is set, publications should not get loaded again.
After a round of review, this aria hidden console error actually happens on other SK module dropdowns as well. Hence, this will be tackled in a separate issue, logged here: https://github.com/google/site-kit-wp/issues/9142
This ticket is good to be moved to approval.
The 3 scenarios were verified good: ✅
Scenario i. Publication ID is not set. Reloading happens as expected.
Scenario ii. Populating publications when synced. Reloading happens as expected.
Scenario iii. Publication ID is set, publications should not get loaded again. Reloading does not happen, as expected.
Feature Description
The Reader Revenue Manager module setup should support automatic refresh behaviour similar to the AdSense module's setup flow: If you navigate away for a certain amount of time and then return to the tab, it should automatically re-run the relevant API requests, to see if maybe something on the SwG API side has changed. This is crucial since all write actions happen within the Publisher Center UI and are therefore unknown to Site Kit.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
publicationID
module setting is not set.Implementation Brief
resetPublications
inassets/js/module/reader-revenue-manager/datastore/publications.js
added in #8794.getPublications
selector.getPublications
usinginvalidateResolutionForStoreSelector
onmodules/reader-revenue-manager
store. Refer the similar implementation in adsense module.SetupMain
component for the module, create a functionreset
.publicationID
is set in the module settings. It can be checked usinggetPublicationID
selector.publicationID
is not set,resetPublications
action should be called.useReFocus
hook should be used to callreset
function mentioned above every 15 seconds.Test Coverage
Add tests for
resetPublications
action.QA Brief
Scenario i. Publication ID is not set.
Activate the module. This will redirect to the setup screen.
There should be a progress bar which shows the publications are loading.
Once publications dropdown is visible, navigate away from the current tab in browser. You can open a different tab and stay there for 15+ seconds. Come back to the setup tab again and you should see that publications are loading again (a progress bar to load publications).
Scenario ii. Populating publications when synced.
Activate the module. This will redirect to the setup screen. Wait till publication dropdown appears.
Run the following command in browser.
This will clear all publications from dropdown.
Scenario iii. Publication ID is set, publications should not get loaded again.
Activate the module. This will redirect to the setup screen. Wait till publication dropdown appears.
Run the following command in browser.
Changelog entry