1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Dialog, DialogActions, Button, CardHeader, DialogContent } from '@material-ui/core';
7 import { WithDialogProps } from '~/store/dialog/with-dialog';
8 import { withDialog } from "~/store/dialog/with-dialog";
9 import { PROCESS_INPUT_DIALOG_NAME } from '~/store/processes/process-input-actions';
10 import { RunProcessInputsForm } from "~/views/run-process-panel/run-process-inputs-form";
12 export const ProcessInputDialog = withDialog(PROCESS_INPUT_DIALOG_NAME)(
13 (props: WithDialogProps<any>) =>
17 onClose={props.closeDialog}>
19 title="Inputs - Pipeline template that generates a config file from a template" />
21 <RunProcessInputsForm inputs={getInputs(props.data.containerRequest)} />
27 onClick={props.closeDialog}>
34 const getInputs = (data: any) =>
35 data && data.mounts.varLibCwlWorkflowJson ? data.mounts.varLibCwlWorkflowJson.content.graph[1].inputs.map((it: any) => (
36 { type: it.type, id: it.id, label: it.label, value: getInputValue(it.id, data.mounts.varLibCwlCwlInputJson.content), disabled: true }
39 const getInputValue = (id: string, data: any) => {
41 case "#main/example_flag":
42 return data.exampleFlag;
43 case "#main/example_directory":
44 return data.exampleDirectory;
45 case "#main/example_double":
46 return data.exampleDouble;
47 case "#main/example_file":
48 return data.exampleFile;
49 case "#main/example_float":
50 return data.exampleFloat;
51 case "#main/example_int":
52 return data.exampleInt;
53 case "#main/example_long":
54 return data.exampleLong;
55 case "#main/example_null":
56 return data.exampleNull;
57 case "#main/example_string":
58 return data.exampleString;
59 case "#main/enum_type":
61 case "#main/multiple_collections":
62 return data.multipleCollections;
63 case "#main/example_string_array":
64 return data.exampleStringArray;
65 case "#main/example_int_array":
66 return data.exampleIntArray;
67 case "#main/example_float_array":
68 return data.exampleFloatArray;
69 case "#main/multiple_files":
70 return data.multipleFiles;
71 case "#main/collection":
72 return data.collection;
73 case "#main/optional_file_missing_label":
74 return data.optionalFileMissingLabel;
75 case "#main/optional_file":
76 return data.optionalFile;
77 case "#main/single_file":
78 return data.singleFile;
80 return data.exampleString;