diff --git a/frontend/src/components/pages/ReportingPage.js b/frontend/src/components/pages/ReportingPage.js index 1a5e0ec..8200fd3 100644 --- a/frontend/src/components/pages/ReportingPage.js +++ b/frontend/src/components/pages/ReportingPage.js @@ -860,7 +860,7 @@ function OverrideCell({ findingId, field, originalValue, initialOverride, canWri // --------------------------------------------------------------------------- // NoteCell — inline editable, saves on blur // --------------------------------------------------------------------------- -function NoteCell({ findingId, initialNote }) { +function NoteCell({ findingId, initialNote, onNoteSaved }) { const [value, setValue] = useState(initialNote || ''); const [saving, setSaving] = useState(false); const lastSaved = useRef(initialNote || ''); @@ -881,12 +881,13 @@ function NoteCell({ findingId, initialNote }) { body: JSON.stringify({ note: value }) }); lastSaved.current = value; + if (onNoteSaved) onNoteSaved(findingId, value); } catch (e) { console.error('Failed to save note:', e); } finally { setSaving(false); } - }, [findingId, value]); + }, [findingId, value, onNoteSaved]); return (
@@ -1188,7 +1189,7 @@ function FilterDropdown({ anchorEl, colKey, findings, activeFilter, onFilterChan // --------------------------------------------------------------------------- // Render a single table cell by column key // --------------------------------------------------------------------------- -function TableCell({ colKey, finding, canWrite, onCveMouseEnter, onCveMouseLeave, onIpMouseEnter, onIpMouseLeave, fpSubmissions, onEditSubmission, atlasStatusMap, onAtlasBadgeClick }) { +function TableCell({ colKey, finding, canWrite, onCveMouseEnter, onCveMouseLeave, onIpMouseEnter, onIpMouseLeave, fpSubmissions, onEditSubmission, atlasStatusMap, onAtlasBadgeClick, onNoteSaved }) { switch (colKey) { case 'findingId': return ( @@ -1351,7 +1352,7 @@ function TableCell({ colKey, finding, canWrite, onCveMouseEnter, onCveMouseLeave case 'note': return ( - + ); default: @@ -6413,6 +6414,10 @@ export default function VulnerabilityTriagePage({ filterDate, filterEXC }) { setEditSubmission(submission); }, []); + const handleNoteSaved = useCallback((findingId, note) => { + setFindings(prev => prev.map(f => f.id === findingId ? { ...f, note } : f)); + }, []); + const handleEditSuccess = useCallback(() => { fetchFpSubmissions(); fetchQueue(); @@ -7331,7 +7336,7 @@ export default function VulnerabilityTriagePage({ filterDate, filterEXC }) { {visibleCols.map((col) => ( - { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} /> + { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} onNoteSaved={handleNoteSaved} /> ))} ); @@ -7439,7 +7444,7 @@ export default function VulnerabilityTriagePage({ filterDate, filterEXC }) { {visibleCols.map((col) => ( - { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} /> + { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} onNoteSaved={handleNoteSaved} /> ))} ); @@ -7540,7 +7545,7 @@ export default function VulnerabilityTriagePage({ filterDate, filterEXC }) { /> {visibleCols.map((col) => ( - { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} /> + { setAtlasSelectedHostId(hostId); setAtlasSelectedHostName(finding.hostName || finding.ipAddress || ''); setAtlasSelectedFindingId(finding.id || null); setAtlasPanelOpen(true); }} onNoteSaved={handleNoteSaved} /> ))} );