Addressed greptlie comments and suggestions

This commit is contained in:
Carlos Monastyrski
2025-08-27 04:04:39 -03:00
parent 83479a091e
commit 7b52d60036
22 changed files with 80 additions and 54 deletions
@@ -274,6 +274,8 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
configPayload = {
azureAdcsConnectionId: formConfiguration.azureAdcsConnection.id
};
} else {
throw new Error("Invalid certificate authority configuration");
}
if (ca) {
@@ -175,8 +175,9 @@ export const CertificatesTable = ({ handlePopUpOpen }: Props) => {
{/* Only show revoke button if CA supports revocation */}
{(() => {
const caType = caCapabilityMap[certificate.caId];
// If caId not found in map, assume CA supports revocation to avoid hiding revoke option
const supportsRevocation =
caType &&
!caType ||
caSupportsCapability(caType, CaCapability.REVOKE_CERTIFICATES);
if (!supportsRevocation) {
@@ -64,7 +64,7 @@ export const PkiSubscriberCertificatesTable = ({ subscriberName, handlePopUpOpen
);
// Fetch CA data to determine capabilities
const { data: caData } = useListCasByProjectId(currentWorkspace?.id ?? "");
const { data: caData } = useListCasByProjectId(currentWorkspace.id);
// Create mapping from caId to CA type for capability checking
const caCapabilityMap = useMemo(() => {
@@ -151,8 +151,6 @@ export const PkiSubscriberModal = ({ popUp, handlePopUpToggle }: Props) => {
projectId
});
console.log(pkiSubscriber);
// Initialize form with ALL subscriber data including template
useEffect(() => {
if (pkiSubscriber) {