A4: app shell (layout, nav, tokens, error/empty states, /api/health)

Fixes the A4 blocker: /api/dev/complete now establishes the Auth.js session.
Root cause was UntrustedHost (trustHost defaulted false in pnpm start /
production because setEnvDefaults derives it from AUTH_URL, not NEXTAUTH_URL,
and assertConfig checks it before that default applies). Added trustHost: true
to the auth config; rebuilt. Complete response now sets authjs.session-token,
/schedule returns 200, and all 4 e2e shell tests pass.
Also ignores test-results/ artifacts.
This commit is contained in:
Tiel Coder
2026-11-17 23:35:45 +00:00
parent 3cd932e1a1
commit 3451bced82
18 changed files with 559 additions and 11 deletions
+16
View File
@@ -0,0 +1,16 @@
import { StateMessage } from "@/components/app/state-message";
export const metadata = { title: "Announcements" };
export default function AnnouncementsPage() {
return (
<>
<h1 className="text-lg font-semibold tracking-tight">Announcements</h1>
<p className="text-sm text-muted-foreground">News and notes from the media team.</p>
<StateMessage
title="No announcements"
description="Team announcements will appear here as rich-text posts."
/>
</>
);
}
+18
View File
@@ -0,0 +1,18 @@
import { auth } from "@/auth/config";
import { redirect } from "next/navigation";
import { AppLayout } from "@/components/app/app-layout";
/**
* Authenticated shell wrapper. Any route under the `(app)` group requires a
* session; unauthenticated visitors are sent to /login. The visible shell
* (header, nav, main, footer) is provided by AppLayout.
*/
export default async function AppGroupLayout({
children,
}: {
children: React.ReactNode;
}) {
const session = await auth();
if (!session?.user) redirect("/login");
return <AppLayout>{children}</AppLayout>;
}
+16
View File
@@ -0,0 +1,16 @@
import { StateMessage } from "@/components/app/state-message";
export const metadata = { title: "Roster" };
export default function RosterPage() {
return (
<>
<h1 className="text-lg font-semibold tracking-tight">Roster</h1>
<p className="text-sm text-muted-foreground">The team, their roles, and how to reach them.</p>
<StateMessage
title="No one on the roster yet"
description="Volunteers appear here once an admin invites and approves them."
/>
</>
);
}
+16
View File
@@ -0,0 +1,16 @@
import { StateMessage } from "@/components/app/state-message";
export const metadata = { title: "Schedule" };
export default function SchedulePage() {
return (
<>
<h1 className="text-lg font-semibold tracking-tight">Schedule</h1>
<p className="text-sm text-muted-foreground">Your upcoming slots and what to do the day of service.</p>
<StateMessage
title="Nothing scheduled yet"
description="Slots confirmed for you will show up here, with call times and a way to add them to your calendar."
/>
</>
);
}
+16
View File
@@ -0,0 +1,16 @@
import { StateMessage } from "@/components/app/state-message";
export const metadata = { title: "Settings" };
export default function SettingsPage() {
return (
<>
<h1 className="text-lg font-semibold tracking-tight">Settings</h1>
<p className="text-sm text-muted-foreground">Church details, timezone, and scheduling rules.</p>
<StateMessage
title="No settings to show"
description="Church and scheduling settings appear here. Branding and admin settings are restricted to admins."
/>
</>
);
}
+16
View File
@@ -0,0 +1,16 @@
import { StateMessage } from "@/components/app/state-message";
export const metadata = { title: "Training" };
export default function TrainingPage() {
return (
<>
<h1 className="text-lg font-semibold tracking-tight">Training</h1>
<p className="text-sm text-muted-foreground">How-tos and tutorials, with progress tied to your roles.</p>
<StateMessage
title="No courses available"
description="Training lessons will appear here. Some are required before you can serve certain roles."
/>
</>
);
}