diff --git a/frontend/src/app/lib/mappers.ts b/frontend/src/app/lib/mappers.ts index 19aac71..b45c90b 100644 --- a/frontend/src/app/lib/mappers.ts +++ b/frontend/src/app/lib/mappers.ts @@ -24,20 +24,24 @@ function mapTool(tool?: string): Tool { return allowedTools.includes(tool as Tool) ? (tool as Tool) : "semgrep"; } -export function mapBackendFindingToUi(f: BackendFinding): Finding { +export function mapBackendFindingToUi(f: any): Finding { + const filePath = f.location?.path || f.file_path || "Unknown file"; + const startLine = f.location?.start_line || f.line_number || 1; + const tool = f.metadata?.engine || f.scanner || "semgrep"; + return { id: f.id, severity: mapSeverity(f.severity), category: f.category, - title: f.title, + title: f.title || f.rule_id || "Vulnerability", - file: f.location?.path ?? "Unknown file", - lineNumber: f.location?.start_line ?? 1, - tool: mapTool(f.metadata?.engine), + file: filePath, + lineNumber: startLine, + tool: mapTool(tool), confidence: f.confidence ?? 100, - status: "open", - description: f.description ?? "", + status: f.status || "open", + description: f.description ?? f.message ?? "", code: f.code ?? "", suggestedFix: f.suggested_fix, references: f.references ?? [], diff --git a/frontend/src/app/pages/findings.tsx b/frontend/src/app/pages/findings.tsx index b0467a9..708d75f 100644 --- a/frontend/src/app/pages/findings.tsx +++ b/frontend/src/app/pages/findings.tsx @@ -447,7 +447,7 @@ export function Findings() { {selectedFindings.size !== 1 ? "s" : ""} selected
- +
- + + +
+ + + ); + } + + const filesAffectedCount = new Set(mappedFixes.flatMap(f => f.file)).size; + return (
@@ -74,20 +311,20 @@ export function Fix() { Fix Summary - 2 findings with available automated fixes + {mappedFixes.length} findings with available automated fixes
-
2
+
{mappedFixes.length}
Proposed Fixes
-
3
+
{filesAffectedCount}
Files Affected
-
~20m
+
~{mappedFixes.length * 5}m
Est. Time
@@ -100,7 +337,7 @@ export function Fix() { {/* Fix Cards */}
- {fixes.map((fix) => ( + {mappedFixes.map((fix) => (
@@ -147,9 +384,7 @@ export function Fix() {
- - - + -
@@ -178,15 +413,13 @@ export function Fix() {
- - - - +