feat(reporting): add Finding ID column
ID was already stored in the cache from f.id; exposed as a sortable column (filterable: false — too many unique values to be useful as a filter). Existing users get it appended to the end of their saved column order via the loadColumnOrder merge logic; new users see it first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ const STORAGE_KEY = 'steam_findings_columns_v1';
|
|||||||
// Column definitions — source of truth for labels, sort behaviour, rendering
|
// Column definitions — source of truth for labels, sort behaviour, rendering
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const COLUMN_DEFS = {
|
const COLUMN_DEFS = {
|
||||||
|
findingId: { label: 'Finding ID', sortable: true, filterable: false },
|
||||||
severity: { label: 'Severity', sortable: true, filterable: true },
|
severity: { label: 'Severity', sortable: true, filterable: true },
|
||||||
title: { label: 'Title', sortable: true, filterable: true },
|
title: { label: 'Title', sortable: true, filterable: true },
|
||||||
cves: { label: 'CVEs', sortable: true, filterable: true, multiValue: true },
|
cves: { label: 'CVEs', sortable: true, filterable: true, multiValue: true },
|
||||||
@@ -23,6 +24,7 @@ const COLUMN_DEFS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_COLUMN_ORDER = [
|
const DEFAULT_COLUMN_ORDER = [
|
||||||
|
{ key: 'findingId', visible: true },
|
||||||
{ key: 'severity', visible: true },
|
{ key: 'severity', visible: true },
|
||||||
{ key: 'title', visible: true },
|
{ key: 'title', visible: true },
|
||||||
{ key: 'cves', visible: true },
|
{ key: 'cves', visible: true },
|
||||||
@@ -63,6 +65,7 @@ function saveColumnOrder(order) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function getVal(finding, key) {
|
function getVal(finding, key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case 'findingId': return finding.id ?? '';
|
||||||
case 'severity': return finding.severity ?? 0;
|
case 'severity': return finding.severity ?? 0;
|
||||||
case 'title': return finding.title ?? '';
|
case 'title': return finding.title ?? '';
|
||||||
case 'hostName': return finding.hostName ?? '';
|
case 'hostName': return finding.hostName ?? '';
|
||||||
@@ -449,6 +452,12 @@ function FilterDropdown({ anchorEl, colKey, findings, activeFilter, onFilterChan
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function TableCell({ colKey, finding }) {
|
function TableCell({ colKey, finding }) {
|
||||||
switch (colKey) {
|
switch (colKey) {
|
||||||
|
case 'findingId':
|
||||||
|
return (
|
||||||
|
<td style={{ padding: '0.45rem 0.75rem', whiteSpace: 'nowrap', color: '#475569', fontFamily: 'monospace', fontSize: '0.68rem' }}>
|
||||||
|
{finding.id || '—'}
|
||||||
|
</td>
|
||||||
|
);
|
||||||
case 'severity': {
|
case 'severity': {
|
||||||
const sc = severityColor(finding.vrrGroup);
|
const sc = severityColor(finding.vrrGroup);
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user