X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/428d454e2681d66bb14558946cfe2fb77a2c8dce..59cc1b248e39a17bbf46449add178d957b167b9a:/src/views/run-process-panel/inputs/string-input.tsx diff --git a/src/views/run-process-panel/inputs/string-input.tsx b/src/views/run-process-panel/inputs/string-input.tsx index 8c72a469..7fc74315 100644 --- a/src/views/run-process-panel/inputs/string-input.tsx +++ b/src/views/run-process-panel/inputs/string-input.tsx @@ -3,10 +3,12 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { getInputLabel, isRequiredInput, StringCommandInputParameter } from '~/models/workflow'; +import { memoize } from 'lodash/fp'; +import { isRequiredInput, StringCommandInputParameter } from '~/models/workflow'; import { Field } from 'redux-form'; -import { TextField } from '~/components/text-field/text-field'; import { require } from '~/validators/require'; +import { GenericInputProps, GenericInput } from '~/views/run-process-panel/inputs/generic-input'; +import { Input as MaterialInput } from '@material-ui/core'; export interface StringInputProps { input: StringCommandInputParameter; @@ -14,11 +16,25 @@ export interface StringInputProps { export const StringInput = ({ input }: StringInputProps) => undefined, - ]} />; + commandInput={input} + component={StringInputComponent} + validate={getValidation(input)} />; +const getValidation = memoize( + (input: StringCommandInputParameter) => ([ + isRequiredInput(input) + ? require + : () => undefined, + ])); + +const StringInputComponent = (props: GenericInputProps) => + ; + +const Input = (props: GenericInputProps) => + ; \ No newline at end of file