Skip to content

feat(reports): professional PDF report with branded layout#93

Merged
WhiteMuush merged 8 commits into
mainfrom
feat/reports-pdf-pro
Jun 25, 2026
Merged

feat(reports): professional PDF report with branded layout#93
WhiteMuush merged 8 commits into
mainfrom
feat/reports-pdf-pro

Conversation

@WhiteMuush

Copy link
Copy Markdown
Owner

Summary

Multi-section PDF security report with a branded, information-led layout.

  • Cover page (company-first) with DataShield brand palette
  • Executive overview, key findings, period activity, notable incidents, alert breakdown
  • Section titles glued to their content so page breaks never strand a heading
  • Exported files named by company + section + date (self-describing, collision-free)

Test

  • npm run seed:dev then download PDF/CSV from the Reports page
  • Verify filenames: datashield_<company>_report_<date>.pdf
  • Verify "Notable incidents" heading stays with its table across page breaks

Rebuild the PDF export from flat tables into a designed report: branded
cover band, executive KPI cards, colour-coded findings, period-activity
deltas, a stacked alert-severity bar with legend, and accented detail
tables with inline percentage bars and zebra rows. Headings stay glued to
short tables across page breaks; a paginated footer numbers every page.

Authored as .tsx (react-pdf primitives); vitest now overrides the
tsconfig jsx:preserve via oxc so the module compiles under test.
Add a dedicated cover page naming the organisation (name, domain, period,
risk score, classification) and restructure the body around pure
information rather than dashboard widgets: an executive narrative, key
findings, a what-changed-this-period summary, a notable-incidents table
(top breaches), and an alert breakdown, followed by the detail tables.
Content pages carry a running header and paginated footer.

Thread company name/domain into ReportData via getReportData.
Point the Reports toolbar PDF button at the export route (format=pdf)
so it downloads the server-built, multi-page PDF instead of opening the
browser print dialog. Carries the active report filters.
Replace the generic blues with the app's brand tokens (violet primary,
orange accent, warm cream, --severity-* colours as hex). Make the cover
lead with the customer organisation name as the hero; DataShield is now
only a small generated-by footnote.
Move the company lookup out of the getReportData orchestrator into its own
org.ts slice, matching the other report modules. Replace the silent
'Unknown organisation' fallback with a thrown error: companyId comes from
the session, so a missing row is broken integrity, not an empty result,
and a placeholder name on a security report would mislead.
Replace the static datashield-report filename with a slugged company
name, section and generation date so downloads are self-describing and
collision-free.
Notable incidents could push its table to the next page while the
heading stayed at the bottom of the previous one. Reserve space below
each SectionHead and keep the incidents block atomic so titles never
strand.
@WhiteMuush WhiteMuush merged commit 5eac66d into main Jun 25, 2026
11 checks passed
@WhiteMuush WhiteMuush deleted the feat/reports-pdf-pro branch June 25, 2026 13:37
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