Skip to content

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

misc: addressed feedback

Sheen Capadngana215a48e48eb
diff --git a/frontend/src/hooks/api/ca/mutations.tsx b/frontend/src/hooks/api/ca/mutations.tsx
index aa45df7b43..be1e0a4ea1 100644
--- a/frontend/src/hooks/api/ca/mutations.tsx
+++ b/frontend/src/hooks/api/ca/mutations.tsx
@@ -73,6 +73,10 @@ export const useCreateCa = () => {
queryClient.invalidateQueries({
queryKey: caKeys.listExternalCasByProjectId()
});
+ // Both caps count every CA type, so creating or deleting either kind moves the quota.
+ queryClient.invalidateQueries({
+ queryKey: caKeys.getCaQuota()
+ });
}
});
};
@@ -96,6 +100,9 @@ export const useDeleteCa = () => {
queryClient.invalidateQueries({
queryKey: caKeys.listExternalCasByProjectId()
});
+ queryClient.invalidateQueries({
+ queryKey: caKeys.getCaQuota()
+ });
}
});
};
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
index 9a852cdd92..f285d02649 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/CaSection.tsx
@@ -56,8 +56,16 @@ export const CaSection = () => {
// An internal CA counts against both caps, so whichever runs out first blocks it. The message names
// that one, since "1 of 1 internal CAs" and "1 of 1 CAs" call for different upgrades.
const exhausted = [
- { noun: "certificate authorities", ...caQuota?.certificateAuthorities },
- { noun: "internal certificate authorities", ...caQuota?.internalCertificateAuthorities }
+ {
+ one: "certificate authority",
+ many: "certificate authorities",
+ ...caQuota?.certificateAuthorities
+ },
+ {
+ one: "internal certificate authority",
+ many: "internal certificate authorities",
+ ...caQuota?.internalCertificateAuthorities
+ }
].find((entry) => typeof entry.limit === "number" && (entry.used ?? 0) >= entry.limit);
const handleCreateCa = () => {
@@ -65,7 +73,7 @@ export const CaSection = () => {
// The allowance is shared across the organization and any sub-organizations, while this table
// shows one project, so the count is named rather than left to look like a mismatch.
handlePopUpOpen("upgradePlan", {
- text: `Your plan includes ${exhausted.limit} ${exhausted.noun} and all ${exhausted.used} are in use across your organization. Upgrade to add more.`
+ text: `Your plan includes ${exhausted.limit} ${exhausted.limit === 1 ? exhausted.one : exhausted.many}. Your organization is using ${exhausted.used}. Upgrade to add more.`
});
return;
}
diff --git a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
index b756a7a99b..c84211f337 100644
--- a/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
+++ b/frontend/src/pages/cert-manager/CertificateAuthoritiesPage/components/ExternalCaSection.tsx
@@ -47,7 +47,7 @@ export const ExternalCaSection = () => {
const handleCreateCa = () => {
if (isAtCaLimit) {
handlePopUpOpen("upgradePlan", {
- text: `Your plan includes ${caLimit.limit} certificate authorities and all ${caLimit.used} are in use across your organization. Upgrade to add more.`
+ text: `Your plan includes ${caLimit.limit} certificate ${caLimit.limit === 1 ? "authority" : "authorities"}. Your organization is using ${caLimit.used}. Upgrade to add more.`
});
return;
}