X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7a8fafa13f5f94945cf0a4c5965db273f3435823..4d2ff0c66175bf47c5643e9500c2cc6d7caf8c8b:/src/store/process-panel/process-panel-actions.ts diff --git a/src/store/process-panel/process-panel-actions.ts b/src/store/process-panel/process-panel-actions.ts index 832d4d51..2aa914af 100644 --- a/src/store/process-panel/process-panel-actions.ts +++ b/src/store/process-panel/process-panel-actions.ts @@ -6,6 +6,11 @@ import { unionize, ofType, UnionOf } from "~/common/unionize"; import { loadProcess } from '~/store/processes/processes-actions'; import { Dispatch } from 'redux'; import { ProcessStatus } from '~/store/processes/process'; +import { RootState } from '~/store/store'; +import { ServiceRepository } from "~/services/services"; +import { navigateToCollection } from '~/store/navigation/navigation-action'; +import { snackbarActions } from '~/store/snackbar/snackbar-actions'; +import { SnackbarKind } from '../snackbar/snackbar-actions'; export const procesPanelActions = unionize({ SET_PROCESS_PANEL_FILTERS: ofType(), @@ -22,6 +27,16 @@ export const loadProcessPanel = (uuid: string) => dispatch(initProcessPanelFilters); }; +export const navigateToOutput = (uuid: string) => + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + try { + await services.collectionService.get(uuid); + dispatch(navigateToCollection(uuid)); + } catch { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'This collection does not exists!', hideDuration: 2000, kind: SnackbarKind.ERROR })); + } + }; + export const initProcessPanelFilters = procesPanelActions.SET_PROCESS_PANEL_FILTERS([ ProcessStatus.QUEUED, ProcessStatus.COMPLETED,