This issue should refactor theWebDataStreamNotAvailableNotification so that it uses the new datastore infrastructure to register and queue the notification. It should also incorporate a new "layout"
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
The WebDataStreamNotAvailableNotification 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 BannerNotifications) 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.
Check the UnsatisfiedScopesAlert component for an example
Include 2 new props - id and Notification
Wrap the component with Notification component passed as the prop
Remove the ProgressBar and it's condition from notification, as display conditions are handled in checkRequirements of the registration API, so showing progress bar is not needed any more
Feature Description
This issue should refactor the
WebDataStreamNotAvailableNotification
so that it uses the new datastore infrastructure to register and queue the notification. It should also incorporate a new "layout"Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
WebDataStreamNotAvailableNotification
component should be refactored so that it is registered and rendered (queued) using the newcore/notifications
datastore.BannerNotifications
) but only via the genericgetQueuedNotifications
selector.BannerNotification
component. Instead, it should be rendered using the newNotification
component wrapper and a simpler "layout" component that solely encapsulates its structure and design.Implementation Brief
WebDataStreamNotAvailableNotification
componentUnsatisfiedScopesAlert
component for an exampleid
andNotification
Notification
component passed as the propProgressBar
and it's condition from notification, as display conditions are handled incheckRequirements
of the registration API, so showing progress bar is not needed any moreBannerNotification
component, and replace it with the new simple layoutSimpleNotification
, you can start it off fromassets/js/googlesitekit/notifications/components/layout/NotificationWithSmallSVG.js
and remove this part https://github.com/google/site-kit-wp/blob/b6c7c59c9bece36c8b0138d2e3d4f05a2f09479a/assets/js/googlesitekit/notifications/components/layout/NotificationWithSmallSVG.js#L32-L37 if not already presentSimpleNotification
as well https://github.com/google/site-kit-wp/blob/b6c7c59c9bece36c8b0138d2e3d4f05a2f09479a/assets/js/components/notifications/BannerNotification/index.js#L142-L156 so it can be used in same way it is inBannerNotification
ifdismissExpires
prop is includedassets/js/googlesitekit/notifications/register-defaults.js
checkRequirements
use the existing check from https://github.com/google/site-kit-wp/blob/b6c7c59c9bece36c8b0138d2e3d4f05a2f09479a/assets/js/components/notifications/BannerNotifications.js#L126isWebDataStreamAvailable
and ifmeasurementID !== undefined
, from theWebDataStreamNotAvailableNotification
component itself10
from the last added general notification (not including the error type notification which start from 150)NOTIFICATION_AREAS.BANNERS_ABOVE_NAV
forareaSlug
WebDataStreamNotAvailableNotification
from theassets/js/components/notifications/BannerNotifications.js
Test Coverage
assets/js/components/notifications/WebDataStreamNotAvailableNotification.stories.js
to account for new changesQA Brief
Changelog entry