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

Refactor UnsatisfiedScopesAlertGTE to use the new Notifications datastore and "layout" components #8979

Closed
3 tasks
jimmymadon opened this issue Jul 8, 2024 · 5 comments
Labels
P2 Low priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@jimmymadon
Copy link
Collaborator

jimmymadon commented Jul 8, 2024

Feature Description

This issue refactors another (the second) "Error" notification in Site Kit as part of Phase 1 of the Banner Notifications Refactoring epic. It should refactor the UnsatisfiedScopesAlert so that it uses the new datastore infrastructure to register and queue the notification. It should also use newer lighter "layout" and "common" components that replace the bloated BannerNotification component as per the pattern introduced in #9071.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The UnsatisfiedScopesAlertGTE component should be refactored so that it is registered and rendered (queued) using the new core/notifications datastore.
  • This notification component should not be called directly (i.e. in ErrorNotifications) but only via the generic getQueuedNotifications selector.
  • The refactored component should not contain any business logic that hides it / prevents it from rendering. This logic should be contained in a callback function defined during registration.
  • The component should not use the bloated BannerNotification component. Instead, it should be rendered using the new Notification component wrapper and a simpler "layout" component that solely encapsulates its structure and design.

Implementation Brief

  • Update assets/js/components/notifications/UnsatisfiedScopesAlertGTE.js
    • Check the assets/js/components/notifications/UnsatisfiedScopesAlert.js for the example/starting point
    • Remove usage of BannerNotification component
    • Include 2 new props - id and Notification
    • Wrap the component with Notification component passed as the prop
    • Use new components from assets/js/googlesitekit/notifications/components/common/ and layout to assemble the notification using the existing props used to for BannerNotification
  • Update assets/js/googlesitekit/notifications/register-defaults.js
    • Register the notification, following the existing patterns already added - you can re-use the one used for UnsatisfiedScopesAlert
    • For checkRequirements transfer the existing checks from assets/js/components/notifications/ErrorNotifications.js
    • For priority, keep it the same as the one added for UnsatisfiedScopesAlert notification
  • Remove UnsatisfiedScopesAlertGTE from the assets/js/components/notifications/ErrorNotifications.js

Test Coverage

  • Add stories for new notification. You can use stories added for UnsatisfiedScopesAlert as an example

QA Brief

a:8:{i:0;s:46:"https://www.googleapis.com/auth/supportcontent";i:1;s:46:"https://www.googleapis.com/auth/userinfo.email";i:2;s:42:"https://www.googleapis.com/auth/webmasters";i:3;s:50:"https://www.googleapis.com/auth/analytics.readonly";i:4;s:48:"https://www.googleapis.com/auth/siteverification";i:5;s:6:"openid";i:6;s:39:"https://www.googleapis.com/auth/adwords";i:7;s:48:"https://www.googleapis.com/auth/userinfo.profile";}
  • Also ensure the wp_googlesitekit_additional_auth_scopes record for the user is also deleted or removed if it exists.

Changelog entry

  • Update Google Tag scope notifications to use new notifications infrastructure.
@jimmymadon jimmymadon added Type: Enhancement Improvement of an existing feature Team S Issues for Squad 1 labels Jul 8, 2024
@binnieshah binnieshah added the Next Up Issues to prioritize for definition label Jul 8, 2024
@eclarke1 eclarke1 added the P2 Low priority label Jul 8, 2024
@tofumatt tofumatt changed the title Refactor the UnsatisfiedScopesAlertGTE to use the new Notifications datastore Refactor UnsatisfiedScopesAlertGTE to use the new Notifications datastore Jul 23, 2024
@tofumatt
Copy link
Collaborator

Moving this to the backlog until #8976, which is marked as blocking this issue, is completed. That way we can mirror the approach used in #8976 for other migrations/refactoring.

@tofumatt tofumatt removed the Next Up Issues to prioritize for definition label Jul 23, 2024
@jimmymadon jimmymadon self-assigned this Aug 12, 2024
@jimmymadon jimmymadon changed the title Refactor UnsatisfiedScopesAlertGTE to use the new Notifications datastore Refactor UnsatisfiedScopesAlertGTE to use the new Notifications datastore and "layout" components Aug 12, 2024
@jimmymadon jimmymadon removed their assignment Aug 12, 2024
@eugene-manuilov eugene-manuilov self-assigned this Aug 13, 2024
@eugene-manuilov
Copy link
Collaborator

AC ✔️

@eugene-manuilov eugene-manuilov removed their assignment Aug 13, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Aug 15, 2024
@eugene-manuilov eugene-manuilov self-assigned this Aug 15, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Aug 15, 2024
@jimmymadon jimmymadon self-assigned this Sep 1, 2024
@jimmymadon jimmymadon removed their assignment Sep 2, 2024
@tofumatt tofumatt assigned tofumatt and jimmymadon and unassigned tofumatt Sep 2, 2024
@jimmymadon jimmymadon assigned tofumatt and unassigned jimmymadon Sep 2, 2024
@tofumatt tofumatt removed their assignment Sep 3, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Sep 4, 2024

QA Update ❌

Tested on dev environment.

@jimmymadon

Issue - Alignment ofunsatisfiedscopeGTEalert is not correct on dev environment.

image

image

@mohitwp mohitwp removed their assignment Sep 4, 2024
@tofumatt tofumatt assigned tofumatt and mohitwp and unassigned jimmymadon and tofumatt Sep 4, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Sep 5, 2024

QA Update ✅

  • Tested on main environment.
  • Verified gathering and zero data notifications for both SC and analytics.
  • Verified gathering and zero data notifications appearing on both Main and entity dashboard.
  • Verified UnsatisfiedScopesAlertGTE appear before gathering or zero data notifications.
  • Verified alignment issue mentioned above is now fixed.

Latest

image

Main

image

Recording.1367.mp4

@mohitwp mohitwp removed their assignment Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Low priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants