-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 access list notifications support to new notifications list #41662
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, was it intentional that the dropdown doesn't close after clicking on a notification?
cba98ac
to
6605d07
Compare
b0e6ebe
to
15a13b6
Compare
6605d07
to
1f53170
Compare
15a13b6
to
f425c2b
Compare
@avatus @kimlisa FYI this now as an |
f425c2b
to
8df84fc
Compare
8df84fc
to
6c9e501
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff, thanks for resolving all issues!
LGTM after addressing some minor issues
233c795
to
a5f51e8
Compare
a5f51e8
to
54b1b4a
Compare
Purpose
Part of #37704
e
counterpart: https://github.com/gravitational/teleport.e/pull/4221This PR adds access list notifications support to the new notifications list in the WebUI.
Implementation
The frontend currently supports access list notifications by fetching access lists on init, and then running some logic to determine whether any of them need to be reviewed soon, and then if so, creating client-side notifications and adding them to a
notificationsStore
which the topbar notifications pane reads from.With the new notifications system, notifications are generated and stored in the backend, but this isn't feasible for access list notifications because the system doesn't support scheduling notifications for a specific time. The workaround implemented in this PR uses the existing frontend method for showing access list notifications, and adapts it to the new notifications list.
When "real" notifications are fetched from the backend and shown in the UI list, the notifications component will also read from the
notificationsStore
and prepend any access list notifications to the final list of notifications. This only ever needs to be done on the first fetch.It is also possible to mark these access list notifications as clicked or hide them, as is the behaviour for the other "real" notifications, these states are kept in
localStorage
.This PR also includes some improvements to the way updating notification states is done in the frontend.
Demo
access.list.notifications.mov