misc: add tracking of certificate template ID

This commit is contained in:
Sheen Capadngan
2024-08-16 20:17:52 +08:00
parent 97f5c33aea
commit f90855e7a5
5 changed files with 35 additions and 4 deletions
@@ -3,6 +3,7 @@ import { CertStatus } from "./enums";
export type TCertificate = {
id: string;
caId: string;
certificateTemplateId?: string;
status: CertStatus;
friendlyName: string;
commonName: string;
@@ -102,6 +102,7 @@ export const CertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
friendlyName: cert.friendlyName,
commonName: cert.commonName,
altNames: cert.altNames,
certificateTemplateId: cert.certificateTemplateId ?? CERT_TEMPLATE_NONE_VALUE,
ttl: ""
});
} else {
@@ -215,7 +216,10 @@ export const CertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
</FormControl>
)}
/>
{(!selectedCertTemplateId || selectedCertTemplateId === CERT_TEMPLATE_NONE_VALUE) && (
{(!selectedCertTemplateId ||
selectedCertTemplateId === CERT_TEMPLATE_NONE_VALUE ||
cert) && (
<>
<Controller
control={control}
name="caId"
@@ -243,7 +247,6 @@ export const CertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
</FormControl>
)}
/>
) && (
<Controller
control={control}
name="collectionId"
@@ -270,7 +273,8 @@ export const CertificateModal = ({ popUp, handlePopUpToggle }: Props) => {
</FormControl>
)}
/>
)}
</>
)}
<Controller
control={control}
defaultValue=""