Reporting page: add Due Date, column manager (hide/reorder), remove Discovered/Source

Backend:
- Extract dueDate from statusEmbedded.dueDate (strip time portion)
- Remove discoveredOn and source from extractFinding (not needed)

Frontend:
- Add Due Date column (color-coded: red=past due, amber=within 30d, gray=future)
- Remove Discovered and Source columns
- ColumnManager component: gear button opens popover with drag-to-reorder and
  eye toggle per column; column state persisted to localStorage
- Column order/visibility survives page refresh and syncs
- SortIcon, TableCell, NoteCell all driven by current visible column list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 12:47:11 -06:00
parent d3806e8ce3
commit 8697ba4ef3
2 changed files with 379 additions and 168 deletions

View File

@@ -120,6 +120,10 @@ function initTables(db) {
// Extract only the fields we need from a raw finding object
// ---------------------------------------------------------------------------
function extractFinding(f) {
// statusEmbedded.dueDate = "2026-03-06T00:00:00" — strip to date part
const rawDueDate = f.statusEmbedded?.dueDate || '';
const dueDate = rawDueDate ? rawDueDate.split('T')[0] : '';
return {
id: String(f.id),
title: f.title || '',
@@ -130,11 +134,8 @@ function extractFinding(f) {
dns: f.dns || f.host?.fqdn || '',
status: f.status || '',
slaStatus: f.slaStatus || '',
discoveredOn: f.discoveredOn || '',
lastFoundOn: f.lastFoundOn || '',
source: f.scannerPrettyName || f.scannerName || f.source || '',
pluginFamily: f.pluginFamily || '',
findingType: f.findingType || ''
dueDate,
lastFoundOn: f.lastFoundOn || ''
};
}