Class: UserNotification
Notification Client (Finsemble Workspaces)
Finsemble makes use of pop up (toast) notifications for communicating information to the end user in a gentler way than modal dialogs. Use the Notification API to route messages so that your components can create these notifications.
Notifications are called from FSBL.UserNotification.alert
.
See the Notifications tutorial for an overview.
new UserNotification
()
common/userNotification.js, line 32
Methods
-
alert(topic, frequency, identifier, message, params)common/userNotification.js, line 79
-
Conditionally alerts the end user using a desktop notification.
Name Type Description topic
string Specifies a category for the notification. This parameter is reserved for future use; it is designed to filter notifications (e.g., applying regEx's defined in config to determine which notifications are displayed). Any topic string can be specified; however "system" is the recommended topic for system notifications applicable both to end uses and to developers. "dev" is the recommended topic for notifications applicable only during development (e.g., a notification that config.json has an illegal value).
frequency
string Either "ALWAYS", "ONCE-SINCE-STARTUP", or "MAX-COUNT" to determine if alert should be displayed. Note, the frequencies are based on the number of notifications emitted from a window (as opposed to system wide).
identifier
string Uniquely identifies this specific notification message. Used when "frequency" is set to "ONCE-SINCE-STARTUP" or "MAX-COUNT".
message
any Message to display in the notification. Typically a string. Finsemble's built in templating accepts and object. See ../src/components/notification/notification.html.
params
object optional Name Type Description duration
number Time in milliseconds before auto-dismissing the notification (defaults to 24 hours).
maxCount
number Specifies the max number of notifications to display for specified identifier when frequency="MAX-COUNT" (default is 1).
url
number The URL for for notification HTML. If not provided then the system default will be used. Defaults to Finsemble's built-in version at "../components/system/notification/notification.html".
Example
FSBL.UserNotification.alert("system", "ONCE-SINCE-STARTUP", "MANIFEST-Error", message); FSBL.UserNotification.alert("dev", "ALWAYS", "Config-Error", message, { url: notificationURL, duration: 1000 * 5 }); FSBL.UserNotification.alert("dev", "MAX-COUNT", "Transport-Failure", message, { url: notificationURL, maxCount: 2 });