-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add datastore infrastructure to get queuedNotifications
#8975
Labels
P2
Low priority
QA: Eng
Requires specialized QA by an engineer
Team S
Issues for Squad 1
Type: Enhancement
Improvement of an existing feature
Comments
jimmymadon
added
Type: Enhancement
Improvement of an existing feature
Team S
Issues for Squad 1
labels
Jul 8, 2024
AC and IB ✔️ |
@jimmymadon could you please add the estimate? |
Parking this one, while waiting for #8973 to get merged first |
18 tasks
QA: Eng ✅ I didn't see any console errors during smoke testing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
P2
Low priority
QA: Eng
Requires specialized QA by an engineer
Team S
Issues for Squad 1
Type: Enhancement
Improvement of an existing feature
Feature Description
This issue focuses on computing and fetching the "queue" of notifications from the
core/notifications
datastore that should be rendered one at a time.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
core/notifications
datastore which:registerNotification
action.viewContext
isNotificationDismissed(id)
selectorcheckRequirements()
callback function that each notification would have defined at the time of registering the notification.priority
getQueuedNotifications(viewContext)
selector as per the design doc.Implementation Brief
Use the PoC branch within the AC to speed up this issue. Copy-paste and then review the code where relevant.
assets/js/googlesitekit/notifications/datastore/notifications
:getNotifications()
selector which simply returns all thenotifications
currently stored within state.receiveQueuedNotifications(queuedNotifications)
action to the list of actions (similar toreceiveActiveIDs
within the PoC branch).RECEIVE_QUEUED_NOTIFICATIONS
(similar toRECEIVE_ACTIVE_IDS
in the PoC) and transfer the payload ofqueuedNotifications
to state.getQueuedNotifications(viewContext)
resolver (generator function) to theresolvers
object. Within it:getActiveNotifications()
resolver in the PoC branch, fetch the list of registered notifications using thegetNotifications()
selector.notification
objects using a filter function which:viewContext
param does not exist in the list ofviewContexts
within each notification's data.isDismissble
data for a notification is true and theisNotificationDismissed(id)
selector returns true (theid
is available fron the notification's data).checkRequirements()
callback function within the notification's data for all notifications synchronously and filter out notifications where the callback returns false.priority
defined in the notification's data. This final result will be an array ofqueuedNotifications
.yield
the result using theactions.receiveQueuedNotifications(queuedNotifications)
action defined above.getQueuedNotifications(viewContext)
selector which returns undefined if the above resolver isn't resolved. Otherwise, it should return thequeuedNotifications
from state.Test Coverage
getQueuedNotifications()
andgetNotifications()
selectors, as well as the newreceiveQueuedNotifications()
action.QA Brief
QA Eng
assets/js/googlesitekit/notifications/register-defaults.js
, register a bunch of new notifications that test the various points within the AC. A sample test snippet which registers three notifications is given below. Then call thegetQueuedNotifications()
selector (twice as it won't resolve the first call).Code Snippet for widget registration
Changelog entry
The text was updated successfully, but these errors were encountered: