X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/23180724fefb8b4b31e2c07e711101367942f721..b1a6da4a288560a87e0e38ad2fd73fb227e3fc66:/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 b67622d3..b35081c1 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 } 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[1].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!' })); + } } }; \ No newline at end of file