improve the flash message verbiage when deleting a user from the userspage and standardized the duration time for flash messages to be 4s

pull/2703/head
Iris Scholten 2018-01-31 15:57:24 -08:00
parent ac7a9a4e2a
commit 91317a164d
4 changed files with 8 additions and 8 deletions

View File

@ -165,13 +165,14 @@ export const deleteUserAsync = (
) => async dispatch => { ) => async dispatch => {
dispatch(removeUser(user)) dispatch(removeUser(user))
try { try {
console.log(user)
await deleteUserAJAX(user) await deleteUserAJAX(user)
dispatch( dispatch(
publishAutoDismissingNotification( publishAutoDismissingNotification(
'success', 'success',
`User removed from ${isAbsoluteDelete `${user.name} has been removed from ${isAbsoluteDelete
? 'all organizations and deleted' ? 'all organizations and deleted'
: 'organization'}: ${user.scheme}::${user.provider}::${user.name}` : 'the current organization'}`
) )
) )
} catch (error) { } catch (error) {

View File

@ -5,7 +5,7 @@ import {getLinksAsync} from 'shared/actions/links'
import {publishAutoDismissingNotification} from 'shared/dispatchers' import {publishAutoDismissingNotification} from 'shared/dispatchers'
import {errorThrown} from 'shared/actions/errors' import {errorThrown} from 'shared/actions/errors'
import {LONG_NOTIFICATION_DISMISS_DELAY} from 'shared/constants' import {NOTIFICATION_DISMISS_DELAY} from 'shared/constants'
export const authExpired = auth => ({ export const authExpired = auth => ({
type: 'AUTH_EXPIRED', type: 'AUTH_EXPIRED',
@ -96,7 +96,7 @@ export const meChangeOrganizationAsync = (
'success', 'success',
`Now logged in to '${me.currentOrganization `Now logged in to '${me.currentOrganization
.name}' as '${currentRole.name}'`, .name}' as '${currentRole.name}'`,
LONG_NOTIFICATION_DISMISS_DELAY NOTIFICATION_DISMISS_DELAY
) )
) )
dispatch(meChangeOrganizationCompleted()) dispatch(meChangeOrganizationCompleted())

View File

@ -386,8 +386,7 @@ export const HEARTBEAT_INTERVAL = 10000 // ms
export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds. export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds.
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds. export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
export const SHORT_NOTIFICATION_DISMISS_DELAY = 2000 // in milliseconds export const NOTIFICATION_DISMISS_DELAY = 4000 // in milliseconds
export const LONG_NOTIFICATION_DISMISS_DELAY = 4000 // in milliseconds
export const REVERT_STATE_DELAY = 1500 // ms export const REVERT_STATE_DELAY = 1500 // ms

View File

@ -5,7 +5,7 @@ import {
import {delayEnablePresentationMode} from 'shared/actions/app' import {delayEnablePresentationMode} from 'shared/actions/app'
import {PRESENTATION_MODE_NOTIFICATION_DELAY} from 'shared/constants' import {PRESENTATION_MODE_NOTIFICATION_DELAY} from 'shared/constants'
import {SHORT_NOTIFICATION_DISMISS_DELAY} from 'shared/constants' import {NOTIFICATION_DISMISS_DELAY} from 'shared/constants'
export function delayDismissNotification(type, delay) { export function delayDismissNotification(type, delay) {
return dispatch => { return dispatch => {
@ -16,7 +16,7 @@ export function delayDismissNotification(type, delay) {
export const publishAutoDismissingNotification = ( export const publishAutoDismissingNotification = (
type, type,
message, message,
delay = SHORT_NOTIFICATION_DISMISS_DELAY delay = NOTIFICATION_DISMISS_DELAY
) => dispatch => { ) => dispatch => {
dispatch(publishNotification(type, message)) dispatch(publishNotification(type, message))
dispatch(delayDismissNotification(type, delay)) dispatch(delayDismissNotification(type, delay))