From 28291e27d78cabc62bbe9c859f7a58325242b4bd Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Mon, 13 Jul 2026 20:18:40 +0200 Subject: [PATCH] Add in-app document preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds an inline preview for stored document files alongside download. - API Server: GET /api/documents/{id}/file honours ?inline=1, serving an inline Content-Disposition so the browser renders the file instead of forcing a download (default stays attachment). - Web App: BFF forwards the inline flag; documentPreviewUrl() helper; an eye icon; and a preview modal (Teleported to body) that picks a viewer from the file extension — images -> , PDFs/text -> +
+ +
Preview isn't available for this file type
+
{{ previewDoc.fileName }}
+ + Download instead + +
+ + + + diff --git a/Web App/web/src/components/Icon.vue b/Web App/web/src/components/Icon.vue index f02a39c..45a8535 100644 --- a/Web App/web/src/components/Icon.vue +++ b/Web App/web/src/components/Icon.vue @@ -33,6 +33,7 @@ const P = { globe: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z', smartphone: 'M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2', image: 'M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21', + eye: 'M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z', type: 'M4 7V4h16v3M9 20h6M12 4v16', sun: 'M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4', moon: 'M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z',