UI Improvements
[arvados-workbench2.git] / src / store / keep-services / keep-services-actions.ts
index 54a7c3fe87161b6488d0060c576ae7e7dbcd2af5..4eb5fc951ed7e46aacafbe06d362c0c4c3ca0af5 100644 (file)
@@ -9,7 +9,7 @@ import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
 import { ServiceRepository } from "~/services/services";
 import { KeepServiceResource } from '~/models/keep-services';
 import { dialogActions } from '~/store/dialog/dialog-actions';
-import { snackbarActions } from '~/store/snackbar/snackbar-actions';
+import {snackbarActions, SnackbarKind} from '~/store/snackbar/snackbar-actions';
 import { navigateToRootProject } from '~/store/navigation/navigation-action';
 
 export const keepServicesActions = unionize({
@@ -35,7 +35,7 @@ export const loadKeepServicesPanel = () =>
             }
         } else {
             dispatch(navigateToRootProject);
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "You don't have permissions to view this page", hideDuration: 2000 }));
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "You don't have permissions to view this page", hideDuration: 2000, kind: SnackbarKind.ERROR }));
         }
     };
 
@@ -60,11 +60,11 @@ export const openKeepServiceRemoveDialog = (uuid: string) =>
 
 export const removeKeepService = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...' }));
+        dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO }));
         try {
             await services.keepService.delete(uuid);
             dispatch(keepServicesActions.REMOVE_KEEP_SERVICE(uuid));
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Keep service has been successfully removed.', hideDuration: 2000 }));
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Keep service has been successfully removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
         } catch (e) {
             return;
         }