[ARVADOS-WORKBENCH2] updated: 1.2.0-501-g81eb1ca
Git user
git at public.curoverse.com
Mon Oct 1 05:20:40 EDT 2018
Summary of changes:
.../inputs/{string-input.tsx => file-input.tsx} | 9 +++++----
src/views/run-process-panel/run-process-inputs-form.tsx | 7 +++++--
2 files changed, 10 insertions(+), 6 deletions(-)
copy src/views/run-process-panel/inputs/{string-input.tsx => file-input.tsx} (63%)
via 81eb1ca6ea7faa2b8f2646f61cc00885d4cfcb83 (commit)
from 5c3b7d928914321c16aae5549b4ae2a6278dfa05 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 81eb1ca6ea7faa2b8f2646f61cc00885d4cfcb83
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Oct 1 11:19:12 2018 +0200
Create FileInput
Feature #13863
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
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 0000000..6b001b2
--- /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) =>
+ <Field
+ name={input.id}
+ label={getInputLabel(input)}
+ component={TextField}
+ format={(value?: File) => 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 22c00c3..0e53320 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<any, RunProcessInputFormProps>({
return <FloatInput key={input.id} input={input as FloatCommandInputParameter} />;
case input.type === CWLType.STRING:
return <StringInput key={input.id} input={input as StringCommandInputParameter} />;
+ case input.type === CWLType.FILE:
+ return <FileInput key={input.id} input={input as FileCommandInputParameter} />;
default:
return null;
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list