Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement(cert-manager): migrate CaInstallCertModal to v3 Dialog (#8592)
Andrew Huang3897c1823b9f
diff --git a/AGENTS.md b/AGENTS.mdindex 3523b1b9e1..be01951397 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -28,7 +28,7 @@ When building frontend UI, follow [DESIGN.md](DESIGN.md) for the v3 design systeBefore changing a shared frontend component's lifecycle, read the [shared component lifecycle ledger](frontend/src/components/COMPONENT_LIFECYCLE.md) for current deprecations, blockers, and replacement decisions.-Pickers for entities a user may need to create first (app connections, gateways, and similar) must offer an inline "Create new X" row, gated on the create permission, so the user never has to leave the flow. Build them with the v3 `Combobox` and its `creation` prop, which renders that row; `Combobox` replaces both the deprecated `FilterableSelect` and `CreatableSelect`. For app connections, use `creation.mode = "dialog"` and have `renderForm` render `AppConnectionForm` with the app preset, selecting the new connection and calling `complete` in its `onComplete`, and route `onDismiss` and the form's cancel through `useDiscardChangesGuard` (see `CaInstallCertModal/useConnectionCreation.tsx`). A v2 `Modal` parent sits at `z-[60]`, above v3 overlays, so drop it to `z-50` (`className` and `overlayClassName`) when it hosts one.+Pickers for entities a user may need to create first (app connections, gateways, and similar) must offer an inline "Create new X" row, gated on the create permission, so the user never has to leave the flow. Build them with the v3 `Combobox` and its `creation` prop, which renders that row; `Combobox` replaces both the deprecated `FilterableSelect` and `CreatableSelect`. For app connections, use `creation.mode = "dialog"` and have `renderForm` render `AppConnectionForm` with the app preset, selecting the new connection and calling `complete` in its `onComplete`, and route `onDismiss` and the form's cancel through `useDiscardChangesGuard` (see `CaInstallCertModal/useConnectionCreation.tsx`). A v2 `Modal` parent sits at `z-[60]`, above v3 overlays, so migrate it to the v3 `Dialog` when it hosts one (see `CaInstallCertModal/CaInstallCertModal.tsx`).## Issue and PR Guidelinesdiff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsxindex 61ce082120..16985ba240 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsCaInstallForm.tsx@@ -1,18 +1,25 @@import { Controller, useForm } from "react-hook-form";-import { SingleValue } from "react-select";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import { createNotification } from "@app/components/notifications";import {Button,- FilterableSelect,- FormControl,+ Combobox,+ DialogBody,+ DialogClose,+ DialogFooter,+ Field,+ FieldDescription,+ FieldError,+ FieldLabel,Input,Select,- SelectItem-} from "@app/components/v2";-import { Combobox, Field, FieldError, FieldLabel } from "@app/components/v3";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { useProject } from "@app/context";import {CaSigningConfigType,@@ -134,109 +141,107 @@ export const AdcsCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {};return (- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="appConnectionId"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <Field className="mb-4">- <FieldLabel>- Azure AD CS Connection <span className="text-danger">*</span>- </FieldLabel>- <Combobox- isError={Boolean(error)}- modal- isClearable={false}- isLoading={isAdcsPending}- value={(availableAdcsConnections || []).find((conn) => conn.id === value) ?? null}- onValueChange={(option) => {- onChange(option.id);- }}- options={availableAdcsConnections || []}- placeholder="Select an Azure AD CS connection..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- creation={connectionCreation}- />- <FieldError errors={[error]} />- </Field>- )}- />- <Controller- control={control}- name="template"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- label="Certificate Template"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <FilterableSelect- isLoading={isTemplatesLoading && !!selectedConnectionId}- isDisabled={!selectedConnectionId}- value={templates.find((t) => t === value) ? { label: value, value } : null}- onChange={(option) => {- const selected = option as SingleValue<{ label: string; value: string }>;- onChange(selected?.value ?? "");- }}- options={templates.map((t) => ({ label: t, value: t }))}- placeholder={- selectedConnectionId ? "Select a template..." : "Select a connection first"- }- getOptionLabel={(option) => option.label}- getOptionValue={(option) => option.value}- />- </FormControl>- )}- />- <Controller- control={control}- name="validityPeriod"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Validity Period (Days)"- errorText={error?.message}- isError={Boolean(error)}- helperText="Number of days the certificate should be valid"- >- <Input {...field} type="number" placeholder="365" />- </FormControl>- )}- />- <Controller- control={control}- name="maxPathLength"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl label="Path Length" errorText={error?.message} isError={Boolean(error)}>- <Select {...field} onValueChange={onChange} className="w-full">- {[-1, 0, 1, 2, 3].map((value) => (- <SelectItem value={String(value)} key={`ca-path-length-${value}`}>- {String(value)}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >+ <form className="contents" onSubmit={handleSubmit(onFormSubmit)}>+ <DialogBody>+ <Controller+ control={control}+ name="appConnectionId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Azure AD CS Connection <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ modal+ isClearable={false}+ isLoading={isAdcsPending}+ value={(availableAdcsConnections || []).find((conn) => conn.id === value) ?? null}+ onValueChange={(option) => {+ onChange(option.id);+ }}+ options={availableAdcsConnections || []}+ placeholder="Select an Azure AD CS connection..."+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ creation={connectionCreation}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="template"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Certificate Template <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ isLoading={isTemplatesLoading && !!selectedConnectionId}+ isDisabled={!selectedConnectionId}+ modal+ isClearable={false}+ value={templates.find((t) => t === value) ? { label: value, value } : null}+ onValueChange={(option) => onChange(option.value)}+ options={templates.map((t) => ({ label: t, value: t }))}+ placeholder={+ selectedConnectionId ? "Select a template..." : "Select a connection first"+ }+ getOptionLabel={(option) => option.label}+ getOptionValue={(option) => option.value}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="validityPeriod"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Validity Period (Days)</FieldLabel>+ <Input {...field} isError={Boolean(error)} type="number" placeholder="365" />+ <FieldDescription>Number of days the certificate should be valid</FieldDescription>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="maxPathLength"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Path Length</FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ {[-1, 0, 1, 2, 3].map((value) => (+ <SelectItem value={String(value)} key={`ca-path-length-${value}`}>+ {String(value)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose>+ <Button variant="neutral" type="submit" isPending={isSubmitting}>Install</Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("installCaCert", false)}- >- Cancel- </Button>- </div>+ </DialogFooter></form>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsNativeCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsNativeCaInstallForm.tsxindex 862c2924c7..8485e85c41 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsNativeCaInstallForm.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/AdcsNativeCaInstallForm.tsx@@ -1,18 +1,25 @@import { Controller, useForm } from "react-hook-form";-import { SingleValue } from "react-select";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import { createNotification } from "@app/components/notifications";import {Button,- FilterableSelect,- FormControl,+ Combobox,+ DialogBody,+ DialogClose,+ DialogFooter,+ Field,+ FieldDescription,+ FieldError,+ FieldLabel,Input,Select,- SelectItem-} from "@app/components/v2";-import { Combobox, Field, FieldError, FieldLabel } from "@app/components/v3";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { useProject } from "@app/context";import {CaSigningConfigType,@@ -120,121 +127,136 @@ export const AdcsNativeCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {};return (- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="appConnectionId"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <Field className="mb-4">- <FieldLabel>- Microsoft ADCS Connection <span className="text-danger">*</span>- </FieldLabel>- <Combobox- isError={Boolean(error)}- modal- isClearable={false}- isLoading={isAdcsPending}- value={(availableAdcsConnections || []).find((conn) => conn.id === value) ?? null}- onValueChange={(option) => {- onChange(option.id);- }}- options={availableAdcsConnections || []}- placeholder="Select a Microsoft ADCS connection..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- creation={connectionCreation}- />- <FieldError errors={[error]} />- </Field>- )}- />- <Controller- control={control}- name="template"- render={({ field: { onChange, value, ...field }, fieldState: { error } }) => {- if (isTemplatesLoading && !!selectedConnectionId) {- return (- <FormControl label="Certificate Template" isRequired>- <FilterableSelect- isLoading- isDisabled- options={[]}- value={null}- onChange={() => {}}- placeholder="Loading templates..."- />- </FormControl>- );- }- if (templates.length > 0) {- return (- <FormControl- label="Certificate Template"- errorText={error?.message}+ <form className="contents" onSubmit={handleSubmit(onFormSubmit)}>+ <DialogBody>+ <Controller+ control={control}+ name="appConnectionId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Microsoft ADCS Connection <span className="text-danger">*</span>+ </FieldLabel>+ <ComboboxisError={Boolean(error)}- isRequired- >- <FilterableSelect- isDisabled={!selectedConnectionId}- value={templates.find((t) => t.name === value) ? { label: value, value } : null}- onChange={(option) => {- const selected = option as SingleValue<{ label: string; value: string }>;- onChange(selected?.value ?? "");- }}- options={templates.map((t) => ({ label: t.name, value: t.name }))}- placeholder="Select a template..."- getOptionLabel={(option) => option.label}- getOptionValue={(option) => option.value}+ modal+ isClearable={false}+ isLoading={isAdcsPending}+ value={(availableAdcsConnections || []).find((conn) => conn.id === value) ?? null}+ onValueChange={(option) => {+ onChange(option.id);+ }}+ options={availableAdcsConnections || []}+ placeholder="Select a Microsoft ADCS connection..."+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ creation={connectionCreation}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="template"+ render={({ field: { onChange, value, ...field }, fieldState: { error } }) => {+ if (isTemplatesLoading && !!selectedConnectionId) {+ return (+ <Field className="mb-4">+ <FieldLabel>+ Certificate Template <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isLoading+ isDisabled+ modal+ isClearable={false}+ options={[]}+ value={null}+ onValueChange={() => {}}+ getOptionLabel={() => ""}+ getOptionValue={() => ""}+ placeholder="Loading templates..."+ />+ </Field>+ );+ }+ if (templates.length > 0) {+ return (+ <Field className="mb-4">+ <FieldLabel>+ Certificate Template <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ isDisabled={!selectedConnectionId}+ modal+ isClearable={false}+ value={templates.find((t) => t.name === value) ? { label: value, value } : null}+ onValueChange={(option) => onChange(option.value)}+ options={templates.map((t) => ({ label: t.name, value: t.name }))}+ placeholder="Select a template..."+ getOptionLabel={(option) => option.label}+ getOptionValue={(option) => option.value}+ />+ <FieldError errors={[error]} />+ </Field>+ );+ }+ return (+ <Field className="mb-4">+ <FieldLabel>+ Certificate Template <span className="text-danger">*</span>+ </FieldLabel>+ <Input+ {...field}+ isError={Boolean(error)}+ required+ value={value}+ onChange={onChange}+ placeholder="SubCA"/>- </FormControl>+ <FieldDescription>+ Enter the subordinate CA template name (e.g. SubCA).+ </FieldDescription>+ <FieldError errors={[error]} />+ </Field>);- }- return (- <FormControl- label="Certificate Template"- errorText={error?.message}- isError={Boolean(error)}- isRequired- helperText="Enter the subordinate CA template name (e.g. SubCA)."- >- <Input {...field} value={value} onChange={onChange} placeholder="SubCA" />- </FormControl>- );- }}- />- <Controller- control={control}- name="maxPathLength"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl label="Path Length" errorText={error?.message} isError={Boolean(error)}>- <Select {...field} onValueChange={onChange} className="w-full">- {[-1, 0, 1, 2, 3].map((value) => (- <SelectItem value={String(value)} key={`ca-path-length-${value}`}>- {String(value)}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >+ }}+ />+ <Controller+ control={control}+ name="maxPathLength"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Path Length</FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ {[-1, 0, 1, 2, 3].map((value) => (+ <SelectItem value={String(value)} key={`ca-path-length-${value}`}>+ {String(value)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose>+ <Button variant="neutral" type="submit" isPending={isSubmitting}>Install</Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("installCaCert", false)}- >- Cancel- </Button>- </div>+ </DialogFooter></form>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsxindex d69f56074d..c85b06d07b 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/CaInstallCertModal.tsx@@ -1,18 +1,29 @@import { useState } from "react";-import {- ArrowLeftIcon,- ArrowRightIcon,- FileTextIcon,- LinkIcon,- ShieldCheckIcon-} from "lucide-react";+import { ArrowRightIcon, FileTextIcon, LinkIcon, ShieldCheckIcon } from "lucide-react";import {ExternalCertificateAuthoritiesUpgradeIntent,useUpgradeGate} from "@app/components/license/UpgradeGate";-import { Modal, ModalContent } from "@app/components/v2";-import { Badge, Button } from "@app/components/v3";+import {+ Badge,+ Button,+ Dialog,+ DialogBody,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldContent,+ FieldDescription,+ FieldLabel,+ FieldTitle,+ RadioGroup,+ RadioGroupItem+} from "@app/components/v3";import { useSubscription } from "@app/context";import { UsePopUpState } from "@app/hooks/usePopUp";@@ -99,53 +110,32 @@ enum Step {}type RadioCardProps = {- isSelected: boolean;- onClick: () => void;+ value: string;icon?: React.ReactNode;name: string;description: string;- badge?: string;isLocked?: boolean;- className?: string;};-const RadioCard = ({- isSelected,- onClick,- icon,- name,- description,- badge,- isLocked,- className-}: RadioCardProps) => (- <button- type="button"- onClick={onClick}- className={`flex items-center gap-4 rounded-md border px-4 py-4 text-left transition-colors ${- isSelected- ? "border-project/50 bg-project/5"- : "border-border-control bg-surface-hover hover:bg-surface-active"- } ${className ?? ""}`}- >- {icon}- <div className="flex-1">- <div className="flex items-center gap-2">- <span className="text-sm font-medium text-foreground">{name}</span>- {badge && <Badge variant="neutral">{badge}</Badge>}- {isLocked && <Badge variant="info">Enterprise</Badge>}- </div>- <p className="mt-0.5 text-xs text-muted">{description}</p>- </div>- <div- className={`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 ${- isSelected ? "border-none bg-project/30" : "border-border-strong"- }`}- >- {isSelected && <div className="h-2 w-2 rounded-full bg-label" />}- </div>- </button>-);+const RadioCard = ({ value, icon, name, description, isLocked }: RadioCardProps) => {+ const id = `ca-install-option-${value}`;++ return (+ <FieldLabel htmlFor={id} variant="project">+ <Field orientation="horizontal">+ {icon}+ <FieldContent>+ <FieldTitle>+ {name}+ {isLocked && <Badge variant="info">Enterprise</Badge>}+ </FieldTitle>+ <FieldDescription>{description}</FieldDescription>+ </FieldContent>+ <RadioGroupItem id={id} value={value} />+ </Field>+ </FieldLabel>+ );+};export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {const popupData = popUp?.installCaCert?.data as { caId: string } | undefined;@@ -228,66 +218,69 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {const renderMethodSelection = () => (<>- <div className="flex flex-col gap-3">- {SIGNING_METHOD_OPTIONS.map((option) => (- <RadioCard- key={option.value}- isSelected={selectedMethod === option.value}- isLocked={lockedMethods[option.value]}- onClick={() => handleSelectMethod(option.value)}- icon={- <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-surface-active">- <option.icon className="h-5 w-5 text-label" />- </div>- }- name={option.name}- description={option.description}- />- ))}- </div>- <div className="mt-6 flex items-center justify-end gap-2">- <Button- variant="outline"- onClick={() => {- resetState();- handlePopUpToggle("installCaCert", false);- }}+ <DialogBody>+ <RadioGroup+ aria-label="Signing method"+ value={selectedMethod ?? ""}+ onValueChange={(value) => handleSelectMethod(value as SigningMethod)}>- Cancel- </Button>+ {SIGNING_METHOD_OPTIONS.map((option) => (+ <RadioCard+ key={option.value}+ value={option.value}+ isLocked={lockedMethods[option.value]}+ icon={+ <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-surface-active">+ <option.icon className="h-5 w-5 text-label" />+ </div>+ }+ name={option.name}+ description={option.description}+ />+ ))}+ </RadioGroup>+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost">Cancel</Button>+ </DialogClose><Button variant="neutral" isDisabled={!selectedMethod} onClick={handleContinue}>{selectedMethod === SigningMethod.Automated ? "Choose Integration" : "Continue"}{selectedMethod === SigningMethod.Automated && <ArrowRightIcon />}</Button>- </div>+ </DialogFooter></>);const renderIntegrationSelection = () => (<>- <div className="flex flex-col gap-2">- {INTEGRATIONS.map((integration) => (- <RadioCard- key={integration.id}- isSelected={selectedIntegration === integration.id}- onClick={() => setSelectedIntegration(integration.id)}- icon={- integration.image ? (- <img- src={integration.image}- alt={`${integration.name} logo`}- className="h-8 w-8 rounded-md bg-surface-recessed object-contain p-1"- />- ) : undefined- }- name={integration.name}- description={integration.description}- className="py-3"- />- ))}- </div>- <div className="mt-6 flex items-center justify-end gap-2">- <Button variant="outline" onClick={goBackToMethodSelection}>+ <DialogBody>+ <RadioGroup+ aria-label="CA integration"+ value={selectedIntegration ?? ""}+ onValueChange={setSelectedIntegration}+ >+ {INTEGRATIONS.map((integration) => (+ <RadioCard+ key={integration.id}+ value={integration.id}+ icon={+ integration.image ? (+ <img+ src={integration.image}+ alt={`${integration.name} logo`}+ className="h-8 w-8 rounded-md bg-surface-recessed object-contain p-1"+ />+ ) : undefined+ }+ name={integration.name}+ description={integration.description}+ />+ ))}+ </RadioGroup>+ </DialogBody>+ <DialogFooter>+ <Button variant="ghost" onClick={goBackToMethodSelection}>Back</Button><Button@@ -297,7 +290,7 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {>Continue</Button>- </div>+ </DialogFooter></>);@@ -314,7 +307,7 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {return (<>- <div className="mb-4 flex gap-3">+ <div className="flex gap-3">{displayImage ? (<imgsrc={displayImage}@@ -342,30 +335,15 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {<p className="mt-0.5 text-xs text-muted">{displayDesc}</p></div></div>- <hr className="-mx-6 mb-4 border-border-control" />{renderForm()}</>);};- const getTitle = () => {- if (step === Step.ChooseIntegration) {- return (- <div>- <button- type="button"- className="mb-2 flex items-center gap-1 text-xs text-muted hover:text-label"- onClick={goBackToMethodSelection}- >- <ArrowLeftIcon className="h-3 w-3" />- Back- </button>- <span>Choose a CA Integration</span>- </div>- );- }- return "Install Intermediate CA Certificate";- };+ const title =+ step === Step.ChooseIntegration+ ? "Choose a CA Integration"+ : "Install Intermediate CA Certificate";const getSubTitle = () => {if (step === Step.ChooseMethod) {@@ -377,31 +355,27 @@ export const CaInstallCertModal = ({ popUp, handlePopUpToggle }: Props) => {return undefined;};- const needsOverflowVisible = step === Step.Form && selectedMethod === SigningMethod.Automated;+ const subTitle = getSubTitle();return (<>- <Modal- isOpen={popUp?.installCaCert?.isOpen}+ <Dialog+ open={popUp?.installCaCert?.isOpen}onOpenChange={(isOpen) => {if (!isOpen) resetState();handlePopUpToggle("installCaCert", isOpen);}}>- {/* z-50 (not the v2 default z-[60]) so the connection pickers' v3 creation dialog- (z-50, portaled later) stacks above this modal instead of behind it. */}- <ModalContent- title={getTitle()}- className="z-50 max-w-lg"- overlayClassName="z-50"- bodyClassName={needsOverflowVisible ? "overflow-visible" : undefined}- subTitle={getSubTitle()}- >+ <DialogContent>+ <DialogHeader>+ <DialogTitle>{title}</DialogTitle>+ {subTitle && <DialogDescription>{subTitle}</DialogDescription>}+ </DialogHeader>{step === Step.ChooseMethod && renderMethodSelection()}{step === Step.ChooseIntegration && renderIntegrationSelection()}{step === Step.Form && renderFormStep()}- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>{upgradeGate}</>);diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/ExternalCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/ExternalCaInstallForm.tsxindex a4193a2baa..4e0514d660 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/ExternalCaInstallForm.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/ExternalCaInstallForm.tsx@@ -1,14 +1,28 @@import { useEffect } from "react";import { Controller, useForm } from "react-hook-form";-import { faCheck, faCopy, faDownload } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { zodResolver } from "@hookform/resolvers/zod";import FileSaver from "file-saver";+import { DownloadIcon } from "lucide-react";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { Button, FormControl, IconButton, TextArea, Tooltip } from "@app/components/v2";-import { useTimedReset } from "@app/hooks";+import {+ Button,+ CopyButton,+ DialogBody,+ DialogClose,+ DialogFooter,+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+ IconButton,+ ScrollableContent,+ TextArea,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { useGetCaCsr, useImportCaCertificate } from "@app/hooks/api";import { UsePopUpState } from "@app/hooks/usePopUp";@@ -25,10 +39,6 @@ type Props = {};export const ExternalCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {- const [copyTextCaCsr, isCopyingCaCsr, setCopyTextCaCsr] = useTimedReset<string>({- initialState: "Copy to clipboard"- });-const {control,handleSubmit,@@ -69,94 +79,95 @@ export const ExternalCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {};return (- <form onSubmit={handleSubmit(onFormSubmit)}>- {csr && (- <>- <div className="my-4 flex items-center justify-between">- <h2>CSR for this CA</h2>- <div className="flex">- <Tooltip content={copyTextCaCsr}>- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative"- onClick={() => {- navigator.clipboard.writeText(csr);- setCopyTextCaCsr("Copied");- }}- >- <FontAwesomeIcon icon={isCopyingCaCsr ? faCheck : faCopy} />- </IconButton>- </Tooltip>- <Tooltip content="Download">- <IconButton- ariaLabel="copy icon"- colorSchema="secondary"- className="group relative ml-2"- onClick={() => {- downloadTxtFile("csr.pem", csr);- }}- >- <FontAwesomeIcon icon={faDownload} />- </IconButton>- </Tooltip>- </div>- </div>- <div className="mb-8 flex items-center justify-between rounded-md bg-foreground-inverse/[0.07] p-2 text-base text-muted-cool">- <p className="mr-4 break-all whitespace-pre-wrap">{csr}</p>- </div>- </>- )}- <Controller- control={control}- name="certificate"- render={({ field, fieldState: { error } }) => (- <FormControl label="Certificate Body" errorText={error?.message} isError={Boolean(error)}>- <TextArea- {...field}- placeholder="PEM-encoded certificate..."- reSize="none"- className="h-48"- />- </FormControl>- )}- />- <Controller- control={control}- name="certificateChain"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Certificate Chain"- errorText={error?.message}- isError={Boolean(error)}- >- <TextArea- {...field}- placeholder="PEM-encoded certificate chain..."- reSize="none"- className="h-48"- />- </FormControl>- )}- />- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >+ <form className="contents" onSubmit={handleSubmit(onFormSubmit)}>+ <DialogBody>+ <FieldGroup>+ {csr && (+ <Field>+ <div className="flex items-center justify-between">+ <FieldLabel>Certificate Signing Request</FieldLabel>+ <div className="flex items-center gap-1">+ <Tooltip>+ <TooltipTrigger asChild>+ <CopyButton value={csr} ariaLabel="Copy CSR" />+ </TooltipTrigger>+ <TooltipContent>Copy CSR</TooltipContent>+ </Tooltip>+ <Tooltip>+ <TooltipTrigger asChild>+ <IconButton+ type="button"+ variant="ghost"+ size="xs"+ aria-label="Download CSR"+ onClick={() => downloadTxtFile("csr.pem", csr)}+ >+ <DownloadIcon />+ </IconButton>+ </TooltipTrigger>+ <TooltipContent>Download CSR</TooltipContent>+ </Tooltip>+ </div>+ </div>+ <ScrollableContent+ aria-label="Certificate signing request"+ size="sm"+ edgeBehavior="fade"+ outline={false}+ containerClassName="rounded-md border border-border bg-container"+ >+ <pre className="p-3 font-mono text-[11px] leading-relaxed break-all whitespace-pre-wrap text-foreground">+ {csr}+ </pre>+ </ScrollableContent>+ </Field>+ )}+ <Controller+ control={control}+ name="certificate"+ render={({ field, fieldState: { error } }) => (+ <Field>+ <FieldLabel htmlFor="ca-install-certificate">Certificate Body</FieldLabel>+ <TextArea+ {...field}+ id="ca-install-certificate"+ placeholder="PEM-encoded certificate..."+ rows={6}+ isError={Boolean(error)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="certificateChain"+ render={({ field, fieldState: { error } }) => (+ <Field>+ <FieldLabel htmlFor="ca-install-certificate-chain">Certificate Chain</FieldLabel>+ <TextArea+ {...field}+ id="ca-install-certificate-chain"+ placeholder="PEM-encoded certificate chain..."+ rows={6}+ isError={Boolean(error)}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </FieldGroup>+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose>+ <Button variant="neutral" type="submit" isPending={isSubmitting}>Install</Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("installCaCert", false)}- >- Cancel- </Button>- </div>+ </DialogFooter></form>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/InternalCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/InternalCaInstallForm.tsxindex 3d01ecac48..38aaa118fc 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/InternalCaInstallForm.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/InternalCaInstallForm.tsx@@ -5,7 +5,21 @@ import { format } from "date-fns";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Select, SelectItem } from "@app/components/v2";+import {+ Button,+ DialogBody,+ DialogClose,+ DialogFooter,+ Field,+ FieldError,+ FieldLabel,+ Input,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { useProject } from "@app/context";import {CaStatus,@@ -132,94 +146,90 @@ export const InternalCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {}return (- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="parentCaId"- // defaultValue=""- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl- label="Parent CA"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <Select- // defaultValue={field.value}- {...field}- onValueChange={onChange}- className="w-full"- >- {(cas || [])- .filter((c) => {- const isParentCaNotSelf = c.id !== ca?.id;- const isParentCaActive = c.status === CaStatus.ACTIVE;- const isParentCaAllowedChildrenCas = c.maxPathLength && c.maxPathLength !== 0;-- return isParentCaNotSelf && isParentCaActive && isParentCaAllowedChildrenCas;- })- .map(({ id, type, dn }) => (- <SelectItem value={id} key={`parent-ca-${id}`}>- {`${caTypeToNameMap[type]}: ${dn}`}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <Controller- control={control}- name="notAfter"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Valid Until"- isError={Boolean(error)}- errorText={error?.message}- isRequired- >- <Input {...field} placeholder="YYYY-MM-DD" />- </FormControl>- )}- />- <Controller- control={control}- name="maxPathLength"- // defaultValue="0"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl label="Path Length" errorText={error?.message} isError={Boolean(error)}>- <Select- // defaultValue={field.value}- {...field}- onValueChange={onChange}- className="w-full"- >- {generatePathLengthOpts(parentCa?.configuration.maxPathLength || 0).map((value) => (- <SelectItem value={String(value)} key={`ca-path-length-${value}`}>- {`${value}`}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >+ <form className="contents" onSubmit={handleSubmit(onFormSubmit)}>+ <DialogBody>+ <Controller+ control={control}+ name="parentCaId"+ // defaultValue=""+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Parent CA <span className="text-danger">*</span>+ </FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue placeholder="Select a parent CA..." />+ </SelectTrigger>+ <SelectContent position="popper">+ {(cas || [])+ .filter((c) => {+ const isParentCaNotSelf = c.id !== ca?.id;+ const isParentCaActive = c.status === CaStatus.ACTIVE;+ const isParentCaAllowedChildrenCas = c.maxPathLength && c.maxPathLength !== 0;++ return isParentCaNotSelf && isParentCaActive && isParentCaAllowedChildrenCas;+ })+ .map(({ id, type, dn }) => (+ <SelectItem value={id} key={`parent-ca-${id}`}>+ {`${caTypeToNameMap[type]}: ${dn}`}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="notAfter"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Valid Until <span className="text-danger">*</span>+ </FieldLabel>+ <Input {...field} isError={Boolean(error)} required placeholder="YYYY-MM-DD" />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="maxPathLength"+ // defaultValue="0"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Path Length</FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ {generatePathLengthOpts(parentCa?.configuration.maxPathLength || 0).map(+ (value) => (+ <SelectItem value={String(value)} key={`ca-path-length-${value}`}>+ {`${value}`}+ </SelectItem>+ )+ )}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose>+ <Button variant="neutral" type="submit" isPending={isSubmitting}>Install</Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("installCaCert", false)}- >- Cancel- </Button>- </div>+ </DialogFooter></form>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/VenafiCaInstallForm.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/VenafiCaInstallForm.tsxindex 060ebaeabb..8280d931b5 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/VenafiCaInstallForm.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/VenafiCaInstallForm.tsx@@ -1,18 +1,25 @@import { Controller, useForm } from "react-hook-form";-import { SingleValue } from "react-select";import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import { createNotification } from "@app/components/notifications";import {Button,- FilterableSelect,- FormControl,+ Combobox,+ DialogBody,+ DialogClose,+ DialogFooter,+ Field,+ FieldDescription,+ FieldError,+ FieldLabel,Input,Select,- SelectItem-} from "@app/components/v2";-import { Combobox, Field, FieldError, FieldLabel } from "@app/components/v3";+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue+} from "@app/components/v3";import { useProject } from "@app/context";import {CaSigningConfigType,@@ -24,8 +31,6 @@ import {import { useListAvailableAppConnections } from "@app/hooks/api/appConnections";import { AppConnection } from "@app/hooks/api/appConnections/enums";import {- TVenafiApplication,- TVenafiIssuingTemplate,useVenafiConnectionListApplications,useVenafiConnectionListIssuingTemplates} from "@app/hooks/api/appConnections/venafi";@@ -154,142 +159,141 @@ export const VenafiCaInstallForm = ({ caId, handlePopUpToggle }: Props) => {};return (- <form onSubmit={handleSubmit(onFormSubmit)}>- <Controller- control={control}- name="appConnectionId"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <Field className="mb-4">- <FieldLabel>- Venafi Connection <span className="text-danger">*</span>- </FieldLabel>- <Combobox- isError={Boolean(error)}- modal- isClearable={false}- isLoading={isVenafiPending}- value={(availableVenafiConnections || []).find((conn) => conn.id === value) ?? null}- onValueChange={(option) => {- onChange(option.id);- setValue("applicationId", "");- setValue("issuingTemplateId", "");- }}- options={availableVenafiConnections || []}- placeholder="Select a Venafi connection..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- creation={connectionCreation}- />- <FieldError errors={[error]} />- </Field>- )}- />- <Controller- control={control}- name="applicationId"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- label="Application"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <FilterableSelect- isLoading={isApplicationsLoading && !!selectedConnectionId}- isDisabled={!selectedConnectionId}- value={applications.find((app) => app.id === value)}- onChange={(option) => {- const selected = option as SingleValue<TVenafiApplication>;- onChange(selected?.id ?? "");- setValue("issuingTemplateId", "");- }}- options={applications}- placeholder={- selectedConnectionId ? "Select an application..." : "Select a connection first"- }- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- />- </FormControl>- )}- />- <Controller- control={control}- name="issuingTemplateId"- render={({ field: { onChange, value }, fieldState: { error } }) => (- <FormControl- label="Issuing Template"- errorText={error?.message}- isError={Boolean(error)}- isRequired- >- <FilterableSelect- isLoading={isTemplatesLoading && !!selectedApplicationId}- isDisabled={!selectedApplicationId}- value={issuingTemplates.find((tmpl) => tmpl.id === value)}- onChange={(option) => {- const selected = option as SingleValue<TVenafiIssuingTemplate>;- onChange(selected?.id ?? "");- }}- options={issuingTemplates}- placeholder={- selectedApplicationId- ? "Select an issuing template..."- : "Select an application first"- }- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- />- </FormControl>- )}- />- <Controller- control={control}- name="validityPeriod"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Validity Period (Days)"- errorText={error?.message}- isError={Boolean(error)}- helperText="Number of days the certificate should be valid"- >- <Input {...field} type="number" placeholder="365" />- </FormControl>- )}- />- <Controller- control={control}- name="maxPathLength"- render={({ field: { onChange, ...field }, fieldState: { error } }) => (- <FormControl label="Path Length" errorText={error?.message} isError={Boolean(error)}>- <Select {...field} onValueChange={onChange} className="w-full">- {[-1, 0, 1, 2, 3].map((value) => (- <SelectItem value={String(value)} key={`ca-path-length-${value}`}>- {String(value)}- </SelectItem>- ))}- </Select>- </FormControl>- )}- />- <div className="flex items-center">- <Button- className="mr-4"- size="sm"- type="submit"- isLoading={isSubmitting}- isDisabled={isSubmitting}- >+ <form className="contents" onSubmit={handleSubmit(onFormSubmit)}>+ <DialogBody>+ <Controller+ control={control}+ name="appConnectionId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Venafi Connection <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ modal+ isClearable={false}+ isLoading={isVenafiPending}+ value={(availableVenafiConnections || []).find((conn) => conn.id === value) ?? null}+ onValueChange={(option) => {+ onChange(option.id);+ setValue("applicationId", "");+ setValue("issuingTemplateId", "");+ }}+ options={availableVenafiConnections || []}+ placeholder="Select a Venafi connection..."+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ creation={connectionCreation}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="applicationId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Application <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ isLoading={isApplicationsLoading && !!selectedConnectionId}+ isDisabled={!selectedConnectionId}+ modal+ isClearable={false}+ value={applications.find((app) => app.id === value) ?? null}+ onValueChange={(option) => {+ onChange(option.id);+ setValue("issuingTemplateId", "");+ }}+ options={applications}+ placeholder={+ selectedConnectionId ? "Select an application..." : "Select a connection first"+ }+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="issuingTemplateId"+ render={({ field: { onChange, value }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>+ Issuing Template <span className="text-danger">*</span>+ </FieldLabel>+ <Combobox+ isError={Boolean(error)}+ isLoading={isTemplatesLoading && !!selectedApplicationId}+ isDisabled={!selectedApplicationId}+ modal+ isClearable={false}+ value={issuingTemplates.find((tmpl) => tmpl.id === value) ?? null}+ onValueChange={(option) => onChange(option.id)}+ options={issuingTemplates}+ placeholder={+ selectedApplicationId+ ? "Select an issuing template..."+ : "Select an application first"+ }+ getOptionLabel={(option) => option.name}+ getOptionValue={(option) => option.id}+ />+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="validityPeriod"+ render={({ field, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Validity Period (Days)</FieldLabel>+ <Input {...field} isError={Boolean(error)} type="number" placeholder="365" />+ <FieldDescription>Number of days the certificate should be valid</FieldDescription>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ <Controller+ control={control}+ name="maxPathLength"+ render={({ field: { onChange, ...field }, fieldState: { error } }) => (+ <Field className="mb-4">+ <FieldLabel>Path Length</FieldLabel>+ <Select value={field.value} onValueChange={onChange}>+ <SelectTrigger className="w-full" isError={Boolean(error)}>+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ {[-1, 0, 1, 2, 3].map((value) => (+ <SelectItem value={String(value)} key={`ca-path-length-${value}`}>+ {String(value)}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldError errors={[error]} />+ </Field>+ )}+ />+ </DialogBody>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose>+ <Button variant="neutral" type="submit" isPending={isSubmitting}>Install</Button>- <Button- colorSchema="secondary"- variant="plain"- onClick={() => handlePopUpToggle("installCaCert", false)}- >- Cancel- </Button>- </div>+ </DialogFooter></form>);};diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/useConnectionCreation.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/useConnectionCreation.tsxindex bac6e8b7a4..fa670b7f55 100644--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/useConnectionCreation.tsx+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaInstallCertModal/useConnectionCreation.tsx@@ -57,6 +57,7 @@ export const useConnectionCreation = (<><AppConnectionFormapp={app}+ layout="dialog"projectId={currentProject.id}projectType={currentProject.type}onDirtyChange={setIsDirty}diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsxindex 4e4d1b3ca9..90d03afd94 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionForm.tsx@@ -17,7 +17,7 @@ import { DiscriminativePick } from "@app/types";import { OnePassConnectionForm } from "./1PasswordConnectionForm";import { AdcsConnectionForm } from "./AdcsConnectionForm";import { AnthropicConnectionForm } from "./AnthropicConnectionForm";-import { AppConnectionFormProvider } from "./AppConnectionFormContext";+import { AppConnectionFormProvider, useAppConnectionForm } from "./AppConnectionFormContext";import { Auth0ConnectionForm } from "./Auth0ConnectionForm";import { AwsConnectionForm } from "./AwsConnectionForm";import { AzureADCSConnectionForm } from "./AzureADCSConnectionForm";@@ -178,6 +178,7 @@ type UpdateFormProps = FormProps & {};const CreateForm = ({ app, onComplete, projectId, projectType }: CreateFormProps) => {+ const { layout } = useAppConnectionForm();const [pendingFormData, setPendingFormData] = useState<AppConnectionFormData | null>(null);const [isConfirmSubmitting, setIsConfirmSubmitting] = useState(false);const createAppConnection = useCreateAppConnection();@@ -410,9 +411,12 @@ const CreateForm = ({ app, onComplete, projectId, projectType }: CreateFormProps)}<divclassName={+ // eslint-disable-next-line no-nested-ternarypendingFormData? "hidden"- : "flex flex-1 flex-col [&>form]:flex [&>form]:flex-1 [&>form]:flex-col [&>form]:px-4 [&>form]:pt-4"+ : layout === "dialog"+ ? undefined+ : "flex flex-1 flex-col [&>form]:flex [&>form]:flex-1 [&>form]:flex-col [&>form]:px-4 [&>form]:pt-4"}>{renderForm()}@@ -422,6 +426,7 @@ const CreateForm = ({ app, onComplete, projectId, projectType }: CreateFormProps};const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {+ const { layout } = useAppConnectionForm();const [pendingFormData, setPendingFormData] = useState<AppConnectionFormData | null>(null);const [isConfirmSubmitting, setIsConfirmSubmitting] = useState(false);const updateAppConnection = useUpdateAppConnection();@@ -715,9 +720,12 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {)}<divclassName={+ // eslint-disable-next-line no-nested-ternarypendingFormData? "hidden"- : "flex flex-1 flex-col [&>form]:flex [&>form]:flex-1 [&>form]:flex-col [&>form]:px-4 [&>form]:pt-4"+ : layout === "dialog"+ ? undefined+ : "flex flex-1 flex-col [&>form]:flex [&>form]:flex-1 [&>form]:flex-col [&>form]:px-4 [&>form]:pt-4"}>{renderForm()}@@ -729,6 +737,7 @@ const UpdateForm = ({ appConnection, onComplete }: UpdateFormProps) => {type Props = {onCancel: () => void;onDirtyChange?: (isDirty: boolean) => void;+ layout?: "sheet" | "dialog";projectId?: string;projectType?: ProjectType;} & Pick<FormProps, "onComplete"> &@@ -739,13 +748,17 @@ type Props = {export const AppConnectionForm = ({onCancel,onDirtyChange,+ layout = "sheet",projectId,projectType,...props}: Props) => {const { app, appConnection } = props;- const contextValue = useMemo(() => ({ onCancel, onDirtyChange }), [onCancel, onDirtyChange]);+ const contextValue = useMemo(+ () => ({ onCancel, onDirtyChange, layout }),+ [onCancel, onDirtyChange, layout]+ );return (<AppConnectionFormProvider value={contextValue}>diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsxindex ee8e93817d..214fdf3a24 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormContext.tsx@@ -7,6 +7,7 @@ type AppConnectionFormContextValue = {*/onCancel: () => void;onDirtyChange?: (isDirty: boolean) => void;+ layout?: "sheet" | "dialog";};const AppConnectionFormContext = createContext<AppConnectionFormContextValue>({diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormFooter.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormFooter.tsxindex 34f28608ae..72aadeef31 100644--- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormFooter.tsx+++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/AppConnectionFormFooter.tsx@@ -1,6 +1,6 @@import { useFormContext } from "react-hook-form";-import { Button, SheetFooter } from "@app/components/v3";+import { Button, DialogFooter, SheetFooter } from "@app/components/v3";import { useScopeVariant } from "@app/hooks";import { useAppConnectionForm, useAppConnectionFormDirtyState } from "./AppConnectionFormContext";@@ -21,7 +21,7 @@ export const AppConnectionFormFooter = ({isDisabled,allowPristineSubmit}: Props) => {- const { onCancel } = useAppConnectionForm();+ const { onCancel, layout } = useAppConnectionForm();const {formState: { isSubmitting, isDirty }} = useFormContext();@@ -29,19 +29,38 @@ export const AppConnectionFormFooter = ({useAppConnectionFormDirtyState(isDirty);+ const isSubmitDisabled = isSubmitting || (!isDirty && !allowPristineSubmit) || isDisabled;++ if (layout === "dialog")+ return (+ <DialogFooter>+ <Button type="button" variant="ghost" onClick={onCancel} isDisabled={isSubmitting}>+ Cancel+ </Button>+ <Button+ type="submit"+ variant="neutral"+ isPending={isSubmitting}+ isDisabled={isSubmitDisabled}+ >+ {submitLabel}+ </Button>+ </DialogFooter>+ );+return (<SheetFooter className="sticky bottom-0 -mx-4 items-center border-t bg-popover">+ <Button type="button" variant="ghost" onClick={onCancel} isDisabled={isSubmitting}>+ Cancel+ </Button><Buttontype="submit"variant={scopeVariant}isPending={isSubmitting}- isDisabled={isSubmitting || (!isDirty && !allowPristineSubmit) || isDisabled}+ isDisabled={isSubmitDisabled}>{submitLabel}</Button>- <Button type="button" variant="outline" onClick={onCancel} isDisabled={isSubmitting}>- Cancel- </Button></SheetFooter>);};