Skip to content

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

misc: addressed feedback

Sheen Capadngan52b6316075a2
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index 1c021e004f..87addfee61 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -496,8 +496,10 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
.map((p) => ({ value: p.id, label: p.slug })),
[profileList, attachedIds]
);
- const totalProfileCount = profileList?.certificateProfiles?.length ?? 0;
- const hasAttachableProfiles = availableProfiles.length > 0;
+ // Project-wide count, not the length of the fetched page. The list is paginated, so a page whose
+ // profiles happen to all be attached says nothing about whether the project has others left.
+ const totalProfileCount = profileList?.totalCount ?? 0;
+ const hasAttachableProfiles = totalProfileCount > profiles.length;
let attachDisabledReason: ReactNode | null = null;
if (!hasAttachableProfiles && !canCreateProfile) {
attachDisabledReason =
@@ -512,14 +514,17 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
(menuProps: MenuListProps<TProfileOption, true>) => (
<>
{canCreateProfile ? (
- <button
+ <Button
type="button"
+ variant="ghost"
+ size="sm"
+ isFullWidth
+ className="justify-start"
onClick={() => setIsCreateProfileOpen(true)}
- className="flex w-full cursor-pointer items-center gap-x-1.5 rounded-sm px-2 py-1.5 text-sm text-muted hover:bg-foreground/5"
>
- <PlusIcon className="size-4 shrink-0" />
+ <PlusIcon />
Add Certificate Profile
- </button>
+ </Button>
) : null}
<components.MenuList {...menuProps} />
</>
diff --git a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
index 3c71a1cebe..33db385272 100644
--- a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
@@ -25,6 +25,7 @@ import {
codeSigningScopeFieldLabels,
MONOSPACED_SCOPE_FIELDS
} from "@app/hooks/api/signers";
+import { ApplicationTab } from "@app/pages/cert-manager/ApplicationDetailsByIDPage/application-tabs";
import {
ApprovalStepsSection,
@@ -165,7 +166,7 @@ const PageContent = () => {
projectId: currentProject.id,
applicationName
},
- search: { selectedTab: "requests" }
+ search: { selectedTab: ApplicationTab.Requests }
});
return;
}
@@ -331,7 +332,7 @@ const PageContent = () => {
projectId: currentProject.id,
applicationName
}}
- search={{ selectedTab: "requests" }}
+ search={{ selectedTab: ApplicationTab.Requests }}
className={linkClass}
>
<FontAwesomeIcon icon={faChevronLeft} />
diff --git a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
index 3a724f197e..ad7165d68f 100644
--- a/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/CertificateDetailsByIDPage/CertificateDetailsByIDPage.tsx
@@ -41,6 +41,7 @@ import {
} from "@app/hooks/api/pkiApplications/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { usePopUp } from "@app/hooks/usePopUp";
+import { ApplicationTab } from "@app/pages/cert-manager/ApplicationDetailsByIDPage/application-tabs";
import { CertificateCertModal } from "../CertificatesPage/components/CertificateCertModal";
import {
@@ -121,7 +122,7 @@ const Page = () => {
projectId,
applicationName: fromApplication
},
- search: { selectedTab: "certificates" }
+ search: { selectedTab: ApplicationTab.Certificates }
});
} else {
navigate({
@@ -275,7 +276,7 @@ const Page = () => {
projectId,
applicationName: fromApplication
}}
- search={{ selectedTab: "certificates" }}
+ search={{ selectedTab: ApplicationTab.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} />
diff --git a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateManagePkiSyncsModal.tsx b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateManagePkiSyncsModal.tsx
index 1974dec278..815ed926c0 100644
--- a/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateManagePkiSyncsModal.tsx
+++ b/frontend/src/pages/cert-manager/CertificatesPage/components/CertificateManagePkiSyncsModal.tsx
@@ -27,6 +27,7 @@ import {
useListPkiSyncsWithCertificate,
useRemoveCertificatesFromPkiSync
} from "@app/hooks/api/pkiSyncs";
+import { ApplicationTab } from "@app/pages/cert-manager/ApplicationDetailsByIDPage/application-tabs";
import { IntegrationsListPageTabs } from "@app/types/integrations";
type Props = {
@@ -103,7 +104,7 @@ export const CertificateManagePkiSyncsModal = ({
projectId: currentProject.id,
applicationName
},
- search: { selectedTab: "syncs" }
+ search: { selectedTab: ApplicationTab.Syncs }
});
} else {
navigate({
diff --git a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
index 51726bafb7..83c18e627e 100644
--- a/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/PkiSyncDetailsByIDPage/PkiSyncDetailsByIDPage.tsx
@@ -24,6 +24,7 @@ import { ROUTE_PATHS } from "@app/const/routes";
import { PKI_SYNC_MAP } from "@app/helpers/pkiSyncs";
import { usePopUp } from "@app/hooks";
import { useGetPkiSync } from "@app/hooks/api/pkiSyncs";
+import { ApplicationTab } from "@app/pages/cert-manager/ApplicationDetailsByIDPage/application-tabs";
import { IntegrationsListPageTabs } from "@app/types/integrations";
import {
@@ -81,7 +82,7 @@ const PageContent = () => {
navigate({
to: "/organizations/$orgId/projects/cert-manager/$projectId/applications/$applicationName",
params: { orgId, projectId, applicationName },
- search: { selectedTab: "syncs" }
+ search: { selectedTab: ApplicationTab.Syncs }
});
return;
}