Merge branch '17426-plug-ins' refs #17426
[arvados-workbench2.git] / src / store / workbench / workbench-actions.ts
index 0416d815805640bbe7bc69fb046cec7abc169a1d..8ea19a145d9126aff5c39d967aa7b8f5673a04d4 100644 (file)
@@ -33,7 +33,7 @@ import {
     setSidePanelBreadcrumbs,
     setTrashBreadcrumbs
 } from '~/store/breadcrumbs/breadcrumbs-actions';
-import { navigateTo } from '~/store/navigation/navigation-action';
+import { navigateTo, navigateToRootProject } from '~/store/navigation/navigation-action';
 import { MoveToFormDialogData } from '~/store/move-to-dialog/move-to-dialog';
 import { ServiceRepository } from '~/services/services';
 import { getResource } from '~/store/resources/resources';
@@ -42,7 +42,6 @@ import * as projectMoveActions from '~/store/projects/project-move-actions';
 import * as projectUpdateActions from '~/store/projects/project-update-actions';
 import * as collectionCreateActions from '~/store/collections/collection-create-actions';
 import * as collectionCopyActions from '~/store/collections/collection-copy-actions';
-import * as collectionUpdateActions from '~/store/collections/collection-update-actions';
 import * as collectionMoveActions from '~/store/collections/collection-move-actions';
 import * as processesActions from '~/store/processes/processes-actions';
 import * as processMoveActions from '~/store/processes/process-move-actions';
@@ -111,7 +110,7 @@ export const isWorkbenchLoading = (state: RootState) => {
     return progress ? progress.working : false;
 };
 
-const handleFirstTimeLoad = (action: any) =>
+export const handleFirstTimeLoad = (action: any) =>
     async (dispatch: Dispatch<any>, getState: () => RootState) => {
         try {
             await dispatch(action);
@@ -154,7 +153,7 @@ export const loadWorkbench = () =>
             if (router.location) {
                 const match = matchRootRoute(router.location.pathname);
                 if (match) {
-                    dispatch<any>(navigateTo(user.uuid));
+                    dispatch<any>(navigateToRootProject);
                 }
             }
         } else {
@@ -323,24 +322,6 @@ export const createCollection = (data: collectionCreateActions.CollectionCreateF
         }
     };
 
-export const updateCollection = (data: collectionUpdateActions.CollectionUpdateFormDialogData) =>
-    async (dispatch: Dispatch) => {
-        try {
-            const collection = await dispatch<any>(collectionUpdateActions.updateCollection(data));
-            if (collection) {
-                dispatch(snackbarActions.OPEN_SNACKBAR({
-                    message: "Collection has been successfully updated.",
-                    hideDuration: 2000,
-                    kind: SnackbarKind.SUCCESS
-                }));
-                dispatch<any>(updateResources([collection]));
-                dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
-            }
-        } catch (e) {
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.errors.join(''), hideDuration: 2000, kind: SnackbarKind.ERROR }));
-        }
-    };
-
 export const copyCollection = (data: CopyFormDialogData) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         try {