notifications

Instance to display notifications in Dashboard with custom levels

notification parameters:

name

type

default

description

message

string

""

Message of the notification

level

string

"info"

Level of the notification. Available: success, error, warning, info

autoDismiss

int

0

Delay in seconds for the notification go away. 0 to not auto-dismiss the notification

uuid

int/string

null

Notification won't be displayed without a uuid. Notifications with same uuid won't be displayed.

How to use

add

import { Plugin } from '@root'

Plugin.notifications.add({
    uuid: '503392020-32434-324234-434-34344',
    level: 'success',
    message: 'Your message'
})

add confirm notifications

You can send a confirm notification with add method

Confirm item:

import { Plugin } from '@root'

const confirmPayload = {
    message: 'My confirm message',
    buttonTexts: ['Cancel', 'Confirm'],
    onConfirm: () => {},
    onCancel: () => {}
}

Plugin.notifications.add({
    uuid: '503392020-32434-324234-434-34344',
    level: 'success',
    confirm: confirmPayload
})

name

type

default

description

message

string

null

Message of the notification

buttonTexts

array

['cancel', 'ok']

Confirm buttons texts, first item take the cancel text and the second takes the confirm text

onConfirm

function

null

callback function will be called on confirm

onCancel

function

null

callback function will be called on cancel

remove

By passing the same "notification" object that you want to remove, or by passing the uuid

import { Plugin } from '@root'

Plugin.notifications.remove('503392020-32434-324234-434-34344')

Last updated