Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

UI application improvements

Carlos Monastyrski52253cc2e3a8
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
index a4d5bef959..ae1880426a 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
@@ -154,9 +154,11 @@ export const CertManagerNav = ({
<ProjectNavList items={legacyItems} onSubmenuOpen={onSubmenuOpen} />
</SidebarCollapsibleGroup>
) : null}
- <SidebarCollapsibleGroup label="Administration">
- <ProjectNavList items={administrationItems} onSubmenuOpen={onSubmenuOpen} />
- </SidebarCollapsibleGroup>
+ {isCertManagerAdmin ? (
+ <SidebarCollapsibleGroup label="Administration">
+ <ProjectNavList items={administrationItems} onSubmenuOpen={onSubmenuOpen} />
+ </SidebarCollapsibleGroup>
+ ) : null}
</>
);
};
diff --git a/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ApplicationSelect.tsx b/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ApplicationSelect.tsx
index d621cc3e8a..d7595359de 100644
--- a/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ApplicationSelect.tsx
+++ b/frontend/src/layouts/ProjectLayout/components/ProjectSelect/ApplicationSelect.tsx
@@ -1,5 +1,5 @@
import { useState } from "react";
-import { Link, useNavigate, useParams } from "@tanstack/react-router";
+import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { Check, ChevronsUpDown } from "lucide-react";
import {
@@ -102,7 +102,9 @@ export const ApplicationSelect = () => {
projectId?: string;
orgId?: string;
};
- const { applicationName, projectId, orgId } = params;
+ const search = useSearch({ strict: false }) as { fromApplication?: string };
+ const { projectId, orgId } = params;
+ const applicationName = params.applicationName ?? search.fromApplication;
if (!applicationName || !projectId || !orgId) return null;
return (
diff --git a/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx b/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx
index 40b9821736..5dee996f08 100644
--- a/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx
+++ b/frontend/src/layouts/ProjectLayout/components/TypeSelect/TypeSelect.tsx
@@ -1,5 +1,5 @@
import { useMemo, useState } from "react";
-import { useNavigate, useParams } from "@tanstack/react-router";
+import { useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { Check, ChevronsUpDown } from "lucide-react";
import { Lottie } from "@app/components/v2";
@@ -153,6 +153,7 @@ const TypeSelectInner = ({
export const TypeSelect = () => {
const params = useParams({ strict: false });
+ const search = useSearch({ strict: false }) as { fromApplication?: string };
const { data: projects = [] } = useGetUserProjects();
if (params.type && !params.projectId) {
@@ -165,9 +166,10 @@ export const TypeSelect = () => {
if (params.projectId) {
const project = projects.find((p) => p.id === params.projectId);
if (project) {
+ const applicationName =
+ (params as { applicationName?: string }).applicationName ?? search.fromApplication;
const hasApplicationSelect =
- project.type === ProjectType.CertificateManager &&
- Boolean((params as { applicationName?: string }).applicationName);
+ project.type === ProjectType.CertificateManager && Boolean(applicationName);
const hasSiblingProjectSelect = project.type !== ProjectType.CertificateManager;
return (
<TypeSelectInner
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
index b2a6da9159..f559dd199c 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/ApplicationDetailsByIDPage.tsx
@@ -1,6 +1,12 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
-import { faCheck, faCopy, faEllipsisVertical, faTrash } from "@fortawesome/free-solid-svg-icons";
+import {
+ faCheck,
+ faCopy,
+ faEllipsisVertical,
+ faPenToSquare,
+ faTrash
+} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { ChevronLeftIcon } from "lucide-react";
@@ -16,7 +22,7 @@ import {
PageLoader,
ResourceIcon
} from "@app/components/v3";
-import { useToggle } from "@app/hooks";
+import { usePopUp, useToggle } from "@app/hooks";
import {
useDeletePkiApplication,
useGetPkiApplicationByName,
@@ -25,6 +31,7 @@ import {
} from "@app/hooks/api/pkiApplications";
import { ProjectType } from "@app/hooks/api/projects/types";
+import { PkiApplicationModal } from "../ApplicationsPage/components/PkiApplicationModal";
import { ApplicationCertificatesTab } from "./components/ApplicationCertificatesTab";
import { ApplicationMembersTab } from "./components/ApplicationMembersTab";
import { ApplicationRequestsTab } from "./components/ApplicationRequestsTab";
@@ -47,6 +54,11 @@ export const ApplicationDetailsByIDPage = () => {
const deleteApp = useDeletePkiApplication();
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
const [isIdCopied, setIsIdCopied] = useToggle(false);
+ const {
+ popUp: editPopUp,
+ handlePopUpOpen: handleEditPopUpOpen,
+ handlePopUpToggle: handleEditPopUpToggle
+ } = usePopUp(["application"] as const);
const selectedTab = search.selectedTab ?? "certificates";
@@ -119,6 +131,10 @@ export const ApplicationDetailsByIDPage = () => {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" sideOffset={2}>
+ <DropdownMenuItem onClick={() => handleEditPopUpOpen("application", application)}>
+ <FontAwesomeIcon icon={faPenToSquare} />
+ Edit Application
+ </DropdownMenuItem>
<DropdownMenuItem variant="danger" onClick={() => setIsDeleteOpen(true)}>
<FontAwesomeIcon icon={faTrash} />
Delete Application
@@ -156,6 +172,7 @@ export const ApplicationDetailsByIDPage = () => {
<TabPanel value="certificates">
<ApplicationCertificatesTab
applicationId={application.id}
+ applicationName={application.name}
initialSearch={search.search}
/>
</TabPanel>
@@ -191,6 +208,8 @@ export const ApplicationDetailsByIDPage = () => {
deleteKey="confirm"
onDeleteApproved={handleDelete}
/>
+
+ <PkiApplicationModal popUp={editPopUp} handlePopUpToggle={handleEditPopUpToggle} />
</>
);
};
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
index 8bc53fb5ed..4ec296f985 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
@@ -18,7 +18,10 @@ import {
SelectContent,
SelectItem,
SelectTrigger,
- SelectValue
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
} from "@app/components/v3";
import { useOrganization } from "@app/context";
import {
@@ -50,9 +53,24 @@ type Props = {
type Option = { value: string; label: string; isNew?: boolean };
const APP_ROLES = [
- { slug: "admin", label: "Admin" },
- { slug: "operator", label: "Operator" },
- { slug: "auditor", label: "Auditor" }
+ {
+ slug: "admin",
+ label: "Admin",
+ description:
+ "Full management of this application: edit/delete, attach/detach profiles, configure enrollment, manage approval policies, and manage members."
+ },
+ {
+ slug: "operator",
+ label: "Operator",
+ description:
+ "Day-to-day issuance: request and issue certificates against attached profiles, view enrollment, view approval policies, and submit approval requests."
+ },
+ {
+ slug: "auditor",
+ label: "Auditor",
+ description:
+ "Read-only access: view the application, certificates, enrollment, approval policies/requests, and audit logs."
+ }
];
const runSequential = async <T,>(items: T[], fn: (item: T) => Promise<void>): Promise<void> => {
@@ -362,20 +380,30 @@ export const AddApplicationMemberModal = ({
</FormControl>
)}
- <div className="flex items-center gap-2">
- <span className="text-sm text-accent">Role:</span>
- <Select value={role} onValueChange={setRole}>
- <SelectTrigger className="w-40">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {APP_ROLES.map((r) => (
- <SelectItem key={r.slug} value={r.slug}>
- {r.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ <div className="flex flex-col gap-1.5">
+ <div className="flex items-center gap-2">
+ <span className="text-sm text-accent">Role:</span>
+ <Select value={role} onValueChange={setRole}>
+ <SelectTrigger className="w-40">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {APP_ROLES.map((r) => (
+ <Tooltip key={r.slug} delayDuration={150}>
+ <TooltipTrigger asChild>
+ <SelectItem value={r.slug}>{r.label}</SelectItem>
+ </TooltipTrigger>
+ <TooltipContent side="right" className="max-w-xs">
+ {r.description}
+ </TooltipContent>
+ </Tooltip>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <p className="text-xs text-accent">
+ {APP_ROLES.find((r) => r.slug === role)?.description}
+ </p>
</div>
</div>
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationCertificatesTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationCertificatesTab.tsx
index e3ae38b499..a945b41038 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationCertificatesTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationCertificatesTab.tsx
@@ -2,13 +2,19 @@ import { CertificatesSection } from "../../CertificatesPage/components/Certifica
type Props = {
applicationId: string;
+ applicationName?: string;
initialSearch?: string;
};
-export const ApplicationCertificatesTab = ({ applicationId, initialSearch }: Props) => {
+export const ApplicationCertificatesTab = ({
+ applicationId,
+ applicationName,
+ initialSearch
+}: Props) => {
return (
<CertificatesSection
applicationId={applicationId}
+ applicationName={applicationName}
externalFilter={initialSearch ? { search: initialSearch } : undefined}
/>
);
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index f9b6c2d7a7..3bed70869a 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -77,7 +77,6 @@ import {
useAttachPkiApplicationProfiles,
useDetachPkiApplicationProfile
} from "@app/hooks/api/pkiApplications";
-import { PkiApplicationModal } from "@app/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal";
import { PolicyModal } from "@app/pages/cert-manager/ApprovalsPage/components/PolicyTab/components/PolicyModal";
import { CertificateIssuanceModal } from "@app/pages/cert-manager/CertificatesPage/components/CertificateIssuanceModal";
import { CreatePkiAlertV2Modal } from "@app/views/PkiAlertsV2Page/components/CreatePkiAlertV2Modal";
@@ -357,11 +356,6 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
handlePopUpOpen: handleIssuePopUpOpen,
handlePopUpToggle: handleIssuePopUpToggle
} = usePopUp(["issueCertificate"] as const);
- const {
- popUp: editPopUp,
- handlePopUpOpen: handleEditPopUpOpen,
- handlePopUpToggle: handleEditPopUpToggle
- } = usePopUp(["application"] as const);
const [profileToIssue, setProfileToIssue] = useState<TPkiApplicationProfile | null>(null);
const deletePolicy = useDeleteApprovalPolicy();
@@ -463,222 +457,187 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
};
return (
- <div className="grid grid-cols-1 gap-4 lg:grid-cols-12">
- <div className="space-y-4 lg:order-2 lg:col-span-3">
- <Card>
- <CardHeader className="grid-cols-[1fr_auto]">
- <CardTitle>General</CardTitle>
- <CardDescription>Edit application metadata.</CardDescription>
- <CardAction className="col-start-2 row-span-2 row-start-1 self-start justify-self-end">
- <IconButton
- variant="ghost"
- size="xs"
- onClick={() => handleEditPopUpOpen("application", application)}
- aria-label="Edit application"
- >
- <PencilIcon />
- </IconButton>
- </CardAction>
- </CardHeader>
- <CardContent>
- <dl className="grid grid-cols-1 gap-3 text-sm">
- <div>
- <dt className="text-xs text-accent">Name</dt>
- <dd className="font-mono text-foreground">{application.name}</dd>
- </div>
- {application.description?.length ? (
- <div>
- <dt className="text-xs text-accent">Description</dt>
- <dd className="text-foreground">{application.description}</dd>
- </div>
- ) : null}
- </dl>
- </CardContent>
- </Card>
- </div>
-
- <div className="space-y-4 lg:order-1 lg:col-span-9">
- <Card>
- <CardHeader>
- <CardTitle>Enrollment Methods</CardTitle>
- <CardDescription>
- Profiles this Application can issue from, and the methods (API · EST · ACME · SCEP)
- configured on each.
- </CardDescription>
- <CardAction>
- <Button
- size="sm"
- variant="project"
- onClick={() => setIsAttachOpen(true)}
- isDisabled={availableProfiles.length === 0}
- >
- <PlusIcon />
- Attach Profile
- </Button>
- </CardAction>
- </CardHeader>
- <CardContent>
- {profiles.length === 0 ? (
- <Empty className="border">
- <EmptyHeader>
- <EmptyTitle>No profiles attached</EmptyTitle>
- <EmptyDescription>Attach a profile to enable issuance.</EmptyDescription>
- </EmptyHeader>
- </Empty>
- ) : (
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Profile</TableHead>
- <TableHead>Methods</TableHead>
- <TableHead className="w-5" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {profiles.map((p) => {
- const methods = methodBadges(p);
- return (
- <TableRow key={p.profileId}>
- <TableCell isTruncatable className="font-mono">
- {p.profileSlug}
- </TableCell>
- <TableCell>
- {methods.length === 0 ? (
- <span className="text-xs text-accent">None</span>
- ) : (
- <div className="flex flex-wrap gap-1.5">
- {methods.map((m) => (
- <Badge key={m} variant="neutral">
- {m}
- </Badge>
- ))}
- </div>
- )}
- </TableCell>
- <TableCell>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton variant="ghost" size="xs">
- <MoreHorizontalIcon />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent className="min-w-44" align="end" sideOffset={2}>
- <DropdownMenuItem onClick={() => setProfileToConfigure(p)}>
- <SettingsIcon />
- Configure method
- </DropdownMenuItem>
- {p.apiConfigId ? (
- <DropdownMenuItem
- onClick={() => {
- setProfileToIssue(p);
- handleIssuePopUpOpen("issueCertificate");
- }}
- >
- <FilePlusIcon />
- Request Certificate
- </DropdownMenuItem>
- ) : null}
- <DropdownMenuItem
- variant="danger"
- onClick={() => setProfileToDetach(p)}
- >
- <Trash2Icon />
- Detach Profile
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </TableCell>
- </TableRow>
- );
- })}
- </TableBody>
- </Table>
- )}
- </CardContent>
- </Card>
-
- <Card>
- <CardHeader>
- <CardTitle>Approval Policies</CardTitle>
- <CardDescription>
- Approval workflows that gate certificate operations against this Application.
- </CardDescription>
- <CardAction>
- <Button variant="outline" onClick={() => handlePopUpOpen("policy")}>
- <FontAwesomeIcon icon={faPlus} />
- Create Policy
- </Button>
- </CardAction>
- </CardHeader>
- <CardContent>
- <ApplicationPoliciesTable
- applicationId={application.id}
- onEdit={(policy) => handlePopUpOpen("policy", { policyId: policy.id, policy })}
- onDelete={(policy) => handlePopUpOpen("deletePolicy", { policyId: policy.id })}
- />
- </CardContent>
- </Card>
-
- <Card>
- <CardHeader>
- <CardTitle>Alerting</CardTitle>
- <CardDescription>
- Alert rules for certificate events scoped to {application.name}.
- </CardDescription>
- <CardAction>
- <Button variant="outline" onClick={() => setAlertModal({ isOpen: true })}>
- <FontAwesomeIcon icon={faPlus} />
- Create Alert
- </Button>
- </CardAction>
- </CardHeader>
- <CardContent>
+ <div className="space-y-4">
+ <Card>
+ <CardHeader>
+ <CardTitle>Enrollment Methods</CardTitle>
+ <CardDescription>
+ Define which profiles this Application uses and how certificates are requested from each
+ one.
+ </CardDescription>
+ <CardAction>
+ <Button
+ size="sm"
+ variant="project"
+ onClick={() => setIsAttachOpen(true)}
+ isDisabled={availableProfiles.length === 0}
+ >
+ <PlusIcon />
+ Attach Profile
+ </Button>
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ {profiles.length === 0 ? (
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>No profiles attached</EmptyTitle>
+ <EmptyDescription>Attach a profile to enable issuance.</EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ ) : (
<Table>
<TableHeader>
<TableRow>
- <TableHead className="w-full">Name</TableHead>
- <TableHead className="whitespace-nowrap">Event Type</TableHead>
- <TableHead className="whitespace-nowrap">Status</TableHead>
- <TableHead className="whitespace-nowrap">Alert Before</TableHead>
- <TableHead className="whitespace-nowrap">Last Run</TableHead>
- <TableHead className="w-5 text-right">Actions</TableHead>
+ <TableHead>Profile</TableHead>
+ <TableHead>Methods</TableHead>
+ <TableHead className="w-5" />
</TableRow>
</TableHeader>
<TableBody>
- {isAlertsLoading &&
- Array.from({ length: 3 }, (_, idx) => (
- <TableRow key={`alert-skeleton-${idx + 1}`}>
- {Array.from({ length: 6 }, (__, cellIdx) => (
- <TableCell key={`alert-skeleton-cell-${cellIdx + 1}`}>
- <Skeleton className="h-4 w-24" />
- </TableCell>
- ))}
+ {profiles.map((p) => {
+ const methods = methodBadges(p);
+ return (
+ <TableRow key={p.profileId}>
+ <TableCell isTruncatable className="font-mono">
+ {p.profileSlug}
+ </TableCell>
+ <TableCell>
+ {methods.length === 0 ? (
+ <span className="text-xs text-accent">None</span>
+ ) : (
+ <div className="flex flex-wrap gap-1.5">
+ {methods.map((m) => (
+ <Badge key={m} variant="neutral">
+ {m}
+ </Badge>
+ ))}
+ </div>
+ )}
+ </TableCell>
+ <TableCell>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs">
+ <MoreHorizontalIcon />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="min-w-44" align="end" sideOffset={2}>
+ <DropdownMenuItem onClick={() => setProfileToConfigure(p)}>
+ <SettingsIcon />
+ Configure method
+ </DropdownMenuItem>
+ {p.apiConfigId ? (
+ <DropdownMenuItem
+ onClick={() => {
+ setProfileToIssue(p);
+ handleIssuePopUpOpen("issueCertificate");
+ }}
+ >
+ <FilePlusIcon />
+ Request Certificate
+ </DropdownMenuItem>
+ ) : null}
+ <DropdownMenuItem
+ variant="danger"
+ onClick={() => setProfileToDetach(p)}
+ >
+ <Trash2Icon />
+ Detach Profile
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </TableCell>
</TableRow>
- ))}
- {!isAlertsLoading && alerts.length === 0 && (
- <TableRow>
- <TableCell colSpan={6} className="py-8 text-center text-accent">
- No PKI alerts configured yet.
- </TableCell>
- </TableRow>
- )}
- {!isAlertsLoading &&
- alerts.map((a: TPkiAlertV2) => (
- <AlertRow
- key={a.id}
- alert={a}
- onView={() => setViewAlertModal({ isOpen: true, alertId: a.id })}
- onEdit={() => setAlertModal({ isOpen: true, alertId: a.id })}
- onDelete={() =>
- setDeleteAlertModal({ isOpen: true, alertId: a.id, name: a.name })
- }
- />
- ))}
+ );
+ })}
</TableBody>
</Table>
- </CardContent>
- </Card>
- </div>
+ )}
+ </CardContent>
+ </Card>
+
+ <Card>
+ <CardHeader>
+ <CardTitle>Approval Policies</CardTitle>
+ <CardDescription>
+ Approval workflows that gate certificate operations against this Application.
+ </CardDescription>
+ <CardAction>
+ <Button variant="outline" onClick={() => handlePopUpOpen("policy")}>
+ <FontAwesomeIcon icon={faPlus} />
+ Create Policy
+ </Button>
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ <ApplicationPoliciesTable
+ applicationId={application.id}
+ onEdit={(policy) => handlePopUpOpen("policy", { policyId: policy.id, policy })}
+ onDelete={(policy) => handlePopUpOpen("deletePolicy", { policyId: policy.id })}
+ />
+ </CardContent>
+ </Card>
+
+ <Card>
+ <CardHeader>
+ <CardTitle>Alerting</CardTitle>
+ <CardDescription>
+ Alert rules for certificate events scoped to {application.name}.
+ </CardDescription>
+ <CardAction>
+ <Button variant="outline" onClick={() => setAlertModal({ isOpen: true })}>
+ <FontAwesomeIcon icon={faPlus} />
+ Create Alert
+ </Button>
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead className="w-full">Name</TableHead>
+ <TableHead className="whitespace-nowrap">Event Type</TableHead>
+ <TableHead className="whitespace-nowrap">Status</TableHead>
+ <TableHead className="whitespace-nowrap">Alert Before</TableHead>
+ <TableHead className="whitespace-nowrap">Last Run</TableHead>
+ <TableHead className="w-5 text-right">Actions</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {isAlertsLoading &&
+ Array.from({ length: 3 }, (_, idx) => (
+ <TableRow key={`alert-skeleton-${idx + 1}`}>
+ {Array.from({ length: 6 }, (__, cellIdx) => (
+ <TableCell key={`alert-skeleton-cell-${cellIdx + 1}`}>
+ <Skeleton className="h-4 w-24" />
+ </TableCell>
+ ))}
+ </TableRow>
+ ))}
+ {!isAlertsLoading && alerts.length === 0 && (
+ <TableRow>
+ <TableCell colSpan={6} className="py-8 text-center text-accent">
+ No PKI alerts configured yet.
+ </TableCell>
+ </TableRow>
+ )}
+ {!isAlertsLoading &&
+ alerts.map((a: TPkiAlertV2) => (
+ <AlertRow
+ key={a.id}
+ alert={a}
+ onView={() => setViewAlertModal({ isOpen: true, alertId: a.id })}
+ onEdit={() => setAlertModal({ isOpen: true, alertId: a.id })}
+ onDelete={() =>
+ setDeleteAlertModal({ isOpen: true, alertId: a.id, name: a.name })
+ }
+ />
+ ))}
+ </TableBody>
+ </Table>
+ </CardContent>
+ </Card>
<PolicyModal
popUp={popUp}
@@ -781,8 +740,6 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
profileId={profileToIssue?.profileId}
applicationId={application.id}
/>
-
- <PkiApplicationModal popUp={editPopUp} handlePopUpToggle={handleEditPopUpToggle} />
</div>
);
};
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
index 787beb120a..5981e3007a 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ConfigureEnrollmentModal.tsx
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Plus } from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { Spinner, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
+import { ConfirmActionModal, Spinner, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
import {
Button,
Dialog,
@@ -98,6 +98,37 @@ const CopyableField = ({
);
};
+const DisableEnrollmentButton = ({
+ method,
+ onConfirmed,
+ isPending
+}: {
+ method: "API" | "EST" | "ACME" | "SCEP";
+ onConfirmed: () => Promise<void>;
+ isPending: boolean;
+}) => {
+ const [isOpen, setIsOpen] = useState(false);
+ return (
+ <>
+ <Button variant="outline" onClick={() => setIsOpen(true)} isPending={isPending}>
+ Disable
+ </Button>
+ <ConfirmActionModal
+ isOpen={isOpen}
+ onChange={setIsOpen}
+ confirmKey="disable"
+ title={`Disable ${method} enrollment for this profile?`}
+ subTitle={`Clients using ${method} against this profile via this Application will stop being able to request certificates. Existing certificates remain valid.`}
+ buttonText="Disable enrollment"
+ onConfirmed={async () => {
+ await onConfirmed();
+ setIsOpen(false);
+ }}
+ />
+ </>
+ );
+};
+
type ApiForm = { autoRenew: boolean; renewBeforeDays?: number };
const ApiPanel = ({
@@ -205,9 +236,11 @@ const ApiPanel = ({
)}
<div className="flex justify-end gap-2 pt-2">
{enabled && (
- <Button variant="outline" onClick={onDisable} isPending={clearMutation.isPending}>
- Disable
- </Button>
+ <DisableEnrollmentButton
+ method="API"
+ onConfirmed={onDisable}
+ isPending={clearMutation.isPending}
+ />
)}
<Button variant="project" onClick={onSave} isPending={setMutation.isPending}>
{enabled ? "Save" : "Enable"}
@@ -339,9 +372,11 @@ const EstPanel = ({
/>
<div className="flex justify-end gap-2 pt-2">
{enabled && (
- <Button variant="outline" onClick={onDisable} isPending={clearMutation.isPending}>
- Disable
- </Button>
+ <DisableEnrollmentButton
+ method="EST"
+ onConfirmed={onDisable}
+ isPending={clearMutation.isPending}
+ />
)}
<Button variant="project" onClick={onSave} isPending={setMutation.isPending}>
{enabled ? "Save" : "Enable"}
@@ -518,9 +553,11 @@ const AcmePanel = ({
)}
<div className="flex justify-end gap-2 pt-2">
{enabled && (
- <Button variant="outline" onClick={onDisable} isPending={clearMutation.isPending}>
- Disable
- </Button>
+ <DisableEnrollmentButton
+ method="ACME"
+ onConfirmed={onDisable}
+ isPending={clearMutation.isPending}
+ />
)}
<Button variant="project" onClick={onSave} isPending={setMutation.isPending}>
{enabled ? "Save" : "Enable"}
@@ -785,9 +822,11 @@ const ScepPanel = ({
/>
<div className="flex justify-end gap-2 pt-2">
{enabled && (
- <Button variant="outline" onClick={onDisable} isPending={clearMutation.isPending}>
- Disable
- </Button>
+ <DisableEnrollmentButton
+ method="SCEP"
+ onConfirmed={onDisable}
+ isPending={clearMutation.isPending}
+ />
)}
<Button variant="project" onClick={onSave} isPending={setMutation.isPending}>
{enabled ? "Save" : "Enable"}
diff --git a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
index 3ce8fbbca4..1f7d18b80d 100644
--- a/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationsPage/components/PkiApplicationModal.tsx
@@ -117,7 +117,7 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
<Field>
<FieldLabel>Name</FieldLabel>
<FieldContent>
- <Input {...field} placeholder="payments-service" />
+ <Input {...field} placeholder="my-service" />
</FieldContent>
{error ? <FieldError>{error.message}</FieldError> : null}
</Field>
@@ -132,7 +132,7 @@ export const PkiApplicationModal = ({ popUp, handlePopUpToggle }: Props) => {
<FieldContent>
<TextArea
{...field}
- placeholder="Issues and rotates certificates for the payments stack."
+ placeholder="Issues and rotates certificates for my application stack."
/>
</FieldContent>
{error ? <FieldError>{error.message}</FieldError> : null}
diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
index 3dd93827ce..c78b747fd4 100644
--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
@@ -1,6 +1,6 @@
import { Helmet } from "react-helmet";
import { subject } from "@casl/ability";
-import { Link, useNavigate, useParams } from "@tanstack/react-router";
+import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { ChevronLeftIcon, EllipsisIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
@@ -65,6 +65,7 @@ const Page = () => {
from: ROUTE_PATHS.CertManager.CertificateDetailsByIDPage.id
});
const { certificateId } = params as { certificateId: string };
+ const { fromApplication } = useSearch({ strict: false }) as { fromApplication?: string };
const { data: certificateData, isLoading } = useGetCertificateById(certificateId);
const certificate = certificateData?.certificate;
@@ -202,17 +203,33 @@ const Page = () => {
{(isAllowed) =>
isAllowed ? (
<div className="mx-auto mb-6 w-full max-w-8xl">
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/inventory"
- params={{
- orgId: currentOrg.id,
- projectId
- }}
- className="mb-4 flex w-fit items-center gap-x-1 text-sm text-mineshaft-400 transition duration-100 hover:text-mineshaft-400/80"
- >
- <ChevronLeftIcon size={16} />
- Certificates
- </Link>
+ {fromApplication ? (
+ <Link
+ to="/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName"
+ params={{
+ orgId: currentOrg.id,
+ projectId,
+ applicationName: fromApplication
+ }}
+ search={{ selectedTab: "certificates" }}
+ className="mb-4 flex w-fit items-center gap-x-1 text-sm text-mineshaft-400 transition duration-100 hover:text-mineshaft-400/80"
+ >
+ <ChevronLeftIcon size={16} />
+ {fromApplication} Certificates
+ </Link>
+ ) : (
+ <Link
+ to="/organizations/$orgId/projects/cert-manager/$projectId/inventory"
+ params={{
+ orgId: currentOrg.id,
+ projectId
+ }}
+ className="mb-4 flex w-fit items-center gap-x-1 text-sm text-mineshaft-400 transition duration-100 hover:text-mineshaft-400/80"
+ >
+ <ChevronLeftIcon size={16} />
+ Certificates
+ </Link>
+ )}
<PageHeader
scope={ProjectType.CertificateManager}
description="View certificate details"
diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/route.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/route.tsx
index 7075d709d3..90ecc9209f 100644
--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/route.tsx
+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute, linkOptions } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { CertificateDetailsByIDPage } from "./CertificateDetailsByIDPage";
+const CertificateDetailsByIDPageQuerySchema = z.object({
+ fromApplication: z.string().optional()
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificates/$certificateId"
)({
component: CertificateDetailsByIDPage,
+ validateSearch: zodValidator(CertificateDetailsByIDPageQuerySchema),
beforeLoad: ({ context, params }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
index 440f578c67..9ff74343c2 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesSection.tsx
@@ -38,13 +38,15 @@ type CertificatesSectionProps = {
dashboardFilters?: FilterRule[];
dashboardViewId?: string;
applicationId?: string;
+ applicationName?: string;
};
export const CertificatesSection = ({
externalFilter,
dashboardFilters,
dashboardViewId,
- applicationId
+ applicationId,
+ applicationName
}: CertificatesSectionProps) => {
const { currentProject } = useProject();
const { mutateAsync: deleteCert } = useDeleteCert();
@@ -154,6 +156,7 @@ export const CertificatesSection = ({
dashboardFilters={dashboardFilters}
dashboardViewId={dashboardViewId}
applicationId={applicationId}
+ applicationName={applicationName}
/>
<CertificateImportModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
<CertificateCertModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
index f0a327e4a0..34af98ec91 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificatesTable.tsx
@@ -129,6 +129,7 @@ type Props = {
dashboardFilters?: FilterRule[];
dashboardViewId?: string;
applicationId?: string;
+ applicationName?: string;
};
const PER_PAGE_INIT = 25;
@@ -165,7 +166,8 @@ export const CertificatesTable = ({
externalFilter,
dashboardFilters,
dashboardViewId,
- applicationId
+ applicationId,
+ applicationName
}: Props) => {
const [page, setPage] = useState(1);
const [perPage, setPerPage] = useState(PER_PAGE_INIT);
@@ -806,7 +808,8 @@ export const CertificatesTable = ({
orgId: currentOrg.id,
projectId: currentProject.id,
certificateId: certificate.id
- }
+ },
+ search: applicationName ? { fromApplication: applicationName } : undefined
});
}}
>