From aab1a0297ead8946b6578a6a2666fec7de16d9be Mon Sep 17 00:00:00 2001 From: Carlos Monastyrski Date: Mon, 4 Aug 2025 20:08:26 -0300 Subject: [PATCH] Add empty state and improve upgrade plan logic on Identity Auth Templates --- .../IdentitySection/IdentityAuthTemplatesTable.tsx | 2 +- .../components/IdentitySection/IdentitySection.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthTemplatesTable.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthTemplatesTable.tsx index cb0644ae7..406f124dc 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthTemplatesTable.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentityAuthTemplatesTable.tsx @@ -265,7 +265,7 @@ export const IdentityAuthTemplatesTable = ({ handlePopUpOpen }: Props) => { onChangePerPage={handlePerPageChange} /> )} - {!isPending && data && templates.length === 0 && ( + {!isPending && templates.length === 0 && ( 0 diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx index 1fa88e10d..791fdb716 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/IdentitySection.tsx @@ -180,7 +180,13 @@ export const IdentitySection = withPermission( colorSchema="secondary" type="submit" leftIcon={} - onClick={() => handlePopUpOpen("createTemplate")} + onClick={() => { + if (subscription && !subscription.kmip) { + handlePopUpOpen("upgradePlan"); + return; + } + handlePopUpOpen("createTemplate"); + }} isDisabled={!isAllowed} > Create Template @@ -244,7 +250,7 @@ export const IdentitySection = withPermission( handlePopUpToggle("upgradePlan", isOpen)} - text={(popUp.upgradePlan?.data as { description: string })?.description} + text="You can use Identity Auth Templates if you switch to Infisical's Enterprise plan." /> );