fix(documents): always render undated badge in DocumentRow desktop column
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m54s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m40s
CI / fail2ban Regex (pull_request) Successful in 41s
CI / Semgrep Security Scan (pull_request) Successful in 19s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m2s

The desktop right-column kept a leftover {#if doc.documentDate}…{:else}—{/if}
fallback that emitted a bare em-dash for undated documents, while the mobile
block already always rendered <DocumentDate>. DocumentDate defensively maps a
null date to the "Datum unbekannt" badge, so render it unconditionally — an
undated document is an absence, not an error, and never shows a bare "—".

Refs #668
This commit is contained in:
Marcel
2026-05-27 19:17:18 +02:00
parent 508575eccb
commit 19cd17d9cd

View File

@@ -187,16 +187,15 @@ function safeTagColor(color: string | null | undefined): string {
<!-- Right column — desktop only --> <!-- Right column — desktop only -->
<div class="hidden flex-col gap-2 pl-4 font-sans text-sm text-ink-2 sm:flex sm:w-44 lg:w-56"> <div class="hidden flex-col gap-2 pl-4 font-sans text-sm text-ink-2 sm:flex sm:w-44 lg:w-56">
<div> <div>
{#if doc.documentDate} <!-- An undated document is an absence, not an error (#668): DocumentDate
<DocumentDate defensively maps a null date to the "Datum unbekannt" badge, so we
iso={doc.documentDate} always render it — never a bare em-dash fallback. -->
precision={doc.metaDatePrecision} <DocumentDate
end={doc.metaDateEnd} iso={doc.documentDate}
showRaw={false} precision={doc.metaDatePrecision}
/> end={doc.metaDateEnd}
{:else} showRaw={false}
/>
{/if}
</div> </div>
<div> <div>
<span class="font-bold tracking-wide text-ink-3 uppercase">{m.docs_list_from()}</span> <span class="font-bold tracking-wide text-ink-3 uppercase">{m.docs_list_from()}</span>