[ARVADOS-WORKBENCH2] updated: 1.2.0-500-g5c3b7d9
Git user
git at public.curoverse.com
Mon Oct 1 04:39:30 EDT 2018
Summary of changes:
.../run-process-panel/inputs/boolean-input.tsx | 29 ++++++++++++++++++++++
.../run-process-panel/run-process-inputs-form.tsx | 5 +++-
2 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 src/views/run-process-panel/inputs/boolean-input.tsx
via 5c3b7d928914321c16aae5549b4ae2a6278dfa05 (commit)
from 2f320e4890a5c74bda5d10fedf6011d23585a4b0 (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 5c3b7d928914321c16aae5549b4ae2a6278dfa05
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Oct 1 10:39:10 2018 +0200
Create boolean input [wip]
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/boolean-input.tsx b/src/views/run-process-panel/inputs/boolean-input.tsx
new file mode 100644
index 0000000..2d0d8c6
--- /dev/null
+++ b/src/views/run-process-panel/inputs/boolean-input.tsx
@@ -0,0 +1,29 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { BooleanCommandInputParameter, getInputLabel, isRequiredInput } from '~/models/workflow';
+import { Field, WrappedFieldProps } from 'redux-form';
+import { TextField } from '~/components/text-field/text-field';
+import { FormGroup, FormLabel, FormHelperText, Switch } from '@material-ui/core';
+
+export interface BooleanInputProps {
+ input: BooleanCommandInputParameter;
+}
+export const BooleanInput = ({ input }: BooleanInputProps) =>
+ <Field
+ name={input.id}
+ label={getInputLabel(input)}
+ component={BooleanInputComponent}
+ normalize={(value, prevValue) => !prevValue}
+ />;
+
+const BooleanInputComponent = (props: WrappedFieldProps & { label?: string }) =>
+ <FormGroup>
+ <FormLabel>{props.label}</FormLabel>
+ <Switch
+ color='primary'
+ checked={props.input.value}
+ onChange={() => props.input.onChange(props.input.value)} />
+ </FormGroup>;
\ No newline at end of file
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 193e5ab..22c00c3 100644
--- a/src/views/run-process-panel/run-process-inputs-form.tsx
+++ b/src/views/run-process-panel/run-process-inputs-form.tsx
@@ -4,11 +4,12 @@
import * as React from 'react';
import { reduxForm, InjectedFormProps } from 'redux-form';
-import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter } from '~/models/workflow';
+import { WorkflowResource, CommandInputParameter, CWLType, IntCommandInputParameter, BooleanCommandInputParameter } 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 { FloatInput } from '~/views/run-process-panel/inputs/float-input';
+import { BooleanInput } from './inputs/boolean-input';
const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm';
@@ -22,6 +23,8 @@ export const RunProcessInputsForm = reduxForm<any, RunProcessInputFormProps>({
<form>
{props.inputs.map(input => {
switch (true) {
+ case input.type === CWLType.BOOLEAN:
+ return <BooleanInput key={input.id} input={input as BooleanCommandInputParameter} />;
case input.type === CWLType.INT:
case input.type === CWLType.LONG:
return <IntInput key={input.id} input={input as IntCommandInputParameter} />;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list