X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e6e91f83b899ef4a05a1b3af56d78388058c5e73..e4f350462118a86831f92eb375c2bc89cbf85920:/src/store/snackbar/snackbar-actions.ts?ds=sidebyside diff --git a/src/store/snackbar/snackbar-actions.ts b/src/store/snackbar/snackbar-actions.ts index 55d9f3a8..7b6f2efd 100644 --- a/src/store/snackbar/snackbar-actions.ts +++ b/src/store/snackbar/snackbar-actions.ts @@ -2,11 +2,26 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { unionize, ofType, UnionOf } from "~/common/unionize"; +import { unionize, ofType, UnionOf } from "common/unionize"; + +export interface SnackbarMessage { + message: string; + hideDuration: number; + kind: SnackbarKind; + link?: string; +} + +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<{}>() + OPEN_SNACKBAR: ofType<{message: string; hideDuration?: number, kind?: SnackbarKind, link?: string}>(), + CLOSE_SNACKBAR: ofType<{}|null>(), + SHIFT_MESSAGES: ofType<{}>() }); export type SnackbarAction = UnionOf;