From 81eb1ca6ea7faa2b8f2646f61cc00885d4cfcb83 Mon Sep 17 00:00:00 2001 From: Michal Klobukowski Date: Mon, 1 Oct 2018 11:19:12 +0200 Subject: [PATCH] Create FileInput Feature #13863 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- .../run-process-panel/inputs/file-input.tsx | 25 +++++++++++++++++++ .../run-process-inputs-form.tsx | 7 ++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/views/run-process-panel/inputs/file-input.tsx diff --git a/src/views/run-process-panel/inputs/file-input.tsx b/src/views/run-process-panel/inputs/file-input.tsx new file mode 100644 index 0000000000..6b001b2099 --- /dev/null +++ b/src/views/run-process-panel/inputs/file-input.tsx @@ -0,0 +1,25 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import * as React from 'react'; +import { getInputLabel, isRequiredInput, FileCommandInputParameter, File } from '~/models/workflow'; +import { Field } from 'redux-form'; +import { TextField } from '~/components/text-field/text-field'; +import { require } from '~/validators/require'; + +export interface FileInputProps { + input: FileCommandInputParameter; +} +export const FileInput = ({ input }: FileInputProps) => + value ? value.location : ''} + validate={[ + isRequiredInput(input) + ? require + : () => undefined, + ]} />; + diff --git a/src/views/run-process-panel/run-process-inputs-form.tsx b/src/views/run-process-panel/run-process-inputs-form.tsx index 22c00c3272..0e533206df 100644 --- a/src/views/run-process-panel/run-process-inputs-form.tsx +++ b/src/views/run-process-panel/run-process-inputs-form.tsx @@ -4,12 +4,13 @@ import * as React from 'react'; import { reduxForm, InjectedFormProps } from 'redux-form'; -import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter } from '~/models/workflow'; +import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter, FileCommandInputParameter } from '~/models/workflow'; import { IntInput } from '~/views/run-process-panel/inputs/int-input'; import { StringInput } from '~/views/run-process-panel/inputs/string-input'; -import { StringCommandInputParameter, FloatCommandInputParameter } from '../../models/workflow'; +import { StringCommandInputParameter, FloatCommandInputParameter, File } from '../../models/workflow'; import { FloatInput } from '~/views/run-process-panel/inputs/float-input'; import { BooleanInput } from './inputs/boolean-input'; +import { FileInput } from './inputs/file-input'; const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm'; @@ -33,6 +34,8 @@ export const RunProcessInputsForm = reduxForm({ return ; case input.type === CWLType.STRING: return ; + case input.type === CWLType.FILE: + return ; default: return null; } -- 2.39.5