fix(admin): also list client-bound Phase 9 links on the project page

The project admin page used to show only the legacy per-project
intake links (Phase 8 shape). After Phase 9 minting moved the
default to per-client links, owners navigating from a project no
longer saw its request link there — only the BackgroundMdEditor and
other panels. They'd find the link on the client admin page but the
project page suddenly looked empty of intake context.

Fix: query links where link.client == this project's client (the
Phase 9 shape) and render them through the existing panel in mode='client'.
The Phase 8 panel stays too — both shapes coexist during the
migration window. Same data, two views.
This commit is contained in:
Dave 2026-09-21 14:32:03 +02:00
parent 6cc7ae01f7
commit 8e816eed14

View file

@ -45,6 +45,16 @@ export default async function ProjectAdminPage({
sort: "-created",
});
// Phase 9: also show client-bound links targeting this project's client.
// Owners navigating from a project expect to see its request link
// here, not just on the client admin page.
const clientLinks = await pb
.collection("intake_links")
.getFullList<IntakeLinkRecord>({
filter: `client = "${project.client}"`,
sort: "-created",
});
const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? "http://localhost:3000";
const summary = await summaryStatus(project.id);
@ -66,6 +76,7 @@ export default async function ProjectAdminPage({
/>
<SummaryPanel projectId={project.id} status={summary} />
<IntakeLinksPanel mode="project" projectId={project.id} links={links} />
<IntakeLinksPanel mode="client" clientId={project.client} links={clientLinks} />
<ShowInIntakeToggle
projectId={project.id}
initial={Boolean(project.show_in_intake)}