feat(wiki): show System as author for seeded documentation pages
Seeded Documentation pages have no lastEditor; the index cards and the detail header now read 'System' instead of 'Unknown editor' for those. Other categories keep the old fallback.
This commit is contained in:
parent
c9a3d23f96
commit
780d2bd8f0
2 changed files with 26 additions and 4 deletions
|
|
@ -181,7 +181,11 @@ export default async function WikiDetailPage({
|
|||
</div>
|
||||
|
||||
<article>
|
||||
<WikiContent prepared={prepared} scopeClasses={scopeClasses} htmlTemplates={templateHtmlMap} />
|
||||
<WikiContent
|
||||
prepared={prepared}
|
||||
scopeClasses={scopeClasses}
|
||||
htmlTemplates={templateHtmlMap}
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -218,7 +222,15 @@ export default async function WikiDetailPage({
|
|||
</div>
|
||||
</div>
|
||||
<div className="flex shrink-0 flex-col items-end gap-1 text-right text-xs text-muted-foreground">
|
||||
<span>Last edited by {relationName(page.lastEditor)}</span>
|
||||
{/* Seeded Documentation pages are written by the system, not a user. */}
|
||||
<span>
|
||||
Last edited by{" "}
|
||||
{page.lastEditor != null
|
||||
? relationName(page.lastEditor)
|
||||
: page.category === "Documentation"
|
||||
? "System"
|
||||
: "Unknown editor"}
|
||||
</span>
|
||||
<time dateTime={page.updatedAt}>{formatDate(page.updatedAt)}</time>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -227,7 +239,11 @@ export default async function WikiDetailPage({
|
|||
{lockdown && <LockdownBanner />}
|
||||
|
||||
<article>
|
||||
<WikiContent prepared={prepared} scopeClasses={scopeClasses} htmlTemplates={templateHtmlMap} />
|
||||
<WikiContent
|
||||
prepared={prepared}
|
||||
scopeClasses={scopeClasses}
|
||||
htmlTemplates={templateHtmlMap}
|
||||
/>
|
||||
</article>
|
||||
|
||||
<WikiToolbar
|
||||
|
|
|
|||
|
|
@ -46,7 +46,13 @@ export default async function WikiPage() {
|
|||
category: page.category,
|
||||
tags: page.tags ?? [],
|
||||
updatedAt: page.updatedAt,
|
||||
lastEditorName: relationName(page.lastEditor),
|
||||
// Seeded Documentation pages are written by the system, not a user.
|
||||
lastEditorName:
|
||||
page.lastEditor != null
|
||||
? relationName(page.lastEditor)
|
||||
: page.category === "Documentation"
|
||||
? "System"
|
||||
: "Unknown editor",
|
||||
}));
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue