Notification spec
Notification messages are displayed in the notification panel which the user can access by clicking the Notifications icon in the toolbar.
Each notification message is described by a simple JavaScript object like this:
{id: <string>,type: <string>,title: <string or JSX object>,content: <string or JSX object>,timestamp: <string>,callback: <function>,closeMessage: <string or JSX object>}
where:
- id(string, required): this is a unique ID assigned to the notification message. This is passed as a parameter in the callback (see below) and is used to reference messages when deleting them through the- CanvasControllerAPI.
- type(string, required): this must be one of four values: “info”, “success”, “warning”, or “error”. If- typeis null, empty string, or undefined, the message type will be “unspecified”.
- title(string or JSX object): the title of the notification message
- content(string or JSX object): the body of the notification message
- callback(function): an optional callback function that will be called when the notification message is clicked. Callback function is called with one parameter,- id
- timestamp(string or JSX object): an optional timestamp that will be rendered in a separate section with different formatting, if passed in
- closeMessage(string or React object): an optional message that, if passed in, will display as clickable. Clicking on this will delete this individual message. If none is passed in, no delete option will be shown.