Address PR comments

This commit is contained in:
Carlos Monastyrski
2025-12-02 12:46:12 -03:00
parent 443e4226fb
commit 36ccc3769a
16 changed files with 139 additions and 114 deletions
+4 -2
View File
@@ -189,10 +189,12 @@ export const useGetCaCertTemplates = (caId: string) => {
export const useGetAzureAdcsTemplates = ({
caId,
projectId
projectId,
isAzureAdcsCa
}: {
caId: string;
projectId: string;
isAzureAdcsCa: boolean;
}) => {
return useQuery({
queryKey: caKeys.getAzureAdcsTemplates(caId, projectId),
@@ -202,6 +204,6 @@ export const useGetAzureAdcsTemplates = ({
}>(`/api/v1/cert-manager/ca/azure-ad-cs/${caId}/templates?projectId=${projectId}`);
return data;
},
enabled: Boolean(caId && projectId)
enabled: Boolean(caId && projectId && isAzureAdcsCa)
});
};
@@ -195,10 +195,7 @@ export const useUnifiedCertificateIssuance = () => {
const { projectSlug, ...requestData } = body;
const { data } = await apiRequest.post<TUnifiedCertificateIssuanceResponse>(
"/api/v1/cert-manager/certificates",
requestData,
{
params: { projectSlug }
}
requestData
);
return data;
},
@@ -298,7 +298,6 @@ export const CertificateIssuanceModal = ({ popUp, handlePopUpToggle, profileId }
const formattedSans = formatSubjectAltNames(subjectAltNames);
if (formattedSans && formattedSans.length > 0) {
request.attributes.altNames = formattedSans;
request.attributes.subjectAlternativeNames = formattedSans;
}
}
@@ -325,7 +324,7 @@ export const CertificateIssuanceModal = ({ popUp, handlePopUpToggle, profileId }
} else {
// Certificate request - async processing
createNotification({
text: `Certificate request submitted successfully. This may take a few minutes to process. Request ID: ${response.certificateRequestId}`,
text: `Certificate request submitted successfully. This may take a few minutes to process. Certificate Request ID: ${response.certificateRequestId}`,
type: "success"
});
handlePopUpToggle("issueCertificate", false);
@@ -25,7 +25,7 @@ export const CertificateRenewalModal = ({ popUp, handlePopUpToggle }: Props) =>
});
const notificationText = result.certificateRequestId
? `Certificate renewal initiated successfully. Request ID: ${result.certificateRequestId}`
? `Certificate renewal initiated successfully. Certificate Request ID: ${result.certificateRequestId}`
: "Certificate renewed successfully";
createNotification({
@@ -71,7 +71,9 @@ export const CertificateRequestTracker = ({ requestId, onCertificateIssued }: Pr
<div className="space-y-4">
<div className="flex items-center space-x-2">
{getStatusIcon()}
<span className="text-sm font-medium text-mineshaft-300">Request ID: {requestId}</span>
<span className="text-sm font-medium text-mineshaft-300">
Certificate Request ID: {requestId}
</span>
</div>
<div className="text-sm text-mineshaft-400">
@@ -447,7 +447,8 @@ export const CreateProfileModal = ({
// Fetch Azure ADCS templates if needed
const { data: azureAdcsTemplatesData } = useGetAzureAdcsTemplates({
caId: watchedCertificateAuthorityId || "",
projectId: currentProject?.id || ""
projectId: currentProject?.id || "",
isAzureAdcsCa
});
useEffect(() => {
@@ -732,7 +733,7 @@ export const CreateProfileModal = ({
name="externalConfigs.template"
render={({ field: { onChange, value }, fieldState: { error } }) => (
<FormControl
label="Azure ADCS Template"
label="Windows ADCS Template"
isRequired
isError={Boolean(error)}
errorText={error?.message}