Require qualys_id for risk_acceptance in bulk Atlas action plan modal

This commit is contained in:
root
2026-04-24 21:58:53 +00:00
parent 5a9dc007db
commit 8da62f0f14

View File

@@ -3883,6 +3883,8 @@ function BulkAtlasModal({ selectedFindings, onClose, onSuccess }) {
const handleSubmit = async () => {
if (!commitDate) { setError('Commit date is required'); return; }
if (hostIds.length === 0) { setError('No valid host IDs in selection'); return; }
const needsQualysId = ['remediation', 'false_positive', 'risk_acceptance'].includes(planType);
if (needsQualysId && !qualysId.trim()) { setError(`Qualys ID is required for ${planType.replace(/_/g, ' ')} plans`); return; }
setSubmitting(true);
setError(null);
@@ -4041,9 +4043,9 @@ function BulkAtlasModal({ selectedFindings, onClose, onSuccess }) {
</div>
{/* Optional fields — shown based on plan type */}
{(planType === 'remediation' || planType === 'false_positive') && (
{(planType === 'remediation' || planType === 'false_positive' || planType === 'risk_acceptance') && (
<div style={{ marginBottom: '0.75rem' }}>
<label style={labelSt}>Qualys ID <span style={{ color: '#475569', textTransform: 'none' }}>(optional)</span></label>
<label style={labelSt}>Qualys ID <span style={{ color: '#475569', textTransform: 'none' }}>(required for {planType.replace(/_/g, ' ')})</span></label>
<input value={qualysId} onChange={e => setQualysId(e.target.value)}
placeholder="QID-12345" style={inputSt} />
</div>