-
Notifications
You must be signed in to change notification settings - Fork 297
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 Audience Segmentation / FPM Setup Success Subtle Notifications to use a new "on demand" notification #9453
Comments
AC ✅ |
It looks like this IB was cut off/is missing text, can you expand on this part? The bullet points below don't really flow from that sentence 🤔 Also, instead of the |
@tofumatt Your point to not overload checkRequirements was very valid. So I realised that we don't need to register these notifications with an additional setting to just "ignore" queuing this notification! Might as well insert them in the queue only when needed and leave them out of the usual registration and queueing process. @aaemnnosttv Will be good to have your review here too as we discussed this in our last meeting. |
The IB mostly sounds good to me here, just a few points to add:
|
@aaemnnosttv Thank you for all the helpful suggestions - I have updated the IB. |
I'm not a fan of any of these options really, and invoking Another issue with this approach is that an on-demand notification would be the slowest to appear if we waited for all other notifications to queue before it could be inserted, which undermines the potential benefit of respecting the given notification's priority as we'd want it to be considered at the time the queue is populated. Let's think about this some more as I don't see an obvious solution to the above. |
Feature Description
In #9281, to render the Audience Segmentation setup success notification, which needs to be rendered without a new page load or without the changes to query args, we simply invalidate the resolution of the
getQueuedNotifications
resolver to re-evaluate the full queue. Instead, it this notification would be ideal to add the concept of an 'on-demand' notification which is "added" to the queue without a page reload or needing re-evaluation of the entire queue.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/js/googlesitekit/notifications/datastore/notifications.js
:insertNotification(notification)
, where notification is a full notification object as per our new API.resolveSelect
thegetQueuedNotifications
selector for theviewContext
and thegroupID
of the incoming notification to ensure this resolver does not overwrite the queue after the incoming notification has been inserted.queuedNotifications
state for the notification's givengroupID
, similar to thequeueNotification(notification)
action.id
of the notification to be inserted with existing notifications in thequeuedNotifications
state for thatgroupID
.priority
. Do this by looping through the array of queuedNotifications and finding the priority of existing notifications with the incoming notification and inserting the notification before the element with a higher priority number.assets/js/modules/analytics-4/index.js
andassets/js/googlesitekit/notifications/register-defaults.js
respectively:AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION
andsetup-success-notification-fpm
notifications.assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupCTAWidget.js
andassets/js/components/notifications/FirstPartyModeSetupBanner.js
:setupSuccessNotification
with the same options of the notifications that were removed from registration above. There is no need to definecheckRequirements
anymore as these notifications will not be "queued" in the normal way on each page reload.insertNotification(notification)
action instead of theinvalidateResolution( 'getQueuedNotifications' )
call. For FPM, remove custom logic that usescore/ui
setValue / getValue to show the notification.Test Coverage
insertNotification
action.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: