1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { dialogActions } from '~/store/dialog/dialog-actions';
6 import { RootState } from '~/store/store';
7 import { Dispatch } from 'redux';
8 import { getProcess } from '~/store/processes/process';
9 import {snackbarActions, SnackbarKind} from '~/store/snackbar/snackbar-actions';
11 export const PROCESS_INPUT_DIALOG_NAME = 'processInputDialog';
13 export const openProcessInputDialog = (processUuid: string) =>
14 (dispatch: Dispatch<any>, getState: () => RootState) => {
15 const process = getProcess(processUuid)(getState().resources);
17 const data: any = process;
18 if (data && data.containerRequest.mounts.varLibCwlWorkflowJson && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph[1] && data.containerRequest.mounts.varLibCwlWorkflowJson.content.graph[1].inputs.length > 0) {
19 dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_INPUT_DIALOG_NAME, data }));
21 dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'There are no inputs in this process!', kind: SnackbarKind.ERROR }));