fix: add key file requirement message for PEM/DER certificates in CertificateUploadDialog
This commit is contained in:
@@ -102,7 +102,8 @@ export default function CertificateUploadDialog({
|
||||
}
|
||||
|
||||
const canValidate = !!certFile && !validateMutation.isPending
|
||||
const canSubmit = !!certFile && !!name.trim()
|
||||
const needsKeyFile = !!certFile && !isPfx && !keyFile
|
||||
const canSubmit = !!certFile && !!name.trim() && !needsKeyFile
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={handleClose}>
|
||||
@@ -166,6 +167,12 @@ export default function CertificateUploadDialog({
|
||||
</>
|
||||
)}
|
||||
|
||||
{needsKeyFile && (
|
||||
<p role="alert" className="text-xs text-red-500">
|
||||
{t('certificates.keyFileRequired')}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{certFile && !validationResult && (
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user