init-process-input-modal-view
[arvados-workbench2.git] / 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
new file mode 100644 (file)
index 0000000..7b0ae4c
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { dialogActions } from '~/store/dialog/dialog-actions';
+import { RootState } from '~/store/store';
+import { Dispatch } from 'redux';
+import { getProcess } from '~/store/processes/process';
+
+export const PROCESS_INPUT_DIALOG_NAME = 'processInputDialog';
+
+export interface ProcessInputDialogData {
+}
+
+export const openProcessInputDialog = (processUuid: string) =>
+    (dispatch: Dispatch<any>, getState: () => RootState) => {
+        const process = getProcess(processUuid)(getState().resources);
+        if (process) {
+            const data: ProcessInputDialogData = { process };
+            dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_INPUT_DIALOG_NAME, data }));
+        }
+    }; 
\ No newline at end of file