diff --git a/ui/components/scans/launch-workflow/launch-scan-workflow-form.tsx b/ui/components/scans/launch-workflow/launch-scan-workflow-form.tsx index 9937b5cc9d..74bfbf8fde 100644 --- a/ui/components/scans/launch-workflow/launch-scan-workflow-form.tsx +++ b/ui/components/scans/launch-workflow/launch-scan-workflow-form.tsx @@ -26,8 +26,16 @@ export const LaunchScanWorkflow = ({ }: { providers: ProviderInfo[]; }) => { - const formSchema = onDemandScanFormSchema(); - const form = useForm>({ + const formSchema = z.object({ + ...onDemandScanFormSchema().shape, + scanName: z + .string() + .min(3, "Must have at least 3 characters") + .or(z.literal("")) + .optional(), + }); + + const form = useForm({ resolver: zodResolver(formSchema), defaultValues: { providerId: "", @@ -77,25 +85,25 @@ export const LaunchScanWorkflow = ({
-
-
- -
- - {form.watch("providerId") && ( - <> +
+ +
+ + {form.watch("providerId") && ( + <> +
-
- } - > - {isLoading ? <>Loading : Start now} - - form.reset()} - className="w-fit border-gray-200 bg-transparent" - ariaLabel="Clear form" - variant="bordered" - size="sm" - radius="sm" - > - Cancel - -
+ } + > + {isLoading ? <>Loading : Start now} + + form.reset()} + className="w-fit border-gray-200 bg-transparent" + ariaLabel="Clear form" + variant="bordered" + size="sm" + radius="sm" + > + Cancel +
- - )} - - {/* +
+ + )} +
+ {/*
{form.watch("providerId") && ( @@ -169,7 +176,6 @@ export const LaunchScanWorkflow = ({ )}
*/} -
); diff --git a/ui/components/ui/custom/custom-input.tsx b/ui/components/ui/custom/custom-input.tsx index 3979c459f3..5b76ef6fda 100644 --- a/ui/components/ui/custom/custom-input.tsx +++ b/ui/components/ui/custom/custom-input.tsx @@ -120,7 +120,7 @@ export const CustomInput = ({ /> {showFormMessage && ( - + )} )}