Refactor ModuleRecoveryAlert
to use the new Notifications datastore
#9299
Labels
ModuleRecoveryAlert
to use the new Notifications datastore
#9299
Feature Description
This issue should refactor
ModuleRecoveryAlert
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
ModuleRecoveryAlert
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
ModuleRecoveryAlert
componentUnsatisfiedScopesAlert
component for an exampleid
andNotification
Notification
component passed as the propBannerNotification
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 partsite-kit-wp/assets/js/googlesitekit/notifications/components/layout/NotificationWithSmallSVG.js
Lines 32 to 37 in b6c7c59
SimpleNotification
as wellsite-kit-wp/assets/js/components/notifications/BannerNotification/index.js
Lines 142 to 156 in b6c7c59
BannerNotification
ifdismissExpires
prop is includedassets/js/googlesitekit/notifications/components/common/
where needed, likeActionsCTALinkDismiss.js
to includeactions
prop to the new layoutisLoading
logic and progress bar, as it is not needed, the conditions to determine if notification should be shown is handled bycheckRequirements
property in new notifications APIchildren
(excluding the progress bar)assets/js/googlesitekit/notifications/register-defaults.js
checkRequirements
transfer the existing check fromsite-kit-wp/assets/js/components/dashboard-sharing/ModuleRecoveryAlert/index.js
Lines 149 to 154 in 56feb1f
isLoading
check as well, to return early if conditions are not met10
from the last added general notification (not including the error type notification which start from 150)NOTIFICATION_AREAS.BANNERS_ABOVE_NAV
forareaSlug
true
forisDismissible
property. As notification is dismissible by default, and since progress bar is removed, that value shouldn't change.ModuleRecoveryAlert
from theassets/js/components/notifications/BannerNotifications.js
Test Coverage
assets/js/components/dashboard-sharing/ModuleRecoveryAlert/index.stories.js
to reflect new changesQA Brief
Note you may need to remove your
module-recovery-alert
key from thewp_googlesitekitpersistent_dismissed_items
key inusermeta
for your user to show the error immediately for your user in subsequent tests.wp_googlesitekitpersistent_dismissed_items
item in theusermeta
table and checking the expiry timestamp for the notificationmodule-recovery-alert
).Changelog entry
The text was updated successfully, but these errors were encountered: