Fix four defects the screenshots and tests exposed
Verifying the rendered pages rather than the build turned up real bugs: - The WP-00 health page still sat at src/app/page.tsx and silently won the route over the new Aperçu screen, so the home page was a database status readout. Moved to /api/sante, where a probe belongs, and wired into the compose healthcheck. - The unassigned row showed a +14 h delta against a contract of zero, reading as an overshoot when it is simply the volume left to staff. It now shows what there is to fill. - Two sidebar entries lit at once: an anchor link matched its own page, and /equipe matched an employee record. Highlighting now resolves to the most specific match, and a test asserts exactly one entry lights per screen. - Section tabs with no built screen pointed at the home page, which reads as a broken tab. They now lead to their first entry's placeholder. Also gives truncated compliance alerts a title attribute, so a narrow cell no longer says there is a problem without saying which. Playwright can reuse a preinstalled browser through PLAYWRIGHT_CHROMIUM_PATH when its revision differs from the bundled one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cr9dkEHwbDgkWPnyGj1Rjv
This commit is contained in:
11 files changed
+260
-47
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { checkDatabase } from '@/server/health';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
/**
|
||||
* Point de santé, destiné aux sondes de conteneur.
|
||||
*
|
||||
* Il ne dit que « la base répond » : ni version, ni schéma, ni compte. Une
|
||||
* sonde est joignable sans authentification, elle ne doit donc rien apprendre
|
||||
* à qui la interroge.
|
||||
*/
|
||||
export async function GET() {
|
||||
const database = await checkDatabase();
|
||||
|
||||
return NextResponse.json(
|
||||
{ status: database.ok ? 'ok' : 'degraded' },
|
||||
{
|
||||
status: database.ok ? 200 : 503,
|
||||
headers: { 'cache-control': 'no-store' },
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import { checkDatabase } from '@/server/health';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default async function HomePage() {
|
||||
const database = await checkDatabase();
|
||||
|
||||
return (
|
||||
<main className="mx-auto flex min-h-dvh max-w-2xl flex-col justify-center gap-6 p-8">
|
||||
<div>
|
||||
<h1 className="text-3xl font-semibold tracking-tight">PlanFlow</h1>
|
||||
<p className="mt-2 text-neutral-600">
|
||||
Socle applicatif — lot WP-00. Les écrans métier arrivent aux lots suivants.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<dl className="grid gap-3 rounded-lg border border-neutral-200 bg-white p-6">
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<dt className="text-sm text-neutral-600">Base de données</dt>
|
||||
<dd
|
||||
className={
|
||||
database.ok
|
||||
? 'text-sm font-medium text-emerald-700'
|
||||
: 'text-sm font-medium text-red-700'
|
||||
}
|
||||
>
|
||||
{database.ok ? 'connectée' : `indisponible — ${database.error}`}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user