X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1f9a8ec32f818d8e78d683ad5569b9e4ae0f693a..027e708a45eb9bffcc86cb741d33e5fcfdc51704:/src/store/processes/process-input-actions.ts diff --git a/src/store/processes/process-input-actions.ts b/src/store/processes/process-input-actions.ts index b67622d390..7ce2749c92 100644 --- a/src/store/processes/process-input-actions.ts +++ b/src/store/processes/process-input-actions.ts @@ -5,7 +5,8 @@ import { dialogActions } from '~/store/dialog/dialog-actions'; import { RootState } from '~/store/store'; import { Dispatch } from 'redux'; -import { getProcess, Process } from '~/store/processes/process'; +import { getProcess } from '~/store/processes/process'; +import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions'; export const PROCESS_INPUT_DIALOG_NAME = 'processInputDialog'; @@ -13,7 +14,11 @@ export const openProcessInputDialog = (processUuid: string) => (dispatch: Dispatch, getState: () => RootState) => { const process = getProcess(processUuid)(getState().resources); if (process) { - const data: Process = process; - dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_INPUT_DIALOG_NAME, data })); + const data: any = process; + if (data && data.containerRequest.mounts.varLibCwlWorkflowJson && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph.filter((a: any) => a.class === 'Workflow')[0] && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph.filter((a: any) => a.class === 'Workflow')[0].inputs.length > 0) { + dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_INPUT_DIALOG_NAME, data })); + } else { + dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'There are no inputs in this process!', kind: SnackbarKind.ERROR })); + } } }; \ No newline at end of file