Auto-dismiss notification
parent
4a5eb775d5
commit
fb6a0e14c2
|
@ -7,8 +7,9 @@ import {
|
|||
deleteDashboardCell as deleteDashboardCellAJAX,
|
||||
} from 'src/dashboards/apis'
|
||||
|
||||
import {publishNotification} from 'src/shared/actions/notifications';
|
||||
import {publishNotification, delayDismissNotification} from 'src/shared/actions/notifications'
|
||||
|
||||
import {SHORT_NOTIFICATION_DISAPPEARING_DELAY} from 'shared/constants'
|
||||
import {NEW_DEFAULT_DASHBOARD_CELL} from 'src/dashboards/constants'
|
||||
|
||||
export const loadDashboards = (dashboards, dashboardID) => ({
|
||||
|
@ -135,6 +136,7 @@ export const deleteDashboardAsync = (dashboard) => async (dispatch) => {
|
|||
try {
|
||||
await deleteDashboardAJAX(dashboard)
|
||||
dispatch(publishNotification('success', 'Dashboard deleted successfully.'))
|
||||
dispatch(delayDismissNotification('success', SHORT_NOTIFICATION_DISAPPEARING_DELAY))
|
||||
} catch (error) {
|
||||
dispatch(deleteDashboardFailed(dashboard))
|
||||
dispatch(publishNotification('error', `Failed to delete dashboard: ${error.data.message}.`))
|
||||
|
|
|
@ -471,6 +471,8 @@ export const STROKE_WIDTH = {
|
|||
export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds.
|
||||
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
|
||||
|
||||
export const SHORT_NOTIFICATION_DISAPPEARING_DELAY = 1500 // in milliseconds
|
||||
|
||||
export const RES_UNAUTHORIZED = 401
|
||||
|
||||
export const AUTOREFRESH_DEFAULT = 15000 // in milliseconds
|
||||
|
|
Loading…
Reference in New Issue