X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/73122efb6429184611d17b3278ecbe9c2e26a6c2..fd24fbe43ef6f898f31804aff16ea6911a014ff8:/src/store/navigation/navigation-action.ts diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts index 97082e5a..146530ca 100644 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@ -6,14 +6,15 @@ 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, getProcessLogUrl, 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 { GROUPS_PANEL_LABEL } from 'store/breadcrumbs/breadcrumbs-actions'; 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) => +export const navigationNotAvailable = (id: string) => snackbarActions.OPEN_SNACKBAR({ message: `${id} not available`, hideDuration: 3000, @@ -40,6 +41,9 @@ export const navigateTo = (uuid: string) => case ResourceKind.VIRTUAL_MACHINE: dispatch(navigateToAdminVirtualMachines); return; + case ResourceKind.WORKFLOW: + dispatch(openDetailsPanel(uuid)); + return; } switch (uuid) { @@ -58,18 +62,21 @@ 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; - case GROUPS_PANEL_LABEL: + case SidePanelTreeCategory.GROUPS: dispatch(navigateToGroups); return; 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)); @@ -100,8 +107,6 @@ export const pushOrGoto = (url: string): AnyAction => { }; -export const navigateToProcessLogs = compose(push, getProcessLogUrl); - export const navigateToRootProject = (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { navigateTo(SidePanelTreeCategory.PROJECTS)(dispatch, getState); }; @@ -138,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);