-
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 <PublicationSelect>
component
#8837
Comments
Thank you for the IB, @ankitrox ! Please take a look at my comments below:
Let's remove this requirement as this property should already be a part of the I think it might be beneficial to use the Analytics
For Storybook stories, I don't think it'll be very valuable to add a Storybook story for this component alone. This will likely be included in the Storybook stories for the module setup and settings screens, so an individual story may seem redundant. Let me know what you think and if you have any questions, thank you! |
Thanks @nfmohit for reviewing the IB. I have updated the IB as per the suggested points. Re-assigning to you for review. Thanks again! |
Thank you for the updates, @ankitrox ! I've made a few changes to the IB to reduce the back and forth, namely:
Please let me know if you have any questions. IB LGTM 👍 ✅ |
As you can see from the discussion on previous PR, we just added the component along with the message so that it is convenience to test. We will test it thoroughly in #8800
Sorry for not including this. It looks like this was missed during our previous round. I have created a new PR #9073 to address the issue. Also, addressed the width issue in same PR, although I believe that we could have kept the width as is to maintain consistency along with other select components. We can check if there is any feedback in CR for the same.
This is will be handled in #8796 here . The reason, it can't be seen in action as of now is because we are yet to integrate everything in setup screen. We can test this in #8800
As per the discussion mentioned previously, we can test all the styling things in #8800 |
Back to you for another pass, @kelvinballoo. Please note that with regard to Item 2, the dropdown size is derived from content. As per this #9073 (comment) (which you may have already seen):
|
QA update ✅Noted on Item 1, 3 and 4. Also tested the following:
Moving ticket to Approval. |
Moving this back to execution to fix the RRM |
Thanks @techanvil , merged 👍 |
Feature Description
A
<PublicationSelect>
component should be added for the Reader Revenue Manager module that presents the user with a list of available publications and allows them to select one of them. The selected publication should be stored in the data store within thepublicationID
module setting, with its onboarding state stored within thepublicationOnboardingState
module setting.Screenshot for reference
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
PublicationSelect
component should be added for the Reader Revenue Manager module that presents the user with a dropdown of all available publications, according to the Figma designs.publicationID
: Should contain the publication ID of the selected publication.publicationOnboardingState
: Should contain the onboarding state of the selected publication.publicationOnboardingStateLastSyncedAtMs
: Should contain the current time, in the form of the number of milliseconds elapsed since the epoch.Implementation Brief
analytics-4
ProperySelect
component can be used as a reference point here.assets/js/module/reader-revenue-manager/components/common/PublicationSelect.js
. It should accept the following props.isDisabled
- Flag whether Publication select should be in disabled/enable state.classNames
- Class names forSelect
component fromgooglesitekit-components
.onChange
- Function to call when value in dropdown changes.hasModuleAccess
- Flag to tell if the user has current module access.getPublications
selector implemented in Implement RRMgetPublications()
selector #8794 to get the list of publications.getPublications
selector will only be called whenhasModuleAccess
is notfalse
andisDisabled
is not falsy.isValidPublicationID
inassets/js/modules/analytics-4/utils/validation.js
which should check if publication ID is valid. A publication ID should be string of only alphabets and digits. This should be similar toisValidMeasurementID
function here.onPublicationChange
usinguseCallback
which would be passed toonEnhancedChange
prop ofSelect
component fromgooglesitekit-components
.onPublicationChange
should set thepublicationID
,publicationOnboardingState
using set method from thecreate-settings-store
i.e.setPublicationID
andsetPublicationOnboardingState
. These values should be received fromgetPublications
selector.publicationOnboardingStateLastSyncedAtMs
using same method, it should contain the current time, in the form of the number of milliseconds elapsed since the epoch.Publication
toSelect
component.Select
component with no publications (other than if one is already selected) ifhasModuleAccess
is explicitlyfalse
, similar to the AnalyticsPropertySelect
component.ProgressBar
component if the publications are loading. Take the reference ofPropertySelect
component here which does the same.isResolving
selector to check if the resolver forgetPublications
is still running.Test Coverage
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).
Go to
Site Kit > Settings > Connecte More Services > Reader Revenue Manager
, clickSet up Reader Revenue Manager
CTA.This will take you to the setup screen where initially there must be a loading progress bar till publications are getting fetched.
Once publications are fetched, select component will be visible.
Run the following command in browser console.
which should produce the following output.
Select any publication from the list and run the same command. This time there must be
publicationID
andpublicationOnboardingState
set in the response.Repeat step 5 by selecting other publications, note that every time the publication ID needs to be different.
Changelog entry
The text was updated successfully, but these errors were encountered: