From bb27d38a1264e59cbfee8688ea9b74c21b61427d Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Mon, 19 Aug 2024 21:39:00 +0800 Subject: [PATCH] misc: ui form adjustments --- frontend/src/views/Project/CaPage/CaPage.tsx | 2 -- .../CertificateTemplateEnrollmentModal.tsx | 14 ++++++++- .../components/CertificateTemplatesTable.tsx | 29 +++++++++++++------ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/Project/CaPage/CaPage.tsx b/frontend/src/views/Project/CaPage/CaPage.tsx index fcf56a50e..7721ed260 100644 --- a/frontend/src/views/Project/CaPage/CaPage.tsx +++ b/frontend/src/views/Project/CaPage/CaPage.tsx @@ -22,7 +22,6 @@ import { usePopUp } from "@app/hooks/usePopUp"; import { CaModal } from "@app/views/Project/CertificatesPage/components/CaTab/components/CaModal"; import { CaInstallCertModal } from "../CertificatesPage/components/CaTab/components/CaInstallCertModal"; -import { CaEnrollmentModal } from "./components/CaEnrollmentModal"; import { CaCertificatesSection, CaDetailsSection, CaRenewalModal } from "./components"; export const CaPage = withProjectPermission( @@ -126,7 +125,6 @@ export const CaPage = withProjectPermission( )} - { if (data) { @@ -143,6 +145,11 @@ export const CertificateTemplateEnrollmentModal = ({ popUp, handlePopUpToggle }: )} /> + {data && ( + + + + )} ( - + setIsPassphraseFocused.on()} + onBlur={() => setIsPassphraseFocused.off()} + /> )} /> diff --git a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx index 0dddeb4e2..e5abf4b0e 100644 --- a/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx +++ b/frontend/src/views/Project/CertificatesPage/components/CertificatesTab/components/CertificateTemplatesTable.tsx @@ -80,16 +80,27 @@ export const CertificateTemplatesTable = ({ handlePopUpOpen }: Props) => { > Manage Policies - - handlePopUpOpen("enrollmentOptions", { - id: certificateTemplate.id - }) - } - icon={} + - Manage Enrollment - + {(isAllowed) => ( + + handlePopUpOpen("enrollmentOptions", { + id: certificateTemplate.id + }) + } + className={twMerge( + !isAllowed && "pointer-events-none cursor-not-allowed opacity-50" + )} + disabled={!isAllowed} + icon={} + > + Manage Enrollment + + )} +