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