[SIP-96] Proposal for adding a notification feature
- Dominant language
- Python
- Stars
- 74.8k
- Forks
- 18.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 692
Description
**Motivation**
As maintainer of a Superset Instance, I want to be able to message my users, so I can inform them about possible downtimes, data troubles or other causes.
This can of course be achieved in various channels (Mail, Slack, Teams, etc) but it also makes sense to do this in the actual tool used, in this case right inside Superset.
**Proposed Change**
Luckily, Superset already has a messaging capability built in: so-called Toasts, which are displayed after certain actions like saving, refreshing dashboards and so on.
We have created a “management interface” for such toasts, in which new messages (we call them notifications) can be configured:
Following parameters can be set:
· Active
· Name or Summary
· Category (currently 3 categories, these manage the color of the notification: Info=blue, Warning=yellow, Alert=red)
· Message: The message to be displayed.
· Time Range: The range in which the notification should be displayed
· Use daily timeframe: If active, the notification is only shown when the current time is inside the start and end time
· Re-trigger: Minimum of 5 Minutes to reduce the load on the database due to querying for new messages for each user
· Duration: How long until the notification disappears (it can always be closed via the ‘x’)
· Roles: Which roles should see that notification
For each user, the internal database is queried at login and at a certain interval to see if she/he has new notifications pending.
Example notification in action:
NOTE: This should be behind a feature flag like “ENABLE_UI_NOTIFICATIONS”
**New or Changed Public Interfaces**
Extends internal database to include two additional schemas: public.notification and public.notification.roles
Extends API to include endpoints for management of Notifications
Adds an entry in the Settings menu
Adds new permission for notification management
**Migration Plan and Compatibility**
Database migration necessary to include new tables
**Rejected Alternatives**
Using another method of displaying notifications, e.g. as a banner on top of Superset or below the menu bar. Rejected in favor of using existing and proven methods already built in.
Contributor guide
Assessment
This issue has not been assessed yet.