From 373effbb9ed315e0853165cc9c7baee0508d6598 Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:15:16 -0500 Subject: [PATCH] Fixed Microsoft NDES CA not being selectable (#41490) **Related issue:** Resolves #38585 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. ## Testing - [x] QA'd all new/changed functionality manually ## Summary by CodeRabbit * **Bug Fixes** * Fixed Microsoft NDES CA selection to work immediately after deleting an existing NDES CA without requiring a page refresh. * Added validation preventing multiple NDES CAs from being added, with a tooltip message explaining the limitation. --- changes/38585-ndes-selection | 1 + .../AddCertAuthorityModal/helpers.tsx | 23 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 changes/38585-ndes-selection 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; }; /**