X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b2485c13b72d66f5e207814a368b72334970afca..refs/heads/18975-log-improvements:/src/store/navigation/navigation-action.ts diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts index 19cc36ae..146530ca 100644 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@ -6,13 +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 { 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, @@ -39,6 +41,9 @@ export const navigateTo = (uuid: string) => case ResourceKind.VIRTUAL_MACHINE: dispatch(navigateToAdminVirtualMachines); return; + case ResourceKind.WORKFLOW: + dispatch(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)); @@ -99,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); }; @@ -137,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);