Merge branch '19143-project-list-workflows'
[arvados-workbench2.git] / src / store / navigation / navigation-action.ts
index 49f565911e0b04230502be62c7032b2918a16d11..c8811bf43955a92ad493ddc6e2acc28e8846b1b3 100644 (file)
@@ -6,11 +6,13 @@ import { Dispatch, compose, AnyAction } from 'redux';
 import { push } from "react-router-redux";
 import { ResourceKind, extractUuidKind } from 'models/resource';
 import { SidePanelTreeCategory } from '../side-panel-tree/side-panel-tree-actions';
-import { Routes, getGroupUrl, getNavUrl } from 'routes/routes';
+import { Routes, getGroupUrl, getNavUrl, getUserProfileUrl } from 'routes/routes';
 import { RootState } from 'store/store';
+import { openDetailsPanel } from 'store/details-panel/details-panel-action';
 import { ServiceRepository } from 'services/services';
 import { pluginConfig } from 'plugins';
 import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
+import { USERS_PANEL_LABEL, MY_ACCOUNT_PANEL_LABEL } from 'store/breadcrumbs/breadcrumbs-actions';
 
 const navigationNotAvailable = (id: string) =>
     snackbarActions.OPEN_SNACKBAR({
@@ -39,6 +41,9 @@ export const navigateTo = (uuid: string) =>
             case ResourceKind.VIRTUAL_MACHINE:
                 dispatch<any>(navigateToAdminVirtualMachines);
                 return;
+            case ResourceKind.WORKFLOW:
+                dispatch<any>(openDetailsPanel(uuid));
+                return;
         }
 
         switch (uuid) {
@@ -57,9 +62,6 @@ export const navigateTo = (uuid: string) =>
             case SidePanelTreeCategory.SHARED_WITH_ME:
                 dispatch(navigateToSharedWithMe);
                 return;
-            case SidePanelTreeCategory.WORKFLOWS:
-                dispatch(navigateToWorkflows);
-                return;
             case SidePanelTreeCategory.TRASH:
                 dispatch(navigateToTrash);
                 return;
@@ -69,6 +71,12 @@ export const navigateTo = (uuid: string) =>
             case SidePanelTreeCategory.ALL_PROCESSES:
                 dispatch(navigateToAllProcesses);
                 return;
+            case USERS_PANEL_LABEL:
+                dispatch(navigateToUsers);
+                return;
+            case MY_ACCOUNT_PANEL_LABEL:
+                dispatch(navigateToMyAccount);
+                return;
         }
 
         dispatch(navigationNotAvailable(uuid));
@@ -135,6 +143,8 @@ export const navigateToKeepServices = push(Routes.KEEP_SERVICES);
 
 export const navigateToUsers = push(Routes.USERS);
 
+export const navigateToUserProfile = compose(push, getUserProfileUrl);
+
 export const navigateToApiClientAuthorizations = push(Routes.API_CLIENT_AUTHORIZATIONS);
 
 export const navigateToGroups = push(Routes.GROUPS);