Staff report: inline lightbox for image/PDF attachments

Adds a /api/staff/file proxy that re-streams Civi attachments with
Content-Disposition: inline so a native <dialog> lightbox can preview
images and PDFs in place. Office docs keep their plain download link
and gain a "View in Google Docs" secondary link (uses the Civi-signed
URL so Google can fetch without our staff key).

Also threads mime through /api/staff/report (Attachment.get mime_type)
so the dispatcher picks the right affordance without relying solely on
filename inference.
This commit is contained in:
Joel Brock
2026-06-15 11:56:45 -07:00
parent 5203dabeac
commit 6850ff9dee
8 changed files with 648 additions and 29 deletions
+3 -1
View File
@@ -8,7 +8,9 @@
"start": "next start",
"lint": "eslint",
"sync-help": "node --env-file=.env.local scripts/sync-help-from-civi.mjs",
"test:mapping": "node --test lib/staff-field-mapping.test.mjs"
"test:mapping": "node --test lib/staff-field-mapping.test.mjs",
"test:mime": "node --test lib/mime.test.mjs",
"test": "node --test lib/staff-field-mapping.test.mjs lib/mime.test.mjs"
},
"dependencies": {
"next": "16.2.6",