X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c632f0edf3f863fd29efb90e010f286b40cb9e92..c8efd8ea08a0830b334ffc6a3811807bf5a1d94a:/src/store/snackbar/snackbar-actions.ts diff --git a/src/store/snackbar/snackbar-actions.ts b/src/store/snackbar/snackbar-actions.ts index 2f6175ad68..d6d7128e85 100644 --- a/src/store/snackbar/snackbar-actions.ts +++ b/src/store/snackbar/snackbar-actions.ts @@ -2,11 +2,25 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { unionize, ofType, UnionOf } from "unionize"; +import { unionize, ofType, UnionOf } from "~/common/unionize"; + +export interface SnackbarMessage { + message: string; + hideDuration: number; + kind: SnackbarKind; +} + +export enum SnackbarKind { + SUCCESS = 1, + ERROR = 2, + INFO = 3, + WARNING = 4 +} export const snackbarActions = unionize({ - OPEN_SNACKBAR: ofType<{message: string; hideDuration?: number}>(), - CLOSE_SNACKBAR: ofType<{}>() -}, { tag: 'type', value: 'payload' }); + OPEN_SNACKBAR: ofType<{message: string; hideDuration?: number, kind?: SnackbarKind}>(), + CLOSE_SNACKBAR: ofType<{}>(), + SHIFT_MESSAGES: ofType<{}>() +}); export type SnackbarAction = UnionOf;