mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
fix(ui): wire cloudflare selector into modal credentials flow
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
} from "../../workflow/forms";
|
||||
import { SelectViaAlibabaCloud } from "../../workflow/forms/select-credentials-type/alibabacloud";
|
||||
import { SelectViaAWS } from "../../workflow/forms/select-credentials-type/aws";
|
||||
import { SelectViaCloudflare } from "../../workflow/forms/select-credentials-type/cloudflare";
|
||||
import {
|
||||
AddViaServiceAccountForm,
|
||||
SelectViaGCP,
|
||||
@@ -163,6 +164,14 @@ export function CredentialsStep({
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (providerType === "cloudflare") {
|
||||
return (
|
||||
<SelectViaCloudflare
|
||||
initialVia={via || undefined}
|
||||
onViaChange={handleViaChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -9,10 +9,12 @@ import { RadioGroupCloudflareViaCredentialsTypeForm } from "./radio-group-cloudf
|
||||
|
||||
interface SelectViaCloudflareProps {
|
||||
initialVia?: string;
|
||||
onViaChange?: (value: string) => void;
|
||||
}
|
||||
|
||||
export const SelectViaCloudflare = ({
|
||||
initialVia,
|
||||
onViaChange,
|
||||
}: SelectViaCloudflareProps) => {
|
||||
const router = useRouter();
|
||||
const form = useForm({
|
||||
@@ -22,6 +24,11 @@ export const SelectViaCloudflare = ({
|
||||
});
|
||||
|
||||
const handleSelectionChange = (value: string) => {
|
||||
if (onViaChange) {
|
||||
onViaChange(value);
|
||||
return;
|
||||
}
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set("via", value);
|
||||
router.push(url.toString());
|
||||
|
||||
Reference in New Issue
Block a user