Skip to content

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

UI improvements

Carlos Monastyrski49adce1f1c1a
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
index 9f3b4de733..c5c784c2c6 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/CertManagerNav.tsx
@@ -108,8 +108,24 @@ export const CertManagerNav = ({
}
];
+ const detailPathRegex = /\/(certificate-profiles|certificate-policies|ca)\//;
+
+ const isApplicationSourcedDetail = (
+ pathname: string,
+ search: Record<string, unknown>
+ ): boolean => {
+ if (!detailPathRegex.test(pathname)) return false;
+ const { from, profileFrom } = search as { from?: string; profileFrom?: string };
+ return from === "application" || (from === "profile" && profileFrom === "application");
+ };
+
const applicationItems: NavItem[] = [
- { label: "Applications", icon: ResourceIcon, pathSuffix: "applications" }
+ {
+ label: "Applications",
+ icon: ResourceIcon,
+ pathSuffix: "applications",
+ activeMatch: (pathname, search) => isApplicationSourcedDetail(pathname, search)
+ }
];
const codeSigningItems: NavItem[] = [
@@ -150,7 +166,9 @@ export const CertManagerNav = ({
{
label: "Settings",
icon: Settings,
- pathSuffix: "settings"
+ pathSuffix: "settings",
+ activeMatch: (pathname, search) =>
+ detailPathRegex.test(pathname) && !isApplicationSourcedDetail(pathname, search)
}
];
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx
index bddbfc0cc6..500300b98a 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNavLink.tsx
@@ -25,7 +25,14 @@ export const ProjectNavLink = ({
const basePath = `/organizations/${currentOrg.id}/projects/${typePath}/${currentProject.id}`;
const fullPath = `${basePath}/${item.pathSuffix}`;
- const pathMatch = pathname.startsWith(fullPath) || Boolean(item.activeMatch?.test(pathname));
+ const activeMatchResult = (() => {
+ if (!item.activeMatch) return false;
+ if (typeof item.activeMatch === "function") {
+ return item.activeMatch(pathname, (locationSearch as Record<string, unknown>) ?? {});
+ }
+ return item.activeMatch.test(pathname);
+ })();
+ const pathMatch = pathname.startsWith(fullPath) || activeMatchResult;
const isActive = item.search
? pathMatch &&
Object.entries(item.search).every(([key, value]) => {
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts
index 181d781cbe..653ffb7f1e 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/types.ts
@@ -32,7 +32,7 @@ export type NavItem = {
label: string;
icon: React.ComponentType<{ className?: string }>;
pathSuffix: string;
- activeMatch?: RegExp;
+ activeMatch?: RegExp | ((pathname: string, search: Record<string, unknown>) => boolean);
badgeCount?: number;
hidden?: boolean;
submenu?: Submenu;
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index c86214b5b1..6555618555 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:underline"
+ className="hover:underline"
>
{p.profileSlug}
</Link>
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
index f57d7b8d72..967b57fd98 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyDetailsSection.tsx
@@ -1,6 +1,6 @@
import { subject } from "@casl/ability";
import { format } from "date-fns";
-import { CheckIcon, ClipboardListIcon, EllipsisIcon } from "lucide-react";
+import { CheckIcon, ClipboardListIcon, EllipsisIcon, PencilIcon, Trash2Icon } from "lucide-react";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
@@ -49,17 +49,18 @@ export const PolicyDetailsSection = ({ policy, onEdit, onDelete }: Props) => {
<CardAction>
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <IconButton variant="outline" size="xs" aria-label="Policy options">
+ <IconButton variant="ghost" size="xs" aria-label="Policy options">
<EllipsisIcon />
</IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end">
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
<ProjectPermissionCan
I={ProjectPermissionCertificatePolicyActions.Edit}
a={subject(ProjectPermissionSub.CertificatePolicies, { name: policy.name })}
>
{(canEdit) => (
<DropdownMenuItem isDisabled={!canEdit} onClick={onEdit}>
+ <PencilIcon />
Edit Policy
</DropdownMenuItem>
)}
@@ -70,6 +71,7 @@ export const PolicyDetailsSection = ({ policy, onEdit, onDelete }: Props) => {
>
{(canDelete) => (
<DropdownMenuItem variant="danger" isDisabled={!canDelete} onClick={onDelete}>
+ <Trash2Icon />
Delete Policy
</DropdownMenuItem>
)}
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyKeyUsagesSection.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyKeyUsagesSection.tsx
index b76ddea61c..da296a21ae 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyKeyUsagesSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicyKeyUsagesSection.tsx
@@ -1,14 +1,10 @@
import {
- Badge,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue
+ DetailGroup
} from "@app/components/v3";
import { TCertificatePolicy } from "@app/hooks/api/certificatePolicies";
import {
@@ -18,34 +14,12 @@ import {
formatKeyUsage
} from "@app/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/shared/certificate-constants";
+import { RuleList } from "./RuleList";
+
type Props = {
policy: TCertificatePolicy;
};
-const RuleList = ({
- label,
- values,
- formatter
-}: {
- label: string;
- values?: string[];
- formatter: (value: string) => string;
-}) => {
- if (!values || values.length === 0) return null;
- return (
- <Detail>
- <DetailLabel>{label}</DetailLabel>
- <DetailValue className="flex flex-wrap gap-1">
- {values.map((value) => (
- <Badge key={`${label}-${value}`} variant="neutral">
- {formatter(value)}
- </Badge>
- ))}
- </DetailValue>
- </Detail>
- );
-};
-
export const PolicyKeyUsagesSection = ({ policy }: Props) => {
const ku = policy.keyUsages;
const eku = policy.extendedKeyUsages;
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySansRulesSection.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySansRulesSection.tsx
index 6a40551fb2..3a01dc752a 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySansRulesSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySansRulesSection.tsx
@@ -1,14 +1,10 @@
import {
- Badge,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue
+ DetailGroup
} from "@app/components/v3";
import { TCertificatePolicy } from "@app/hooks/api/certificatePolicies";
import {
@@ -16,26 +12,12 @@ import {
formatSANType
} from "@app/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/shared/certificate-constants";
+import { RuleList } from "./RuleList";
+
type Props = {
policy: TCertificatePolicy;
};
-const RuleList = ({ label, values }: { label: string; values?: string[] }) => {
- if (!values || values.length === 0) return null;
- return (
- <Detail>
- <DetailLabel>{label}</DetailLabel>
- <DetailValue className="flex flex-wrap gap-1">
- {values.map((value) => (
- <Badge key={`${label}-${value}`} variant="neutral">
- {value}
- </Badge>
- ))}
- </DetailValue>
- </Detail>
- );
-};
-
export const PolicySansRulesSection = ({ policy }: Props) => {
const entries = (policy.sans ?? []).filter(
(rule) =>
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySubjectRulesSection.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySubjectRulesSection.tsx
index d0793f4897..b4b61eae60 100644
--- a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySubjectRulesSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/PolicySubjectRulesSection.tsx
@@ -1,14 +1,10 @@
import {
- Badge,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
- Detail,
- DetailGroup,
- DetailLabel,
- DetailValue
+ DetailGroup
} from "@app/components/v3";
import { TCertificatePolicy } from "@app/hooks/api/certificatePolicies";
import {
@@ -16,26 +12,12 @@ import {
formatSubjectAttributeType
} from "@app/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/shared/certificate-constants";
+import { RuleList } from "./RuleList";
+
type Props = {
policy: TCertificatePolicy;
};
-const RuleList = ({ label, values }: { label: string; values?: string[] }) => {
- if (!values || values.length === 0) return null;
- return (
- <Detail>
- <DetailLabel>{label}</DetailLabel>
- <DetailValue className="flex flex-wrap gap-1">
- {values.map((value) => (
- <Badge key={`${label}-${value}`} variant="neutral">
- {value}
- </Badge>
- ))}
- </DetailValue>
- </Detail>
- );
-};
-
export const PolicySubjectRulesSection = ({ policy }: Props) => {
const entries = (policy.subject ?? []).filter(
(rule) =>
diff --git a/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/RuleList.tsx b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/RuleList.tsx
new file mode 100644
index 0000000000..59023b93e0
--- /dev/null
+++ b/frontend/src/pages/cert-manager/CertificatePolicyDetailsByIDPage/components/RuleList.tsx
@@ -0,0 +1,24 @@
+import { Badge, Detail, DetailLabel, DetailValue } from "@app/components/v3";
+
+type Props = {
+ label: string;
+ values?: string[];
+ formatter?: (value: string) => string;
+};
+
+export const RuleList = ({ label, values, formatter }: Props) => {
+ if (!values || values.length === 0) return null;
+
+ return (
+ <Detail>
+ <DetailLabel>{label}</DetailLabel>
+ <DetailValue className="flex flex-wrap gap-1">
+ {values.map((value) => (
+ <Badge key={`${label}-${value}`} variant="neutral">
+ {formatter ? formatter(value) : value}
+ </Badge>
+ ))}
+ </DetailValue>
+ </Detail>
+ );
+};
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
index 9174fd46bc..01eb666802 100644
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileDefaultsSection.tsx
@@ -9,7 +9,11 @@ import {
CardTitle,
Detail,
DetailLabel,
- DetailValue
+ DetailValue,
+ Empty,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyTitle
} from "@app/components/v3";
import { TCertificateProfileWithDetails } from "@app/hooks/api/certificateProfiles";
import {
@@ -64,7 +68,14 @@ export const ProfileDefaultsSection = ({ profile }: Props) => {
<CardDescription>Values applied when issuing certificates</CardDescription>
</CardHeader>
<CardContent>
- <div className="text-sm text-label">No defaults configured for this profile.</div>
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>No defaults configured</EmptyTitle>
+ <EmptyDescription>
+ This profile has no default values applied when issuing certificates.
+ </EmptyDescription>
+ </EmptyHeader>
+ </Empty>
</CardContent>
</Card>
);
diff --git a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx
index b4d4d85d71..e58969406e 100644
--- a/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateProfileDetailsByIDPage/components/ProfileOverviewSection.tsx
@@ -1,7 +1,14 @@
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 {
+ CheckIcon,
+ ClipboardListIcon,
+ EllipsisIcon,
+ ExternalLinkIcon,
+ PencilIcon,
+ Trash2Icon
+} from "lucide-react";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
@@ -67,17 +74,18 @@ export const ProfileOverviewSection = ({ profile, onEdit, onDelete, backContext
<CardAction>
<DropdownMenu>
<DropdownMenuTrigger asChild>
- <IconButton variant="outline" size="xs" aria-label="Profile options">
+ <IconButton variant="ghost" size="xs" aria-label="Profile options">
<EllipsisIcon />
</IconButton>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end">
+ <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
<ProjectPermissionCan
I={ProjectPermissionCertificateProfileActions.Edit}
a={subject(ProjectPermissionSub.CertificateProfiles, { slug: profile.slug })}
>
{(canEdit) => (
<DropdownMenuItem isDisabled={!canEdit} onClick={onEdit}>
+ <PencilIcon />
Edit Profile
</DropdownMenuItem>
)}
@@ -88,6 +96,7 @@ export const ProfileOverviewSection = ({ profile, onEdit, onDelete, backContext
>
{(canDelete) => (
<DropdownMenuItem variant="danger" isDisabled={!canDelete} onClick={onDelete}>
+ <Trash2Icon />
Delete Profile
</DropdownMenuItem>
)}
@@ -203,7 +212,7 @@ export const ProfileOverviewSection = ({ profile, onEdit, onDelete, backContext
profileFrom: backContext.from,
profileApplicationName: backContext.applicationName
}}
- className="flex max-w-full items-center gap-x-1 text-mineshaft-200 hover:underline"
+ className="flex max-w-full items-center gap-x-1 hover:underline"
>
<span className="min-w-0 truncate">
{internalCa?.name ||
@@ -244,7 +253,7 @@ export const ProfileOverviewSection = ({ profile, onEdit, onDelete, backContext
profileFrom: backContext.from,
profileApplicationName: backContext.applicationName
}}
- className="flex max-w-full items-center gap-x-1 text-mineshaft-200 hover:underline"
+ className="flex max-w-full items-center gap-x-1 hover:underline"
>
<span className="min-w-0 truncate">
{profile.certificatePolicy?.name || profile.certificatePolicyId}
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 019a1d8e76..e515ef488c 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/PolicyList.tsx
@@ -1,13 +1,17 @@
import { useCallback } from "react";
import { subject } from "@casl/ability";
-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 {
+ CheckIcon,
+ CopyIcon,
+ InfoIcon,
+ 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,
@@ -24,7 +28,10 @@ import {
TableCell,
TableHead,
TableHeader,
- TableRow
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import {
@@ -116,19 +123,22 @@ export const PolicyList = ({ onEditPolicy, onDeletePolicy }: Props) => {
projectId: currentProject.id,
policyId: policy.id
}}
- className="text-mineshaft-200 hover:underline"
+ className="hover:underline"
>
{policy.name}
</Link>
{policy.description && (
- <Tooltip content={policy.description}>
- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <InfoIcon className="size-3.5 text-muted" />
+ </TooltipTrigger>
+ <TooltipContent>{policy.description}</TooltipContent>
</Tooltip>
)}
</div>
</TableCell>
<TableCell>
- <span className="text-sm text-mineshaft-200">{formatDate(policy.createdAt)}</span>
+ <span className="text-sm">{formatDate(policy.createdAt)}</span>
</TableCell>
<TableCell className="text-right">
<DropdownMenu>
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 e7e945e8bb..f4e38a640b 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificateProfilesTab/ProfileRow.tsx
@@ -1,14 +1,18 @@
/* eslint-disable no-nested-ternary */
import { useCallback } from "react";
import { subject } from "@casl/ability";
-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 {
+ CheckIcon,
+ CopyIcon,
+ InfoIcon,
+ 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,
@@ -16,7 +20,10 @@ import {
DropdownMenuTrigger,
IconButton,
TableCell,
- TableRow
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
} from "@app/components/v3";
import { useOrganization, useProject } from "@app/context";
import {
@@ -69,19 +76,22 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
projectId: currentProject.id,
profileId: profile.id
}}
- className="text-mineshaft-200 hover:underline"
+ className="hover:underline"
>
{profile.slug}
</Link>
{profile.description && (
- <Tooltip content={profile.description}>
- <FontAwesomeIcon icon={faCircleInfo} className="text-mineshaft-400" />
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <InfoIcon className="size-3.5 text-muted" />
+ </TooltipTrigger>
+ <TooltipContent>{profile.description}</TooltipContent>
</Tooltip>
)}
</div>
</TableCell>
<TableCell className="text-start">
- <span className="text-sm text-mineshaft-200">
+ <span className="text-sm">
{profile.issuerType === IssuerType.SELF_SIGNED
? "Self-signed"
: profile.certificateAuthority?.isExternal
@@ -99,7 +109,7 @@ export const ProfileRow = ({ profile, onEditProfile, onDeleteProfile }: Props) =
projectId: currentProject.id,
policyId: profile.certificatePolicyId
}}
- className="text-sm text-mineshaft-200 hover:underline"
+ className="text-sm hover:underline"
>
{policyData?.name || profile.certificatePolicyId}
</Link>