Skip to content

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

Add details views on profiles and policies

Carlos Monastyrski824c1ba413f6
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index 82ef77fb97..c86214b5b1 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -599,7 +599,7 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
profileId: p.profileId
}}
search={{ from: "application", applicationName: application.name }}
- className="text-mineshaft-200 hover:text-primary-400"
+ className="text-mineshaft-200 hover:underline"
>
{p.profileSlug}
</Link>
diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx
index 390bc44b0d..44e232c4ef 100644
--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/CertAuthDetailsByIDPage.tsx
@@ -51,7 +51,12 @@ const Page = () => {
const { caId } = params as { caId: string };
const search = useSearch({
from: ROUTE_PATHS.CertManager.CertAuthDetailsByIDPage.id
- }) as { from?: "settings" | "profile"; profileId?: string };
+ }) as {
+ from?: "settings" | "profile";
+ profileId?: string;
+ profileFrom?: "settings" | "application";
+ profileApplicationName?: string;
+ };
const { data } = useGetCa({
caId,
type: CaType.INTERNAL
@@ -119,6 +124,10 @@ const Page = () => {
projectId,
profileId: search.profileId
}}
+ search={{
+ from: search.profileFrom,
+ applicationName: search.profileApplicationName
+ }}
className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400"
>
<FontAwesomeIcon icon={faChevronLeft} />
diff --git a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/route.tsx b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/route.tsx
index 15050bb3e5..9c60b98268 100644
--- a/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/route.tsx
+++ b/frontend/src/pages/cert-manager/CertAuthDetailsByIDPage/route.tsx
@@ -6,7 +6,9 @@ import { CertAuthDetailsByIDPage } from "./CertAuthDetailsByIDPage";
const caDetailsSearchSchema = z.object({
from: z.enum(["settings", "profile"]).optional(),
- profileId: z.string().optional()
+ profileId: z.string().optional(),
+ profileFrom: z.enum(["settings", "application"]).optional(),
+ profileApplicationName: z.string().optional()
});
export const Route = createFileRoute(
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx
index 753c1f2826..9376c76db8 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaTable.tsx
@@ -1,23 +1,20 @@
import { subject } from "@casl/ability";
-import { faBan, faCertificate, faEllipsis, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate } from "@tanstack/react-router";
import { format } from "date-fns";
+import { BanIcon, MoreHorizontalIcon, ScrollTextIcon, Trash2Icon } from "lucide-react";
import { twMerge } from "tailwind-merge";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
+ Badge,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip
-} from "@app/components/v2";
-import {
- Badge,
Empty,
EmptyHeader,
EmptyTitle,
+ IconButton,
Skeleton,
Table,
TableBody,
@@ -136,14 +133,12 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
</TableCell>
<TableCell className="text-right" onClick={(e) => e.stopPropagation()}>
<DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="inline-flex hover:text-primary-400 data-[state=open]:text-primary-400">
- <Tooltip content="More options">
- <FontAwesomeIcon size="lg" icon={faEllipsis} />
- </Tooltip>
- </div>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs" aria-label="CA actions">
+ <MoreHorizontalIcon />
+ </IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
{ca.status === CaStatus.PENDING_CERTIFICATE && (
<ProjectPermissionCan
I={ProjectPermissionCertificateAuthorityActions.Create}
@@ -153,18 +148,15 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("installCaCert", {
caId: ca.id
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faCertificate} />}
>
+ <ScrollTextIcon />
Install CA Certificate
</DropdownMenuItem>
)}
@@ -179,18 +171,15 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("caCert", {
caId: ca.id
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faCertificate} />}
>
+ <ScrollTextIcon />
View Certificate
</DropdownMenuItem>
)}
@@ -205,9 +194,7 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("caStatus", {
@@ -218,9 +205,8 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
: CaStatus.ACTIVE
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faBan} />}
>
+ <BanIcon />
{`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}
</DropdownMenuItem>
)}
@@ -234,18 +220,16 @@ export const CaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ variant="danger"
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("deleteCa", {
caId: ca.id
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faTrash} />}
>
+ <Trash2Icon />
Delete CA
</DropdownMenuItem>
)}
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx
index 23d1f2d0b7..6aa4592ad5 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaTable.tsx
@@ -1,21 +1,18 @@
import { subject } from "@casl/ability";
-import { faBan, faEllipsis, faPencil, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { BanIcon, MoreHorizontalIcon, PencilIcon, Trash2Icon } from "lucide-react";
import { twMerge } from "tailwind-merge";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
+ Badge,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip
-} from "@app/components/v2";
-import {
- Badge,
Empty,
EmptyHeader,
EmptyTitle,
+ IconButton,
Skeleton,
Table,
TableBody,
@@ -114,14 +111,12 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
</TableCell>
<TableCell className="text-right" onClick={(e) => e.stopPropagation()}>
<DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="inline-flex hover:text-primary-400 data-[state=open]:text-primary-400">
- <Tooltip content="More options">
- <FontAwesomeIcon size="lg" icon={faEllipsis} />
- </Tooltip>
- </div>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs" aria-label="CA actions">
+ <MoreHorizontalIcon />
+ </IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
<ProjectPermissionCan
I={ProjectPermissionCertificateAuthorityActions.Edit}
a={subject(ProjectPermissionSub.CertificateAuthorities, {
@@ -130,9 +125,7 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("ca", {
@@ -141,9 +134,8 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
type: ca.type
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faPencil} />}
>
+ <PencilIcon />
Edit CA
</DropdownMenuItem>
)}
@@ -157,9 +149,7 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("caStatus", {
@@ -171,9 +161,8 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
: CaStatus.ACTIVE
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faBan} />}
>
+ <BanIcon />
{`${ca.status === CaStatus.ACTIVE ? "Disable" : "Enable"} CA`}
</DropdownMenuItem>
)}
@@ -187,9 +176,8 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- !isAllowed && "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ variant="danger"
+ isDisabled={!isAllowed}
onClick={(e) => {
e.stopPropagation();
handlePopUpOpen("deleteCa", {
@@ -197,9 +185,8 @@ export const ExternalCaTable = ({ handlePopUpOpen }: Props) => {
type: ca.type
});
}}
- disabled={!isAllowed}
- icon={<FontAwesomeIcon icon={faTrash} />}
>
+ <Trash2Icon />
Delete CA
</DropdownMenuItem>
)}
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/CertificatePolicyDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/CertificatePolicyDetailsByIDPage.tsx
index f00aeeefa7..a4614ae3fb 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/CertificatePolicyDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/CertificatePolicyDetailsByIDPage.tsx
@@ -4,18 +4,10 @@ import { subject } from "@casl/ability";
import { faChevronLeft } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
-import { EllipsisIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import { AccessRestrictedBanner, DeleteActionModal, PageHeader } from "@app/components/v2";
-import {
- Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger
-} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import {
@@ -49,7 +41,12 @@ const Page = () => {
const { policyId } = params as { policyId: string };
const search = useSearch({
from: ROUTE_PATHS.CertManager.CertificatePolicyDetailsByIDPage.id
- }) as { from?: "settings" | "profile"; profileId?: string };
+ }) as {
+ from?: "settings" | "profile";
+ profileId?: string;
+ profileFrom?: "settings" | "application";
+ profileApplicationName?: string;
+ };
const { data: policy } = useGetCertificatePolicyById({ policyId });
const { mutateAsync: deletePolicy } = useDeleteCertificatePolicy();
@@ -104,6 +101,10 @@ const Page = () => {
projectId,
profileId: search.profileId
}}
+ search={{
+ from: search.profileFrom,
+ applicationName: search.profileApplicationName
+ }}
className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400"
>
<FontAwesomeIcon icon={faChevronLeft} />
@@ -127,52 +128,14 @@ const Page = () => {
scope={ProjectType.CertificateManager}
description="Manage certificate policy"
title={policy.name}
- >
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="outline">
- Options
- <EllipsisIcon />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <ProjectPermissionCan
- I={ProjectPermissionCertificatePolicyActions.Edit}
- a={subject(ProjectPermissionSub.CertificatePolicies, {
- name: policy.name
- })}
- >
- {(canEdit) => (
- <DropdownMenuItem
- isDisabled={!canEdit}
- onClick={() => setIsEditModalOpen(true)}
- >
- Edit Policy
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- <ProjectPermissionCan
- I={ProjectPermissionCertificatePolicyActions.Delete}
- a={subject(ProjectPermissionSub.CertificatePolicies, {
- name: policy.name
- })}
- >
- {(canDelete) => (
- <DropdownMenuItem
- variant="danger"
- isDisabled={!canDelete}
- onClick={() => setIsDeleteModalOpen(true)}
- >
- Delete Policy
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
- </PageHeader>
+ />
<div className="flex flex-col gap-5 lg:flex-row">
<div className="w-full lg:max-w-[24rem]">
- <PolicyDetailsSection policy={policy} />
+ <PolicyDetailsSection
+ policy={policy}
+ onEdit={() => setIsEditModalOpen(true)}
+ onDelete={() => setIsDeleteModalOpen(true)}
+ />
</div>
<div className="flex flex-1 flex-col gap-y-5">
<PolicyValiditySection policy={policy} />
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
index 373e754f7c..f57d7b8d72 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
@@ -1,8 +1,11 @@
+import { subject } from "@casl/ability";
import { format } from "date-fns";
-import { CheckIcon, ClipboardListIcon } from "lucide-react";
+import { CheckIcon, ClipboardListIcon, EllipsisIcon } from "lucide-react";
+import { ProjectPermissionCan } from "@app/components/permissions";
import {
Card,
+ CardAction,
CardContent,
CardDescription,
CardHeader,
@@ -11,19 +14,29 @@ import {
DetailGroup,
DetailLabel,
DetailValue,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
IconButton,
Tooltip,
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
+import {
+ ProjectPermissionCertificatePolicyActions,
+ ProjectPermissionSub
+} from "@app/context/ProjectPermissionContext/types";
import { useTimedReset } from "@app/hooks";
import { TCertificatePolicy } from "@app/hooks/api/certificatePolicies";
type Props = {
policy: TCertificatePolicy;
+ onEdit: () => void;
+ onDelete: () => void;
};
-export const PolicyDetailsSection = ({ policy }: Props) => {
+export const PolicyDetailsSection = ({ policy, onEdit, onDelete }: Props) => {
const [, isCopyingId, setCopyTextId] = useTimedReset<string>({
initialState: "Copy ID to clipboard"
});
@@ -33,6 +46,37 @@ export const PolicyDetailsSection = ({ policy }: Props) => {
<CardHeader className="border-b">
<CardTitle>Details</CardTitle>
<CardDescription>Certificate policy details</CardDescription>
+ <CardAction>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="outline" size="xs" aria-label="Policy options">
+ <EllipsisIcon />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <ProjectPermissionCan
+ I={ProjectPermissionCertificatePolicyActions.Edit}
+ a={subject(ProjectPermissionSub.CertificatePolicies, { name: policy.name })}
+ >
+ {(canEdit) => (
+ <DropdownMenuItem isDisabled={!canEdit} onClick={onEdit}>
+ Edit Policy
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ <ProjectPermissionCan
+ I={ProjectPermissionCertificatePolicyActions.Delete}
+ a={subject(ProjectPermissionSub.CertificatePolicies, { name: policy.name })}
+ >
+ {(canDelete) => (
+ <DropdownMenuItem variant="danger" isDisabled={!canDelete} onClick={onDelete}>
+ Delete Policy
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </CardAction>
</CardHeader>
<CardContent>
<DetailGroup>
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/route.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/route.tsx
index 5d88f27ad6..9a6ca616d7 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/route.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/route.tsx
@@ -6,7 +6,9 @@ import { CertificatePolicyDetailsByIDPage } from "./CertificatePolicyDetailsByID
const policyDetailsSearchSchema = z.object({
from: z.enum(["settings", "profile"]).optional(),
- profileId: z.string().optional()
+ profileId: z.string().optional(),
+ profileFrom: z.enum(["settings", "application"]).optional(),
+ profileApplicationName: z.string().optional()
});
export const Route = createFileRoute(
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/CertificateProfileDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/CertificateProfileDetailsByIDPage.tsx
index 8ef3fb3f18..56bf0bef86 100644
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/CertificateProfileDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/CertificateProfileDetailsByIDPage.tsx
@@ -4,18 +4,10 @@ import { subject } from "@casl/ability";
import { faChevronLeft } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
-import { EllipsisIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import { AccessRestrictedBanner, DeleteActionModal, PageHeader } from "@app/components/v2";
-import {
- Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger
-} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization, useProject } from "@app/context";
import {
@@ -29,12 +21,7 @@ import {
import { ProjectType } from "@app/hooks/api/projects/types";
import { CreateProfileModal } from "../PoliciesPage/components/CertificateProfilesTab/CreateProfileModal";
-import {
- ProfileDefaultsSection,
- ProfileDetailsSection,
- ProfileIssuerSection,
- ProfilePolicySection
-} from "./components";
+import { ProfileDefaultsSection, ProfileOverviewSection } from "./components";
const Page = () => {
const { currentProject } = useProject();
@@ -136,54 +123,18 @@ const Page = () => {
scope={ProjectType.CertificateManager}
description="Manage certificate profile"
title={profile.slug}
- >
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="outline">
- Options
- <EllipsisIcon />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <ProjectPermissionCan
- I={ProjectPermissionCertificateProfileActions.Edit}
- a={subject(ProjectPermissionSub.CertificateProfiles, {
- slug: profile.slug
- })}
- >
- {(canEdit) => (
- <DropdownMenuItem
- isDisabled={!canEdit}
- onClick={() => setIsEditModalOpen(true)}
- >
- Edit Profile
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- <ProjectPermissionCan
- I={ProjectPermissionCertificateProfileActions.Delete}
- a={subject(ProjectPermissionSub.CertificateProfiles, {
- slug: profile.slug
- })}
- >
- {(canDelete) => (
- <DropdownMenuItem
- variant="danger"
- isDisabled={!canDelete}
- onClick={() => setIsDeleteModalOpen(true)}
- >
- Delete Profile
- </DropdownMenuItem>
- )}
- </ProjectPermissionCan>
- </DropdownMenuContent>
- </DropdownMenu>
- </PageHeader>
+ />
<div className="flex flex-col gap-5 lg:flex-row">
<div className="w-full lg:max-w-[24rem]">
- <ProfileDetailsSection profile={profile} />
- <ProfileIssuerSection profile={profile} />
- <ProfilePolicySection profile={profile} />
+ <ProfileOverviewSection
+ profile={profile}
+ onEdit={() => setIsEditModalOpen(true)}
+ onDelete={() => setIsDeleteModalOpen(true)}
+ backContext={{
+ from: search.from,
+ applicationName: search.applicationName
+ }}
+ />
</div>
<div className="flex flex-1 flex-col gap-y-5">
<ProfileDefaultsSection profile={profile} />
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
index d98c1f582a..bf43dc5df1 100644
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
@@ -1,3 +1,5 @@
+import { KeyRoundIcon, ScrollTextIcon, ShieldCheckIcon, UserIcon } from "lucide-react";
+
import {
Badge,
Card,
@@ -6,7 +8,6 @@ import {
CardHeader,
CardTitle,
Detail,
- DetailGroup,
DetailLabel,
DetailValue
} from "@app/components/v3";
@@ -22,6 +23,13 @@ type Props = {
profile: TCertificateProfileWithDetails;
};
+const SectionHeader = ({ icon, title }: { icon: React.ReactNode; title: string }) => (
+ <h3 className="mb-4 flex items-center gap-2 text-base font-medium text-foreground">
+ <span className="text-label [&>svg]:size-4">{icon}</span>
+ {title}
+ </h3>
+);
+
export const ProfileDefaultsSection = ({ profile }: Props) => {
const defaults = profile.defaults ?? null;
@@ -35,15 +43,20 @@ export const ProfileDefaultsSection = ({ profile }: Props) => {
);
const hasCryptoDefaults = Boolean(
- defaults?.keyAlgorithm ||
- defaults?.signatureAlgorithm ||
- defaults?.ttlDays ||
- (defaults?.keyUsages && defaults.keyUsages.length > 0) ||
- (defaults?.extendedKeyUsages && defaults.extendedKeyUsages.length > 0) ||
- defaults?.basicConstraints
+ defaults?.keyAlgorithm || defaults?.signatureAlgorithm || defaults?.ttlDays
);
- if (!defaults || (!hasSubjectDefaults && !hasCryptoDefaults)) {
+ const hasKeyUsages = Boolean(
+ (defaults?.keyUsages && defaults.keyUsages.length > 0) ||
+ (defaults?.extendedKeyUsages && defaults.extendedKeyUsages.length > 0)
+ );
+
+ const hasBasicConstraints = Boolean(defaults?.basicConstraints);
+
+ if (
+ !defaults ||
+ (!hasSubjectDefaults && !hasCryptoDefaults && !hasKeyUsages && !hasBasicConstraints)
+ ) {
return (
<Card className="w-full">
<CardHeader className="border-b">
@@ -57,6 +70,13 @@ export const ProfileDefaultsSection = ({ profile }: Props) => {
);
}
+ let isFirstSection = true;
+ const sectionClassName = () => {
+ const className = isFirstSection ? "" : "mt-6 border-t border-border pt-6";
+ isFirstSection = false;
+ return className;
+ };
+
return (
<Card className="w-full">
<CardHeader className="border-b">
@@ -64,60 +84,72 @@ export const ProfileDefaultsSection = ({ profile }: Props) => {
<CardDescription>Values applied when issuing certificates</CardDescription>
</CardHeader>
<CardContent>
- <DetailGroup>
- {defaults.ttlDays !== undefined && defaults.ttlDays !== null && (
- <Detail>
- <DetailLabel>TTL</DetailLabel>
- <DetailValue>{defaults.ttlDays} days</DetailValue>
- </Detail>
- )}
-
- {defaults.keyAlgorithm && (
- <Detail>
- <DetailLabel>Key Algorithm</DetailLabel>
- <DetailValue>
- <Badge variant="neutral">{defaults.keyAlgorithm}</Badge>
- </DetailValue>
- </Detail>
- )}
-
- {defaults.signatureAlgorithm && (
- <Detail>
- <DetailLabel>Signature Algorithm</DetailLabel>
- <DetailValue>
- <Badge variant="neutral">{defaults.signatureAlgorithm}</Badge>
- </DetailValue>
- </Detail>
- )}
-
- {defaults.keyUsages && defaults.keyUsages.length > 0 && (
- <Detail>
- <DetailLabel>Key Usages</DetailLabel>
- <DetailValue className="flex flex-wrap gap-1">
- {defaults.keyUsages.map((usage) => (
- <Badge key={usage} variant="neutral">
- {formatKeyUsage(usage as CertKeyUsageType)}
- </Badge>
- ))}
- </DetailValue>
- </Detail>
- )}
-
- {defaults.extendedKeyUsages && defaults.extendedKeyUsages.length > 0 && (
- <Detail>
- <DetailLabel>Extended Key Usages</DetailLabel>
- <DetailValue className="flex flex-wrap gap-1">
- {defaults.extendedKeyUsages.map((usage) => (
- <Badge key={usage} variant="neutral">
- {formatExtendedKeyUsage(usage as CertExtendedKeyUsageType)}
- </Badge>
- ))}
- </DetailValue>
- </Detail>
- )}
-
- {defaults.basicConstraints && (
- <>
+ {hasCryptoDefaults && (
+ <div className={sectionClassName()}>
+ <SectionHeader icon={<KeyRoundIcon />} title="Cryptography" />
+ <div className="grid grid-cols-2 gap-x-8 gap-y-4">
+ {defaults.ttlDays !== undefined && defaults.ttlDays !== null && (
+ <Detail>
+ <DetailLabel>TTL</DetailLabel>
+ <DetailValue>{defaults.ttlDays} days</DetailValue>
+ </Detail>
+ )}
+ {defaults.keyAlgorithm && (
+ <Detail>
+ <DetailLabel>Key Algorithm</DetailLabel>
+ <DetailValue>
+ <Badge variant="neutral">{defaults.keyAlgorithm}</Badge>
+ </DetailValue>
+ </Detail>
+ )}
+ {defaults.signatureAlgorithm && (
+ <Detail>
+ <DetailLabel>Signature Algorithm</DetailLabel>
+ <DetailValue>
+ <Badge variant="neutral">{defaults.signatureAlgorithm}</Badge>
+ </DetailValue>
+ </Detail>
+ )}
+ </div>
+ </div>
+ )}
+
+ {hasKeyUsages && (
+ <div className={sectionClassName()}>
+ <SectionHeader icon={<ShieldCheckIcon />} title="Key Usages" />
+ <div className="grid grid-cols-2 gap-x-8 gap-y-4">
+ {defaults.keyUsages && defaults.keyUsages.length > 0 && (
+ <Detail>
+ <DetailLabel>Key Usages</DetailLabel>
+ <DetailValue className="flex flex-wrap gap-1">
+ {defaults.keyUsages.map((usage) => (
+ <Badge key={usage} variant="neutral">
+ {formatKeyUsage(usage as CertKeyUsageType)}
+ </Badge>
+ ))}
+ </DetailValue>
+ </Detail>
+ )}
+ {defaults.extendedKeyUsages && defaults.extendedKeyUsages.length > 0 && (
+ <Detail>
+ <DetailLabel>Extended Key Usages</DetailLabel>
+ <DetailValue className="flex flex-wrap gap-1">
+ {defaults.extendedKeyUsages.map((usage) => (
+ <Badge key={usage} variant="neutral">
+ {formatExtendedKeyUsage(usage as CertExtendedKeyUsageType)}
+ </Badge>
+ ))}
+ </DetailValue>
+ </Detail>
+ )}
+ </div>
+ </div>
+ )}
+
+ {hasBasicConstraints && defaults.basicConstraints && (
+ <div className={sectionClassName()}>
+ <SectionHeader icon={<ScrollTextIcon />} title="Basic Constraints" />
+ <div className="grid grid-cols-2 gap-x-8 gap-y-4">
<Detail>
<DetailLabel>Is CA</DetailLabel>
<DetailValue>
@@ -132,55 +164,53 @@ export const ProfileDefaultsSection = ({ profile }: Props) => {
<DetailValue>{defaults.basicConstraints.pathLength}</DetailValue>
</Detail>
)}
- </>
- )}
-
- {hasSubjectDefaults && (
- <>
+ </div>
+ </div>
+ )}
+
+ {hasSubjectDefaults && (
+ <div className={sectionClassName()}>
+ <SectionHeader icon={<UserIcon />} title="Subject" />
+ <div className="grid grid-cols-2 gap-x-8 gap-y-4">
{defaults.commonName && (
<Detail>
<DetailLabel>Common Name (CN)</DetailLabel>
<DetailValue>{defaults.commonName}</DetailValue>
</Detail>
)}
-
{defaults.organization && (
<Detail>
<DetailLabel>Organization (O)</DetailLabel>
<DetailValue>{defaults.organization}</DetailValue>
</Detail>
)}
-
{defaults.organizationalUnit && (
<Detail>
<DetailLabel>Organizational Unit (OU)</DetailLabel>
<DetailValue>{defaults.organizationalUnit}</DetailValue>
</Detail>
)}
-
{defaults.country && (
<Detail>
<DetailLabel>Country (C)</DetailLabel>
<DetailValue>{defaults.country}</DetailValue>
</Detail>
)}
-
{defaults.state && (
<Detail>
<DetailLabel>State/Province (ST)</DetailLabel>
<DetailValue>{defaults.state}</DetailValue>
</Detail>
)}
-
{defaults.locality && (
<Detail>
<DetailLabel>Locality (L)</DetailLabel>
<DetailValue>{defaults.locality}</DetailValue>
</Detail>
)}
- </>
- )}
- </DetailGroup>
+ </div>
+ </div>
+ )}
</CardContent>
</Card>
);
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDetailsSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDetailsSection.tsx
deleted file mode 100644
index 1eda62779c..0000000000
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDetailsSection.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-import { format } from "date-fns";
-import { CheckIcon, ClipboardListIcon } from "lucide-react";
-
-import {
- Badge,
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue,
- IconButton,
- Tooltip,
- TooltipContent,
- TooltipTrigger
-} from "@app/components/v3";
-import { useTimedReset } from "@app/hooks";
-import {
- EnrollmentType,
- IssuerType,
- TCertificateProfileWithDetails
-} from "@app/hooks/api/certificateProfiles";
-
-type Props = {
- profile: TCertificateProfileWithDetails;
-};
-
-const enrollmentTypeLabels: Record<EnrollmentType, string> = {
- [EnrollmentType.API]: "API",
- [EnrollmentType.EST]: "EST",
- [EnrollmentType.ACME]: "ACME",
- [EnrollmentType.SCEP]: "SCEP"
-};
-
-const issuerTypeLabels: Record<IssuerType, string> = {
- [IssuerType.CA]: "Certificate Authority",
- [IssuerType.SELF_SIGNED]: "Self-Signed"
-};
-
-export const ProfileDetailsSection = ({ profile }: Props) => {
- const [, isCopyingId, setCopyTextId] = useTimedReset<string>({
- initialState: "Copy ID to clipboard"
- });
-
- return (
- <Card className="w-full">
- <CardHeader className="border-b">
- <CardTitle>Details</CardTitle>
- <CardDescription>Certificate profile details</CardDescription>
- </CardHeader>
- <CardContent>
- <DetailGroup>
- <Detail>
- <DetailLabel>Name</DetailLabel>
- <DetailValue>{profile.slug}</DetailValue>
- </Detail>
-
- <Detail>
- <DetailLabel>Profile ID</DetailLabel>
- <DetailValue className="flex items-center gap-x-1">
- <span className="break-all">{profile.id}</span>
- <Tooltip>
- <TooltipTrigger asChild>
- <IconButton
- variant="ghost"
- size="xs"
- onClick={() => {
- navigator.clipboard.writeText(profile.id);
- setCopyTextId("Copied");
- }}
- >
- {isCopyingId ? <CheckIcon /> : <ClipboardListIcon className="text-label" />}
- </IconButton>
- </TooltipTrigger>
- <TooltipContent>{isCopyingId ? "Copied" : "Copy ID to clipboard"}</TooltipContent>
- </Tooltip>
- </DetailValue>
- </Detail>
-
- {profile.description && (
- <Detail>
- <DetailLabel>Description</DetailLabel>
- <DetailValue>{profile.description}</DetailValue>
- </Detail>
- )}
-
- <Detail>
- <DetailLabel>Enrollment Type</DetailLabel>
- <DetailValue>
- <Badge variant="info">{enrollmentTypeLabels[profile.enrollmentType]}</Badge>
- </DetailValue>
- </Detail>
-
- <Detail>
- <DetailLabel>Issuer Type</DetailLabel>
- <DetailValue>
- <Badge
- variant={profile.issuerType === IssuerType.SELF_SIGNED ? "warning" : "neutral"}
- >
- {issuerTypeLabels[profile.issuerType]}
- </Badge>
- </DetailValue>
- </Detail>
-
- {profile.createdAt && (
- <Detail>
- <DetailLabel>Created</DetailLabel>
- <DetailValue>
- {format(new Date(profile.createdAt), "MMM d, yyyy 'at' h:mm a")}
- </DetailValue>
- </Detail>
- )}
-
- {profile.updatedAt && (
- <Detail>
- <DetailLabel>Last Updated</DetailLabel>
- <DetailValue>
- {format(new Date(profile.updatedAt), "MMM d, yyyy 'at' h:mm a")}
- </DetailValue>
- </Detail>
- )}
- </DetailGroup>
- </CardContent>
- </Card>
- );
-};
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileIssuerSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileIssuerSection.tsx
deleted file mode 100644
index 88903129e6..0000000000
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileIssuerSection.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { Link } from "@tanstack/react-router";
-import { ExternalLinkIcon } from "lucide-react";
-
-import {
- Badge,
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue
-} from "@app/components/v3";
-import { useOrganization, useProject } from "@app/context";
-import { useGetInternalCaById } from "@app/hooks/api/ca/queries";
-import { IssuerType, TCertificateProfileWithDetails } from "@app/hooks/api/certificateProfiles";
-
-type Props = {
- profile: TCertificateProfileWithDetails;
-};
-
-export const ProfileIssuerSection = ({ profile }: Props) => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
-
- const isSelfSigned = profile.issuerType === IssuerType.SELF_SIGNED;
- const isInternalCa = !isSelfSigned && !profile.certificateAuthority?.isExternal;
-
- const { data: internalCa } = useGetInternalCaById(
- isInternalCa && profile.caId ? profile.caId : ""
- );
-
- return (
- <Card className="mt-4 w-full">
- <CardHeader className="border-b">
- <CardTitle>Issuer</CardTitle>
- <CardDescription>Where certificates issued through this profile are signed</CardDescription>
- </CardHeader>
- <CardContent>
- <DetailGroup>
- {isSelfSigned ? (
- <Detail>
- <DetailLabel>Issuer</DetailLabel>
- <DetailValue>
- <Badge variant="warning">Self-Signed</Badge>
- </DetailValue>
- </Detail>
- ) : (
- <>
- <Detail>
- <DetailLabel>Source</DetailLabel>
- <DetailValue>
- <Badge variant="neutral">
- {profile.certificateAuthority?.isExternal
- ? "External CA"
- : "Internal CA"}
- </Badge>
- </DetailValue>
- </Detail>
-
- <Detail className="min-w-0">
- <DetailLabel>Certificate Authority</DetailLabel>
- <DetailValue className="flex min-w-0 max-w-full">
- {isInternalCa && profile.caId ? (
- <Badge variant="neutral" isTruncatable className="max-w-full" asChild>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id,
- caId: profile.caId
- }}
- search={{ from: "profile", profileId: profile.id }}
- >
- <span className="min-w-0">
- {internalCa?.configuration?.friendlyName ||
- internalCa?.configuration?.commonName ||
- profile.caId}
- </span>
- <ExternalLinkIcon />
- </Link>
- </Badge>
- ) : (
- <span className="min-w-0 break-all">
- {profile.certificateAuthority?.name || "N/A"}
- </span>
- )}
- </DetailValue>
- </Detail>
-
- {profile.certificateAuthority?.isExternal &&
- profile.certificateAuthority.externalType && (
- <Detail>
- <DetailLabel>External Type</DetailLabel>
- <DetailValue>
- <Badge variant="info">{profile.certificateAuthority.externalType}</Badge>
- </DetailValue>
- </Detail>
- )}
- </>
- )}
- </DetailGroup>
- </CardContent>
- </Card>
- );
-};
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx
new file mode 100644
index 0000000000..b4d4d85d71
--- /dev/null
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx
@@ -0,0 +1,268 @@
+import { subject } from "@casl/ability";
+import { Link } from "@tanstack/react-router";
+import { format } from "date-fns";
+import { CheckIcon, ClipboardListIcon, EllipsisIcon, ExternalLinkIcon } from "lucide-react";
+
+import { ProjectPermissionCan } from "@app/components/permissions";
+import {
+ Badge,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Detail,
+ DetailGroup,
+ DetailLabel,
+ DetailValue,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+ IconButton,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
+import { useOrganization, useProject } from "@app/context";
+import {
+ ProjectPermissionCertificateProfileActions,
+ ProjectPermissionSub
+} from "@app/context/ProjectPermissionContext/types";
+import { useTimedReset } from "@app/hooks";
+import { EXTERNAL_CA_TYPE_NAME_MAP } from "@app/hooks/api/ca/constants";
+import { useGetInternalCaById } from "@app/hooks/api/ca/queries";
+import { IssuerType, TCertificateProfileWithDetails } from "@app/hooks/api/certificateProfiles";
+
+type Props = {
+ profile: TCertificateProfileWithDetails;
+ onEdit: () => void;
+ onDelete: () => void;
+ backContext: {
+ from?: "settings" | "application";
+ applicationName?: string;
+ };
+};
+
+export const ProfileOverviewSection = ({ profile, onEdit, onDelete, backContext }: Props) => {
+ const { currentOrg } = useOrganization();
+ const { currentProject } = useProject();
+ const [, isCopyingId, setCopyTextId] = useTimedReset<string>({
+ initialState: "Copy ID to clipboard"
+ });
+
+ const isSelfSigned = profile.issuerType === IssuerType.SELF_SIGNED;
+ const isInternalCa = !isSelfSigned && !profile.certificateAuthority?.isExternal;
+
+ const { data: internalCa } = useGetInternalCaById(
+ isInternalCa && profile.caId ? profile.caId : ""
+ );
+
+ return (
+ <Card className="w-full">
+ <CardHeader className="border-b">
+ <CardTitle>Details</CardTitle>
+ <CardDescription>Certificate profile details</CardDescription>
+ <CardAction>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="outline" size="xs" aria-label="Profile options">
+ <EllipsisIcon />
+ </IconButton>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <ProjectPermissionCan
+ I={ProjectPermissionCertificateProfileActions.Edit}
+ a={subject(ProjectPermissionSub.CertificateProfiles, { slug: profile.slug })}
+ >
+ {(canEdit) => (
+ <DropdownMenuItem isDisabled={!canEdit} onClick={onEdit}>
+ Edit Profile
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ <ProjectPermissionCan
+ I={ProjectPermissionCertificateProfileActions.Delete}
+ a={subject(ProjectPermissionSub.CertificateProfiles, { slug: profile.slug })}
+ >
+ {(canDelete) => (
+ <DropdownMenuItem variant="danger" isDisabled={!canDelete} onClick={onDelete}>
+ Delete Profile
+ </DropdownMenuItem>
+ )}
+ </ProjectPermissionCan>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </CardAction>
+ </CardHeader>
+ <CardContent>
+ <DetailGroup>
+ <Detail>
+ <DetailLabel>Name</DetailLabel>
+ <DetailValue>{profile.slug}</DetailValue>
+ </Detail>
+
+ <Detail>
+ <DetailLabel>Profile ID</DetailLabel>
+ <DetailValue className="flex items-center gap-x-1">
+ <span className="break-all">{profile.id}</span>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <IconButton
+ variant="ghost"
+ size="xs"
+ aria-label="Copy profile ID"
+ onClick={() => {
+ navigator.clipboard.writeText(profile.id);
+ setCopyTextId("Copied");
+ }}
+ >
+ {isCopyingId ? <CheckIcon /> : <ClipboardListIcon className="text-label" />}
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent>{isCopyingId ? "Copied" : "Copy ID to clipboard"}</TooltipContent>
+ </Tooltip>
+ </DetailValue>
+ </Detail>
+
+ {profile.description && (
+ <Detail>
+ <DetailLabel>Description</DetailLabel>
+ <DetailValue>{profile.description}</DetailValue>
+ </Detail>
+ )}
+
+ {profile.createdAt && (
+ <Detail>
+ <DetailLabel>Created</DetailLabel>
+ <DetailValue>
+ {format(new Date(profile.createdAt), "MMM d, yyyy 'at' h:mm a")}
+ </DetailValue>
+ </Detail>
+ )}
+
+ {profile.updatedAt && (
+ <Detail>
+ <DetailLabel>Last Updated</DetailLabel>
+ <DetailValue>
+ {format(new Date(profile.updatedAt), "MMM d, yyyy 'at' h:mm a")}
+ </DetailValue>
+ </Detail>
+ )}
+ </DetailGroup>
+
+ <div className="mt-6 border-t border-border pt-6">
+ <h3 className="mb-4 text-base font-semibold text-foreground">Issuer</h3>
+ <DetailGroup>
+ {isSelfSigned ? (
+ <Detail>
+ <DetailLabel>Source</DetailLabel>
+ <DetailValue>
+ <Badge variant="neutral">Self-Signed</Badge>
+ </DetailValue>
+ </Detail>
+ ) : (
+ <>
+ <Detail>
+ <DetailLabel>Source</DetailLabel>
+ <DetailValue>
+ <Badge variant="neutral">
+ {profile.certificateAuthority?.isExternal ? "External CA" : "Internal CA"}
+ </Badge>
+ </DetailValue>
+ </Detail>
+
+ {profile.certificateAuthority?.isExternal &&
+ profile.certificateAuthority.externalType && (
+ <Detail>
+ <DetailLabel>External Type</DetailLabel>
+ <DetailValue>
+ <Badge variant="info">
+ {EXTERNAL_CA_TYPE_NAME_MAP[profile.certificateAuthority.externalType] ||
+ profile.certificateAuthority.externalType}
+ </Badge>
+ </DetailValue>
+ </Detail>
+ )}
+
+ <Detail className="min-w-0">
+ <DetailLabel>Certificate Authority</DetailLabel>
+ <DetailValue className="min-w-0">
+ {isInternalCa && profile.caId ? (
+ <Link
+ to="/organizations/$orgId/projects/cert-manager/$projectId/ca/$caId"
+ params={{
+ orgId: currentOrg.id,
+ projectId: currentProject.id,
+ caId: profile.caId
+ }}
+ search={{
+ from: "profile",
+ profileId: profile.id,
+ profileFrom: backContext.from,
+ profileApplicationName: backContext.applicationName
+ }}
+ className="flex max-w-full items-center gap-x-1 text-mineshaft-200 hover:underline"
+ >
+ <span className="min-w-0 truncate">
+ {internalCa?.name ||
+ internalCa?.configuration?.friendlyName ||
+ internalCa?.configuration?.commonName ||
+ profile.caId}
+ </span>
+ <ExternalLinkIcon className="size-3.5 shrink-0" />
+ </Link>
+ ) : (
+ <span className="break-all">
+ {profile.certificateAuthority?.name || "N/A"}
+ </span>
+ )}
+ </DetailValue>
+ </Detail>
+ </>
+ )}
+ </DetailGroup>
+ </div>
+
+ <div className="mt-6 border-t border-border pt-6">
+ <h3 className="mb-4 text-base font-semibold text-foreground">Certificate Policy</h3>
+ <DetailGroup>
+ <Detail className="min-w-0">
+ <DetailLabel>Policy</DetailLabel>
+ <DetailValue className="min-w-0">
+ <Link
+ to="/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId"
+ params={{
+ orgId: currentOrg.id,
+ projectId: currentProject.id,
+ policyId: profile.certificatePolicyId
+ }}
+ search={{
+ from: "profile",
+ profileId: profile.id,
+ profileFrom: backContext.from,
+ profileApplicationName: backContext.applicationName
+ }}
+ className="flex max-w-full items-center gap-x-1 text-mineshaft-200 hover:underline"
+ >
+ <span className="min-w-0 truncate">
+ {profile.certificatePolicy?.name || profile.certificatePolicyId}
+ </span>
+ <ExternalLinkIcon className="size-3.5 shrink-0" />
+ </Link>
+ </DetailValue>
+ </Detail>
+
+ {profile.certificatePolicy?.description && (
+ <Detail>
+ <DetailLabel>Description</DetailLabel>
+ <DetailValue>{profile.certificatePolicy.description}</DetailValue>
+ </Detail>
+ )}
+ </DetailGroup>
+ </div>
+ </CardContent>
+ </Card>
+ );
+};
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfilePolicySection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfilePolicySection.tsx
deleted file mode 100644
index 108fc12164..0000000000
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfilePolicySection.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Link } from "@tanstack/react-router";
-import { ExternalLinkIcon } from "lucide-react";
-
-import {
- Badge,
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue
-} from "@app/components/v3";
-import { useOrganization, useProject } from "@app/context";
-import { TCertificateProfileWithDetails } from "@app/hooks/api/certificateProfiles";
-
-type Props = {
- profile: TCertificateProfileWithDetails;
-};
-
-export const ProfilePolicySection = ({ profile }: Props) => {
- const { currentOrg } = useOrganization();
- const { currentProject } = useProject();
-
- return (
- <Card className="mt-4 w-full">
- <CardHeader className="border-b">
- <CardTitle>Certificate Policy</CardTitle>
- <CardDescription>Rules applied to certificates issued by this profile</CardDescription>
- </CardHeader>
- <CardContent>
- <DetailGroup>
- <Detail className="min-w-0">
- <DetailLabel>Policy</DetailLabel>
- <DetailValue className="flex min-w-0 max-w-full">
- <Badge variant="neutral" isTruncatable className="max-w-full" asChild>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id,
- policyId: profile.certificatePolicyId
- }}
- search={{ from: "profile", profileId: profile.id }}
- >
- <span className="min-w-0">
- {profile.certificatePolicy?.name || profile.certificatePolicyId}
- </span>
- <ExternalLinkIcon />
- </Link>
- </Badge>
- </DetailValue>
- </Detail>
-
- {profile.certificatePolicy?.description && (
- <Detail>
- <DetailLabel>Description</DetailLabel>
- <DetailValue>{profile.certificatePolicy.description}</DetailValue>
- </Detail>
- )}
- </DetailGroup>
- </CardContent>
- </Card>
- );
-};
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/index.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/index.tsx
index 63966e9d7e..e0dc0f859b 100644
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/index.tsx
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/index.tsx
@@ -1,4 +1,2 @@
export { ProfileDefaultsSection } from "./ProfileDefaultsSection";
-export { ProfileDetailsSection } from "./ProfileDetailsSection";
-export { ProfileIssuerSection } from "./ProfileIssuerSection";
-export { ProfilePolicySection } from "./ProfilePolicySection";
+export { ProfileOverviewSection } from "./ProfileOverviewSection";
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx
index a66d7f27ae..019a1d8e76 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx
@@ -1,30 +1,23 @@
import { useCallback } from "react";
import { subject } from "@casl/ability";
-import {
- faCheck,
- faCircleInfo,
- faCopy,
- faEdit,
- faEllipsis,
- faTrash
-} from "@fortawesome/free-solid-svg-icons";
+import { faCircleInfo } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link } from "@tanstack/react-router";
+import { CheckIcon, CopyIcon, MoreHorizontalIcon, PencilIcon, Trash2Icon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
+import { Tooltip } from "@app/components/v2";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip
-} from "@app/components/v2";
-import {
Empty,
EmptyDescription,
EmptyHeader,
EmptyTitle,
+ IconButton,
Skeleton,
Table,
TableBody,
@@ -123,7 +116,7 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {
projectId: currentProject.id,
policyId: policy.id
}}
- className="text-mineshaft-200 hover:text-primary-400"
+ className="text-mineshaft-200 hover:underline"
>
{policy.name}
</Link>
@@ -135,25 +128,23 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {
</div>
</TableCell>
<TableCell>
- <span className="text-sm text-accent">{formatDate(policy.createdAt)}</span>
+ <span className="text-sm text-mineshaft-200">{formatDate(policy.createdAt)}</span>
</TableCell>
<TableCell className="text-right">
<DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">
- <Tooltip content="More options">
- <FontAwesomeIcon size="lg" icon={faEllipsis} />
- </Tooltip>
- </div>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs" aria-label="Policy actions">
+ <MoreHorizontalIcon />
+ </IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
<DropdownMenuItem
onClick={(e) => {
e.stopPropagation();
handleCopyId(policy.id);
}}
- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} />}
>
+ {isIdCopied ? <CheckIcon /> : <CopyIcon />}
Copy Policy ID
</DropdownMenuItem>
<ProjectPermissionCan
@@ -169,8 +160,8 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {
e.stopPropagation();
onEditPolicy(policy);
}}
- icon={<FontAwesomeIcon icon={faEdit} />}
>
+ <PencilIcon />
Edit Policy
</DropdownMenuItem>
)
@@ -185,12 +176,13 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {
{(isAllowed) =>
isAllowed && (
<DropdownMenuItem
+ variant="danger"
onClick={(e) => {
e.stopPropagation();
onDeletePolicy(policy);
}}
- icon={<FontAwesomeIcon icon={faTrash} />}
>
+ <Trash2Icon />
Delete Policy
</DropdownMenuItem>
)
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx
index dc2f492aaf..e7e945e8bb 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx
@@ -1,27 +1,23 @@
/* eslint-disable no-nested-ternary */
import { useCallback } from "react";
import { subject } from "@casl/ability";
-import {
- faCheck,
- faCircleInfo,
- faCopy,
- faEdit,
- faEllipsis,
- faTrash
-} from "@fortawesome/free-solid-svg-icons";
+import { faCircleInfo } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link } from "@tanstack/react-router";
+import { CheckIcon, CopyIcon, MoreHorizontalIcon, PencilIcon, Trash2Icon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
+import { Tooltip } from "@app/components/v2";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- Tooltip
-} from "@app/components/v2";
-import { TableCell, TableRow } from "@app/components/v3";
+ IconButton,
+ TableCell,
+ TableRow
+} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import {
ProjectPermissionCertificateProfileActions,
@@ -73,7 +69,7 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
projectId: currentProject.id,
profileId: profile.id
}}
- className="text-mineshaft-300 hover:text-primary-400"
+ className="text-mineshaft-200 hover:underline"
>
{profile.slug}
</Link>
@@ -85,7 +81,7 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
</div>
</TableCell>
<TableCell className="text-start">
- <span className="text-sm text-mineshaft-300">
+ <span className="text-sm text-mineshaft-200">
{profile.issuerType === IssuerType.SELF_SIGNED
? "Self-signed"
: profile.certificateAuthority?.isExternal
@@ -103,25 +99,21 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
projectId: currentProject.id,
policyId: profile.certificatePolicyId
}}
- className="text-sm text-mineshaft-300 hover:text-primary-400"
+ className="text-sm text-mineshaft-200 hover:underline"
>
{policyData?.name || profile.certificatePolicyId}
</Link>
</TableCell>
<TableCell className="text-right">
<DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="hover:text-primary-400 data-[state=open]:text-primary-400">
- <Tooltip content="More options">
- <FontAwesomeIcon size="lg" icon={faEllipsis} />
- </Tooltip>
- </div>
+ <DropdownMenuTrigger asChild>
+ <IconButton variant="ghost" size="xs" aria-label="Profile actions">
+ <MoreHorizontalIcon />
+ </IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-1">
- <DropdownMenuItem
- icon={<FontAwesomeIcon icon={isIdCopied ? faCheck : faCopy} className="w-3" />}
- onClick={() => handleCopyId()}
- >
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
+ <DropdownMenuItem onClick={() => handleCopyId()}>
+ {isIdCopied ? <CheckIcon /> : <CopyIcon />}
Copy Profile ID
</DropdownMenuItem>
<ProjectPermissionCan
@@ -135,8 +127,8 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
e.stopPropagation();
onEditProfile(profile);
}}
- icon={<FontAwesomeIcon icon={faEdit} className="w-3" />}
>
+ <PencilIcon />
Edit Profile
</DropdownMenuItem>
)
@@ -149,12 +141,13 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
{(isAllowed) =>
isAllowed && (
<DropdownMenuItem
+ variant="danger"
onClick={(e) => {
e.stopPropagation();
onDeleteProfile(profile);
}}
- icon={<FontAwesomeIcon icon={faTrash} className="w-3" />}
>
+ <Trash2Icon />
Delete Profile
</DropdownMenuItem>
)