feat: dedicated Reports page (/reports) with per-scan CSV/PDF export - #387
Merged
Conversation
Add a Reports section to the SPA — lists completed scans with CSV/PDF export
buttons + a min_severity filter, so reports can be exported without opening each
scan (the Scan Detail buttons remain). Frontend-only; reuses the existing
/reports/<uuid>/{csv,pdf}/ endpoints (auth'd fetch + Blob, JWT in header).
- ReportsPage.jsx + nav item + /reports route.
- vite.config: proxy /reports via `^/reports/.+` regex so only the endpoints
proxy to Django and the bare /reports SPA page is served by Vite. Production
already works — Django's SPA catch-all serves bare /reports, the reports/
include only matches <uuid>/{csv,pdf}/.
- docs: CLAUDE (Reports UI note), CHANGELOG.
Verified live: nav item + page render, filters present, empty-state correct;
build + 22 vitest green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the dedicated Reports page to the SPA (you flagged the UI had no such page — reports were only on Scan Detail).
What it adds
ReportsPage(/reports, new nav item between Insights & Notifications): lists completed scans with per-scan CSV and PDF export buttons + amin_severityfilter and a domain filter — export without opening each scan.Frontend-only — reuses existing endpoints
No backend change: it calls the existing
/reports/<uuid>/{csv,pdf}/views via authenticated fetch + Blob (JWT in the header, never the URL).The route-collision fix (the subtle bit)
The SPA
/reportspage and the backend/reports/<uuid>/…endpoints share the/reportsprefix:reports/include only matches<uuid>/{csv,pdf}/, so bare/reportsfalls through to the SPA catch-all./reports*to Django. Changed it to a^/reports/.+regex so only the endpoints proxy to Django and the bare/reportspage is served by Vite.Verified
Live in-browser: nav item + page render, domain/severity filters present, correct empty-state ("No completed scans to report on").
npm run build+ 22 vitest green.