Steuere das Herunterladen von Originalen je Rolle, benenne Dateien richtig und zeige HTML-Mails gesichert im Sandbox-Rahmen.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a5daf6713
commit
075525ee17
26 files changed
+494
-71
No files matched your search
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user