Create Sign in With Google banner notification to prompt user to enable feature
Feature Description
A banner prompting users to enable Sign in with Google should be added to Site Kit. See the Figma design/screenshot below for the banner and its contents.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The banner should only appear when the
signInWithGoogleModulefeature flag is enabled. - A new notification banner should appear for users that have not connected the Sign in with Google module.
- It should follow the Figma design
- The banner should only appear when:
- The user can enable Sign in with Google (eg. their website supports HTTPS)
- They have not permanently dismissed the banner
- The "Set up Sign in with Google" button should direct the user to the Sign in with Google setup flow, the same as connecting the Sign in with Google module from the "Connect more Services" modules page
- The "Maybe later" button should dismiss the notification permanently.
Implementation Brief
- [ ] Add
assets/js/components/notifications/SignInWithGoogleModuleSetupCTAWidget.js- You can check
GatheringDataNotificationcomponent for an example of using this new Notifications infrastructure - Include 2 new props -
idandNotification - Wrap the component with
Notificationcomponent passed as the prop - Create a new layout -
assets/js/components/notifications/NotificationWithSVG.js- It should render SVG next to the content on desktop and bellow the CTA's on mobile and tablet, following the Figma designs
- Extract the layout from
BannerNotification,you can re-using the logic aroundWinImageSVG - You can check
assets/js/googlesitekit/notifications/components/layout/NotificationWithSmallSVG.jsfor example. It should contain only the needed layout including the passed SVG,title,descriptionandactions
Set up Sign in with GoogleCTA callback should redirect to the module setup page- Use
useActivateModuleCallback( 'sign-in-with-google' )as the callback Maybe laterCTA should dismiss notification,ActionsCTALinkDismisscomponent should be used for both CTA's, and for dismiss it is enough to providedismissLabelprop.dismissExpiresis0by default, which is correct value for this case, where we are dismissing it permanently.
- You can check
- [ ] Update
assets/js/googlesitekit/notifications/register-defaults.js- Register the notification, following the existing patterns already added
- For
checkRequirements:- If
signInWithGoogleModulefeature flag is not enabled return early - Check if site is using HTTPS, using
isURLUsingHTTPShelper function, and pass it a home URL, obtained fromgetHomeURLselector fromCORE_SITEdatastore - Check if
sign-in-with-googlemodule is connected usingisModuleConnectedfromCORE_MODULESdatastore, and return early if it is not connected
- If
- For priority, bump it by
10from the last added banner notification (not including error ones, which start from150, the regular ones start from300). - Use
NOTIFICATION_AREAS.BANNERS_BELOW_NAVforareaSlug - Include
isDismissibleproperty withtruefor value
Test Coverage
- Add stories file and VRT for the banner
QA Brief
Changelog entry
For
checkRequirements:
- If
signInWithGoogleModulefeature flag is not enabled return early- Check if site is using HTTPS, using
isURLUsingHTTPShelper function, and pass it a home URL, obtained fromgetHomeURLselector fromCORE_SITEdatastore
@zutigrm, the following requirement is missing:
A new notification banner should appear for users that have not connected the Sign in with Google module.
@eugene-manuilov ah indeed! Thanks, IB updated
- Check if
clientIDsetting from Sign in with google module is empty, to return early
@zutigrm, we should use isModuleConnected to check whether or not the module is connected.
@eugene-manuilov Updated
Thanks, IB ✔
QA Update ⚠
Hi @jimmymadon , I've set up a site but the banner isn't showing at all. Video is attached for reference.
- Feature flag is on, develop branch is on, the module SiWG is disconnected, site is HTTPS
- Am I missing anything else?
@kelvinballoo I should've just seen the video first! You've got the Zero Data Notification banner showing! So in this case, if you dismiss or action that banner, the Sign in with Google banner should then appear. This behaviour will change after #9568 is merged though as the Notification Banners and Setup CTA banners will have their own "queue"!
QA update ⚠
Thanks @jimmymadon . The banner showed up after dismissing it the Zero data banner. I had a first round of testing and I have some observations/queries below:
ITEM 1: The 'Set up Sign in with Google' button text should have been 'Google Sans Display' based on Figma. Currently, it's 'Google Sans Text'. If this is standardise with other CTAs of the plugin, that's fine and this can be ignored.
Actual:
ITEM 2: When viewed on mobile, the image layout is smaller than what is on Figma on the same breakpoint width. The 'Maybe later' button is also sitting below the 'Set up Sign in with Google' button currently. On Figma, it's next to each other. Photos attached for reference.
Actual:
ITEM 3: Similar observation on tablet. The graphic is smaller compared to figma on the same breakpoint width. Photos attached for reference.
Actual:
ITEM 4: On desktop Safari, the graphic is not showing up at all. Tested on Safari Version 17.6 (19618.3.11.11.5), MacOS Sonoma 14.6.1 It appears for Edge, Firefox and Chrome.
Also tested on Browserstack:
ITEM 5: This is a query around the AC:
The notification should not reappear if the module is already set up and connected, or if the notification was dismissed
or if the site does not use HTTPS.
- If let's say I have connected the module with incomplete setup and proceeded to disconnect it. I never dismissed the banner. Should the banner re-appear in that case?
- Currently all the sites that I would create on tastewp and instawp would have https. Is there an easy way to test for HTTP website?
@kelvinballoo
ITEM 1
Yes, that is correct. I've created Issue #9675 that should fix this.
ITEM 2 and ITEM 3 SVG Images
Again, #9675 should improve the way we render SVGs on different viewports. However, I have fixed the Maybe later button stacking instead of being side by side in my follow up PR which is now merged.
ITEM 4
Fixed in the follow up PR.
ITEM 5 If let's say I have connected the module with incomplete setup and proceeded to disconnect it. I never dismissed the banner. Should the banner re-appear in that case?
Yes, I believe so. The conditions in the AC are all mutually independent of each other. So in the case you mention, the banner was never dismissed and the module is fully disconnected.
Is there an easy way to test for HTTP website?
I think this can be done locally by any engineer as QA:Eng if everything else is tested. This might be simpler than you trying to force a HTTPS website to work with HTTP.
QA Update ⚠
Thanks @jimmymadon . Noted that items 1-3 will be fixed under #9675. ✅
ITEM 2 ✅ Tested for the button placement and it's displaying as expected with the buttons next to each other and not stacked.
ITEM 4 ✅ Verified on Safari and the graphics are now displaying as expected.
ITEM 5 ⚠ RE: Banner re-appearance I have a particular scenario:
-
I see the banner
-
I click 'Set up SiWG' on the banner
-
I do not complete the setup
-
I disconnect the SiWG module
-
I go to the homepage. Should the 'SiWG' banner appear again? I am assuming no because currently it doesn't and I believe it's because we already clicked on the banner. That said, if the expectation is for the banner to re-appear, that would need to be further looked into in another issue. Video is attached for reference
https://github.com/user-attachments/assets/b295fc42-5ff8-438e-9613-6881392bbcea
RE: HTTP Noted, I will add the QA:Eng label for an engineer to test locally that an HTTP site should not have the banner to show.
Assigning ticket to @jimmymadon to review ITEM 5.
I go to the homepage. Should the 'SiWG' banner appear again? I am assuming no because currently it doesn't and I believe it's because we already clicked on the banner. That said, if the expectation is for the banner to re-appear, that would need to be further looked into in another issue.
@tofumatt What do you think the behaviour should be here? When we click on the CTA or the Maybe later button, the notification is "dismissed" purposefully. This is fine until someone disconnects the module. Should we be removing the dismissal when we "disconnect" the module? I think we do this for some other modules. If yes, then we should create a separate issue as that will involve adding a simple action on when the module is disconnected.
I don't think we should show the CTA again after a user has purposefully connected and disconnected the module. Presumably they did so for a reason, so reminding them to connect something they've already disconnected quite intentionally seems bad UX. I think it's fine that the banner doesn't appear again 👍🏻
QA ✅ from me on the QA: Eng section, so moving to Approval.