-
Notifications
You must be signed in to change notification settings - Fork 286
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
Implement RRM syncPublicationOnboardingState()
action
#8796
Comments
syncPublicationOnboardingState()
action
IB ✅ |
QA Update:
|
Thank you @wpdarren for testing this and raising your queries. Please find the answers below to the questions.
I have amended the description in QAB regarding this command. When the command is run for the first time, it will output
I see that there are no publications fetched from the API. So you will need to create couple of publications as mentioned in QAB. Also, note that when running the first command given in QAB instructions, you must replace the publication ID with the one you created in publisher centre. |
QA Update:
|
@wpdarren, you see results for |
Feature Description
The
syncPublicationOnboardingState()
action should be implemented for the Reader Revenue Manager module that syncs the value of thepublicationOnboardingState
module setting with the publication's onboarding state in the API.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
syncPublicationOnboardingState()
action should be implemented for themodules/reader-revenue-manager
data store that syncs the value of thepublicationOnboardingState
module setting with the publication's onboarding state in the API if a publication is connected to the module.publicationOnboardingStateLastSyncedAtMs
module setting to the current time, in the form of the number of milliseconds elapsed since the epoch (usingDate.now()
for example).publicationOnboardingState
module setting is updated from any other non-empty state toONBOARDING_COMPLETE
, as a side effect, the publication approved overlay notification (being implemented in #8843) should be displayed.syncPublicationOnboardingState()
action should be dispatched whenever thegetPublications()
selector is resolved.Implementation Brief
In
assets/js/modules/reader-revenue-manager/datastore/publications.js
:*syncPublicationOnboardingState()
action with the following logic:getModules()
selector.reader-revenue-manager
module is connected using theisModuleConnected
selector.getSettings()
selector of themodules/reader-revenue-manager
data store.publicationID
module setting using thegetPublicationID()
selector.publicationID
is not set, return early.getPublications()
selector to obtain the publications data.publicationID
module setting in the publications data.onboardingState
of the matched publication with thepublicationOnboardingState
module setting.publicationOnboardingState
module setting with the new value from the API i.e. theonboardingState
of the matched publication using thesetSettings()
action.publicationOnboardingStateLastSyncedAtMs
module setting with the current time usingDate.now()
using thesetSettings()
action.saveSettings()
action.publicationOnboardingState
module setting changes toONBOARDING_COMPLETE
from any other non-empty state, set theUI_KEY_SHOW_RRM_PUBLICATION_APPROVED_NOTIFICATION
key in thecore/ui
store to display the<PublicationApprovedOverlayNotification>
. (Note: This key may be different during the execution phase of #8843.)syncPublicationOnboardingState()
action:syncPublicationOnboardingState
action within the*getPublications()
resolver.Test Coverage
syncPublicationOnboardingState
action.QA Brief
Note 1: Ensure that you have publications setup in publisher center. Refer QAB of this issue on how to setup publications. Also, there should be atleast two publications setup for testing this.
Note 2: Ensure that "Custom Site URL" is NOT set in "Tester Settings" (Site Kit by Google Tester plugin).
refresh the page.
ONBOARDING_STATE_UNSPECIFIED
andpublicationOnboardingStateLastSyncedAtMs
is zero. This can be verified using following command in browser console.undefined
. Once request gets completed and then running the same command will output the publication data.notice that
publicationOnboardingState
andpublicationOnboardingStateLastSyncedAtMs
must have changed from the previous values to reflect the current onboarding state of the publication and the timestamp in milliseconds which should be the current time.Changelog entry
The text was updated successfully, but these errors were encountered: