Add Workflow column to Reporting page with FP# priority matching

- Backend: extractFinding now flattens all workflowDistribution buckets
  and prioritises FP# (False Positive) tickets over SYS# workflows.
  Falls back to workflowGeneratedNames for FP# IDs not yet in distribution.
- Frontend: Add Workflow column (sortable, filterable) with state-coloured
  badge (green=Approved, blue=Requested, amber=Reworked/Actionable,
  red=Rejected, grey=Expired/unknown).
- Bump localStorage key to v2 so the new column appears on all clients
  without needing a manual cache clear.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 14:44:53 -06:00
parent 9893460b64
commit 2d1acca990
2 changed files with 77 additions and 3 deletions

View File

@@ -130,6 +130,39 @@ function extractFinding(f) {
// CVE list: vulnerabilities.vulnInfoList[].cve
const cves = (f.vulnerabilities?.vulnInfoList || []).map(v => v.cve).filter(Boolean);
// Workflow: flatten all distribution buckets, prioritise FP# over SYS#
const wfDist = f.workflowDistribution || {};
const allWfEntries = [
...(wfDist.actionableWorkflows || []),
...(wfDist.requestedWorkflows || []),
...(wfDist.approvedWorkflows || []),
...(wfDist.reworkedWorkflows || []),
...(wfDist.rejectedWorkflows || []),
...(wfDist.expiredWorkflows || []),
...(wfDist.latestSystemWorkflows || []),
];
// FP# (False Positive tickets) take priority over SYS# (system workflows)
const fpEntry = allWfEntries.find(w => (w.generatedId || '').startsWith('FP#'));
const sysEntry = allWfEntries.find(w => (w.generatedId || '').startsWith('SYS#'));
const wfEntry = fpEntry || sysEntry || allWfEntries[0] || null;
// If the distribution didn't surface an FP#, also check workflowGeneratedNames directly.
// (Some FP# tickets only appear in the names list without full state info.)
const generatedNames = f.workflowGeneratedNames || [];
const fpFromNames = !fpEntry
? generatedNames.find(n => n.startsWith('FP#')) || null
: null;
const workflow = wfEntry ? {
id: wfEntry.generatedId || '',
state: wfEntry.state || '',
type: wfEntry.type || wfEntry.acronym || '',
} : fpFromNames ? {
id: fpFromNames,
state: '',
type: 'FP',
} : null;
return {
id: String(f.id),
title: f.title || '',
@@ -143,7 +176,8 @@ function extractFinding(f) {
dueDate,
lastFoundOn: f.lastFoundOn || '',
buOwnership,
cves
cves,
workflow
};
}