X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/73511c8886bfe48d1084b7bd2a2c5bbee8ff6471..f9dde5c781766b8be71d43d0f031c201a0edcfbb:/src/store/collection-panel/collection-panel-action.ts diff --git a/src/store/collection-panel/collection-panel-action.ts b/src/store/collection-panel/collection-panel-action.ts index 265b5cf8..3b3e34c2 100644 --- a/src/store/collection-panel/collection-panel-action.ts +++ b/src/store/collection-panel/collection-panel-action.ts @@ -13,6 +13,8 @@ import { TagProperty } from "~/models/tag"; import { snackbarActions } from "../snackbar/snackbar-actions"; import { resourcesActions } from "~/store/resources/resources-actions"; import { unionize, ofType, UnionOf } from '~/common/unionize'; +import { SnackbarKind } from '~/store/snackbar/snackbar-actions'; +import { navigateTo } from '~/store/navigation/navigation-action'; export const collectionPanelActions = unionize({ SET_COLLECTION: ofType(), @@ -53,6 +55,16 @@ export const createCollectionTag = (data: TagProperty) => } }; +export const navigateToProcess = (uuid: string) => + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + try { + await services.containerRequestService.get(uuid); + dispatch(navigateTo(uuid)); + } catch { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'This process does not exists!', hideDuration: 2000, kind: SnackbarKind.ERROR })); + } + }; + export const deleteCollectionTag = (key: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const item = getState().collectionPanel.item;