X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f4012790be2404ce2f5b2594338fac43b1b9c59b..06f1c8b752ff3f2b788773eac42438335bb86a91:/src/store/auth/auth-action-ssh.ts diff --git a/src/store/auth/auth-action-ssh.ts b/src/store/auth/auth-action-ssh.ts index 4175d295..1fbdfdfa 100644 --- a/src/store/auth/auth-action-ssh.ts +++ b/src/store/auth/auth-action-ssh.ts @@ -1,8 +1,12 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + import { dialogActions } from "~/store/dialog/dialog-actions"; import { Dispatch } from "redux"; import { RootState } from "~/store/store"; import { ServiceRepository } from "~/services/services"; -import { snackbarActions } from "~/store/snackbar/snackbar-actions"; +import {snackbarActions, SnackbarKind} from "~/store/snackbar/snackbar-actions"; import { FormErrors, reset, startSubmit, stopSubmit } from "redux-form"; import { KeyType } from "~/models/ssh-key"; import { @@ -50,10 +54,10 @@ export const openSshKeyRemoveDialog = (uuid: string) => export const removeSshKey = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...' })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO })); await services.authorizedKeysService.delete(uuid); dispatch(authActions.REMOVE_SSH_KEY(uuid)); - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Public Key has been successfully removed.', hideDuration: 2000 })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Public Key has been successfully removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS })); }; export const createSshKey = (data: SshKeyCreateFormDialogData) => @@ -73,7 +77,8 @@ export const createSshKey = (data: SshKeyCreateFormDialogData) => dispatch(reset(SSH_KEY_CREATE_FORM_NAME)); dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Public key has been successfully created.", - hideDuration: 2000 + hideDuration: 2000, + kind: SnackbarKind.SUCCESS })); } catch (e) { const error = getAuthorizedKeysServiceError(e);