fix(ui): wire cloudflare selector into modal credentials flow

This commit is contained in:
alejandrobailo
2026-02-24 12:11:22 +01:00
parent 1ed983ab66
commit b39113829c
2 changed files with 16 additions and 0 deletions
@@ -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;
}
@@ -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());