19908: Add optional required flag for project input, make not required for advanced... 19908-advanced-search-project-filter
authorStephen Smith <stephen@curii.com>
Mon, 20 Feb 2023 16:54:43 +0000 (11:54 -0500)
committerStephen Smith <stephen@curii.com>
Mon, 20 Feb 2023 16:54:43 +0000 (11:54 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/views/run-process-panel/inputs/project-input.tsx
src/views/run-process-panel/run-process-basic-form.tsx

index ef6d08f40086dbeb4aa2d0596cdb412885c841f9..97028fc97cfc1a3f34a96e4cf56f45e3a9c0e989 100644 (file)
@@ -24,19 +24,20 @@ export type ProjectCommandInputParameter = GenericCommandInputParameter<ProjectR
 const require: any = (value?: ProjectResource) => (value === undefined);
 
 export interface ProjectInputProps {
+    required?: boolean;
     input: ProjectCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
 
 type DialogContentCssRules = 'root' | 'pickerWrapper';
 
-export const ProjectInput = ({ input, options }: ProjectInputProps) =>
+export const ProjectInput = ({ required, input, options }: ProjectInputProps) =>
     <Field
         name={input.id}
         commandInput={input}
         component={ProjectInputComponent as any}
         format={format}
-        validate={require}
+        validate={required ? require : undefined}
         {...{
             options
         }} />;
index 32a126a458fdcbd666969a95d09b34628889e104..a6f7a70693c4f9fdd043f3882f39a4edc550584c 100644 (file)
@@ -40,7 +40,7 @@ export const RunProcessBasicForm =
                         label="Optional description of this workflow run" />
                 </Grid>
                 <Grid item xs={12} md={6}>
-                    <ProjectInput input={{
+                    <ProjectInput required input={{
                         id: "owner",
                         label: "Project where the workflow will run"
                     } as ProjectCommandInputParameter}