Closed jimmymadon closed 2 months ago
AC ✔️
IB ✔️
@jimmymadon Issue > On View only dashboard zero and gathering data notifications are not showing. On latest environment zero and gathering data state notifications are showing.
@eugene-manuilov Assigning you here since you did the original CR/MR for this issue. So it will make sense to do the follow up PR as well. Thanks!
Feature Description
This issue is the first of many issues that will "use" the new datastore infrastructure to queue notifications while also creating a new
Notification
component that will be reused by other notifications.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
GatheringDataNotification
should be refactored and rendered (queued) using the newcore/notifications
datastore. This means that the component should not be called directly but via the genericgetQueuedNotifications
selector.GatheringDataNotification
should be extracted from theZeroDataStateNotifications
component and moved to thecheckRequirements
callback when registering this notification.Implementation Brief
assets/js/components/notifications/ZeroDataStateNotifications.js
:searchConsoleGatheringData
andanalyticsGatheringData
to thecheckRequirements(registry)
callback function when registering thegathering-data-notification
notification withinassets/js/googlesitekit/notifications/register-defaults.js
. The callback should return true only if eithersearchConsoleGatheringData
oranalyticsGatheringData
are true.gatheringDataTitle
and thegatheringDataWaitTimeInHours
to theGatheringDataNotification
component. This will include the code to computesearchConsoleGatheringData
oranalyticsGatheringData
. This means that theGatheringDataNotification
will not have any props anymore.searchConsoleZeroData
andanalyticsZeroData
to theassets/js/components/notifications/ZeroDataStateNotifications/ZeroDataNotification.js
component.assets/js/components/notifications/ZeroDataStateNotifications.js
eventually.assets/js/components/notifications/Notifications.js
similar to the PoC.viewContext
andareaSlug
.getQueuedNotifications(viewContext)
selector to fetch the queue of notifications. Check if the first notification in the queue has the sameareaSlug
as the prop passed, if it does, render this notification'sComponent
, otherwise do not render anything. Do notassets/js/googlesitekit/notifications/register-defaults.js
:GatheringDataNotification
component to theComponent
setting of thegathering-data-notification
notification. Currently, setisDismissible
to false as all the dismissal logic is still going to be handled by the react component itself.assets/js/components/notifications/BannerNotifications.js
:ZeroDataStateNotifications
withZeroDataStateNotification
.Notifications
component passing theareaSlug
asNOTIFICATION_AREAS.BANNERS_ABOVE_NAV
and the viewContext to beVIEW_CONTEXT_MAIN_DASHBOARD
if the dashboard is normal orVIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY
if the dashboard is view only.Test Coverage
QA Brief
Ideally - WAIT for #8977 to be merged and then QA both the issues together as they are exactly the same pattern in code.
SetupSuccessBannerNotification
is active - they should take precedence over the Gathering and Zero Data notifications.Changelog entry