diff --git a/changes/38585-ndes-selection b/changes/38585-ndes-selection new file mode 100644 index 0000000000..1e07064766 --- /dev/null +++ b/changes/38585-ndes-selection @@ -0,0 +1 @@ +* Fixed Microsoft NDES CA not being selectable after deleting an existing NDES CA without a page refresh. diff --git a/frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx b/frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx index 685a261feb..f4d523bc56 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/CertificateAuthorities/components/AddCertAuthorityModal/helpers.tsx @@ -47,21 +47,16 @@ const DEFAULT_CERT_AUTHORITY_OPTIONS: IDropdownOption[] = [ * if one already exists */ export const generateDropdownOptions = (hasNDESCert: boolean) => { - if (!hasNDESCert) { - return DEFAULT_CERT_AUTHORITY_OPTIONS; - } - - // We only allow one NDES configuration, if ones exists disable the option and - // add a tooltip. - const ndesOption = DEFAULT_CERT_AUTHORITY_OPTIONS.find((option) => { - return option.value === "ndes_scep_proxy"; + return DEFAULT_CERT_AUTHORITY_OPTIONS.map((option) => { + if (option.value === "ndes_scep_proxy" && hasNDESCert) { + return { + ...option, + disabled: true, + tooltipContent: "Only one NDES can be added.", + }; + } + return option; }); - if (ndesOption) { - ndesOption.disabled = true; - ndesOption.tooltipContent = "Only one NDES can be added."; - } - - return DEFAULT_CERT_AUTHORITY_OPTIONS; }; /**