);
export const SearchBarProjectField = () =>
- <ProjectInput input={{
+ <ProjectInput required={false} input={{
id: "projectObject",
label: "Limit search to Project"
} as ProjectCommandInputParameter}
type GenericInputContainerProps = GenericInputProps & {
component: React.ComponentType<GenericInputProps>;
+ required?: boolean;
};
export const GenericInput = ({ component: Component, ...props }: GenericInputContainerProps) => {
return <FormGroup>
<FormLabel
focused={props.meta.active}
- required={isRequiredInput(props.commandInput)}
+ required={props.required !== undefined ? props.required : isRequiredInput(props.commandInput)}
error={props.meta.touched && !!props.meta.error}>
{getInputLabel(props.commandInput)}
</FormLabel>
}
</FormHelperText>
</FormGroup>;
-};
\ No newline at end of file
+};
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 : '';
export const ProjectInputComponent = connect(mapStateToProps)(
class ProjectInputComponent extends React.Component<GenericInputProps & DispatchProp & HasUserUuid & {
options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
+ required?: boolean;
}, ProjectInputComponentState> {
state: ProjectInputComponentState = {
open: false,