Steuere das Herunterladen von Originalen je Rolle, benenne Dateien richtig und zeige HTML-Mails gesichert im Sandbox-Rahmen.
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 5m35s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 22s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-10-22 14:22:35 +02:00
1 parent 0a5daf6713
commit 075525ee17
26 files changed
+494 -71

No files matched your search

+4 -4
View File
@@ -124,7 +124,7 @@ export function TextStage({ element, context }) {
);
}
export function MailStage({ element, context, shownDirection }) {
export function MailStage({ element, context, binding, shownDirection }) {
const [letter, setLetter] = useState(null);
const [error, setError] = useState("");
const [shownFor, setShownFor] = useState(null);
@@ -236,7 +236,7 @@ export function MailStage({ element, context, shownDirection }) {
async function openOriginal() {
setError("");
try {
await downloadMailPart(element.id, context, "original", "nachricht.eml");
await downloadMailPart(element.id, context, "original", `${letter?.title || "nachricht"}.eml`);
} catch (err) {
setError(err.message);
}
@@ -262,7 +262,7 @@ export function MailStage({ element, context, shownDirection }) {
{media === "image" && blobUrl ? <img className="reader-image" alt={shownFile?.filename || element.title} src={blobUrl} /> : null}
{media === "pdf" && pdf ? <canvas ref={canvasRef} className="reader-canvas" /> : null}
{media === "pdf-frame" && blobUrl ? <DocumentView title={shownFile?.filename || element.title} url={blobUrl} /> : null}
{media === "other" && blobUrl ? <a href={blobUrl} target="_blank" rel="noreferrer">Anlage öffnen</a> : null}
{media === "other" && blobUrl && binding?.rights?.download ? <a href={blobUrl} target="_blank" rel="noreferrer">Anlage öffnen</a> : null}
{pages > 1 ? (
<div className="reader-pages">
<button type="button" disabled={page <= 1} onClick={() => setPage((current) => Math.max(1, current - 1))}>Vorherige Seite</button>
@@ -271,7 +271,7 @@ export function MailStage({ element, context, shownDirection }) {
</div>
) : null}
<MailBody html={letter.html} text={letter.text} truncated={letter.text_truncated} notices={letter.notices} />
<button type="button" onClick={openOriginal}>Vollständige E-Mail</button>
{binding?.rights?.download ? <button type="button" onClick={openOriginal}>Vollständige E-Mail herunterladen</button> : null}
</>
) : (
<p className="muted">{error ? "Die vollständige Nachricht konnte nicht geladen werden." : "Die vollständige Nachricht wird geladen …"}</p>