From: Stephen Smith Date: Mon, 20 Mar 2023 17:54:30 +0000 (-0400) Subject: 19969: Pass required prop to generic input to allow disabling required asterisk on... X-Git-Tag: 2.6.0~9^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/8e54bebd8a2e59318e50d7dd26ba1b71e1fe20ab 19969: Pass required prop to generic input to allow disabling required asterisk on non-required fields Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- diff --git a/src/views-components/form-fields/search-bar-form-fields.tsx b/src/views-components/form-fields/search-bar-form-fields.tsx index be28ba2a..47633a0b 100644 --- a/src/views-components/form-fields/search-bar-form-fields.tsx +++ b/src/views-components/form-fields/search-bar-form-fields.tsx @@ -47,7 +47,7 @@ export const SearchBarClusterField = connect( ); export const SearchBarProjectField = () => - ; + required?: boolean; }; export const GenericInput = ({ component: Component, ...props }: GenericInputContainerProps) => { return {getInputLabel(props.commandInput)} @@ -31,4 +32,4 @@ export const GenericInput = ({ component: Component, ...props }: GenericInputCon } ; -}; \ No newline at end of file +}; diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx index 97028fc9..279e399c 100644 --- a/src/views/run-process-panel/inputs/project-input.tsx +++ b/src/views/run-process-panel/inputs/project-input.tsx @@ -37,9 +37,10 @@ export const ProjectInput = ({ required, input, options }: ProjectInputProps) => commandInput={input} component={ProjectInputComponent as any} format={format} - validate={required ? require : undefined} + validate={required !== undefined ? require : undefined} {...{ - options + options, + required }} />; const format = (value?: ProjectResource) => value ? value.name : ''; @@ -58,6 +59,7 @@ const mapStateToProps = (state: RootState) => ({ userUuid: getUserUuid(state) }) export const ProjectInputComponent = connect(mapStateToProps)( class ProjectInputComponent extends React.Component { state: ProjectInputComponentState = { open: false,