X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/95563e85e95cae6a4ef6d2c2137fe1a3533ef8db..02fe86a56f080ed1d5770ad6c6856a15f50ab508:/src/views-components/process-input-dialog/process-input-dialog.tsx?ds=sidebyside

diff --git a/src/views-components/process-input-dialog/process-input-dialog.tsx b/src/views-components/process-input-dialog/process-input-dialog.tsx
index 96eab1cf..a2d59407 100644
--- a/src/views-components/process-input-dialog/process-input-dialog.tsx
+++ b/src/views-components/process-input-dialog/process-input-dialog.tsx
@@ -6,10 +6,13 @@ import * as React from "react";
 import { Dialog, DialogActions, Button, CardHeader, DialogContent } from '@material-ui/core';
 import { WithDialogProps } from '~/store/dialog/with-dialog';
 import { withDialog } from "~/store/dialog/with-dialog";
-import { PROCESS_INPUT_DIALOG_NAME, ProcessInputDialogData } from '~/store/processes/process-input-actions';
+import { PROCESS_INPUT_DIALOG_NAME } from '~/store/processes/process-input-actions';
+import { RunProcessInputsForm } from "~/views/run-process-panel/run-process-inputs-form";
+import { MOUNT_PATH_CWL_WORKFLOW, MOUNT_PATH_CWL_INPUT } from "~/models/process";
+import { getWorkflowInputs } from "~/models/workflow";
 
 export const ProcessInputDialog = withDialog(PROCESS_INPUT_DIALOG_NAME)(
-    (props: WithDialogProps<ProcessInputDialogData>) =>
+    (props: WithDialogProps<any>) =>
         <Dialog
             open={props.open}
             maxWidth={false}
@@ -17,15 +20,31 @@ export const ProcessInputDialog = withDialog(PROCESS_INPUT_DIALOG_NAME)(
             <CardHeader
                 title="Inputs - Pipeline template that generates a config file from a template" />
             <DialogContent>
-                cos
+                <RunProcessInputsForm inputs={getInputs(props.data.containerRequest)} />
             </DialogContent>
             <DialogActions>
                 <Button
-                    variant='flat'
+                    variant='text'
                     color='primary'
                     onClick={props.closeDialog}>
                     Close
                 </Button>
             </DialogActions>
         </Dialog>
-); 
\ No newline at end of file
+);
+
+const getInputs = (data: any) => {
+    if (!data || !data.mounts || !data.mounts[MOUNT_PATH_CWL_WORKFLOW]) { return []; }
+    const inputs = getWorkflowInputs(data.mounts[MOUNT_PATH_CWL_WORKFLOW].content);
+    return inputs ? inputs.map(
+        (it: any) => (
+            {
+                type: it.type,
+                id: it.id,
+                label: it.label,
+                value: data.mounts[MOUNT_PATH_CWL_INPUT].content[it.id],
+                disabled: true
+            }
+        )
+    ) : [];
+};
