Skip to content

feat: dedicated Reports page (/reports) with per-scan CSV/PDF export - #387

Merged
rathnakaragn merged 1 commit into
mainfrom
feat/reports-page
Sep 9, 2026
Merged

feat: dedicated Reports page (/reports) with per-scan CSV/PDF export#387
rathnakaragn merged 1 commit into
mainfrom
feat/reports-page

Conversation

@rathnakaragn

Copy link
Copy Markdown
Contributor

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 + a min_severity filter and a domain filter — export without opening each scan.
  • Scan Detail's CSV/PDF buttons stay (unchanged).

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 /reports page and the backend /reports/<uuid>/… endpoints share the /reports prefix:

  • Production: already works — Django's reports/ include only matches <uuid>/{csv,pdf}/, so bare /reports falls through to the SPA catch-all.
  • Vite dev: the proxy forwarded all /reports* to Django. Changed it to a ^/reports/.+ regex so only the endpoints proxy to Django and the bare /reports page 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.

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.
@rathnakaragn
rathnakaragn merged commit 29baf2e into main Sep 9, 2026
7 checks passed
@rathnakaragn
rathnakaragn deleted the feat/reports-page branch September 9, 2026 15:39
rathnakaragn added a commit that referenced this pull request Sep 9, 2026
Minor release for the dedicated Reports page (#387) + the vite __dirname config
fix (#386).

- pyproject + uv.lock: 2.6.0 -> 2.7.0
- CHANGELOG: promote -> [v2.7.0] + compare link
- CLAUDE Status header -> v2.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant