Closed jimmymadon closed 1 month ago
AC + IB ✔️, but the estimate is too high, I will reduce it to 7 since that is more than enough for this task.
@eugene-manuilov Yes ok - I think the real estimate here was probably slightly more than 3 (making it a 7). So thats why I just went up one level like we do for all issues.
develop
branchSee details below. I did have one observation that I synced with @jimmymadon on where a notice ID was still marked as expired even after the expiry time unless the page was reloaded or another notifications API request was made. It turns out this is intended behaviour as we never want a notice to show again (even if dismissed) on the same page view session.
Feature Description
This issue focuses on adding an action and a selector as wrappers to the
dismissed-items
partial functions to dismiss notifications withincore/notifications
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
dismissNotification(id, { expiresInSeconds })
action should add a dismissed notification as a dismissed item.isNotificationDismissed(id)
selector should check if the notification is dismissed or not.Implementation Brief
Wait for #8973 to be merged so the datastore has been scaffolded.
[x] Within
assets/js/googlesitekit/notifications/datastore/notifications.js
:baseActions
as defined in the AC.id
since the invariant for thedimissItem
action assumes the item to be a tour.dismissItem(slug, {expiresInSeconds})
action within thecore/user
datastore.isItemDismissed(slug)
selector to check if a given notification is dismissed or not.[ ] Add the new partial datastore to the
combineStores
function call in theindex.js
file.Test Coverage
Add tests for the new action and selector.
QA Brief
*Smoke test the plugin, mainly the dashboard to check for any new console errors.
QA: Eng
Use the console to test the new action and selector.
Changelog entry