Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions frontend/src/app/lib/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? [],
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/pages/findings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export function Findings() {
{selectedFindings.size !== 1 ? "s" : ""} selected
</span>
<div className="flex gap-2">
<Link to="/fix">
<Link to="/fix" state={{ findingIds: [...selectedFindings] }}>
<Button size="sm">Propose Fixes</Button>
</Link>
<Button variant="outline" size="sm" disabled>
Expand Down Expand Up @@ -707,7 +707,7 @@ export function Findings() {
</div>
</div>
<div className="flex gap-3 mt-2">
<Link to="/fix" className="flex-1">
<Link to="/fix" state={{ findingIds: [detailFinding.id] }} className="flex-1">
<Button className="w-full shadow-sm">Apply Fix</Button>
</Link>
<Button variant="outline" disabled className="flex-1 bg-muted/5">
Expand Down
Loading
Loading