Rewrite the calendar frontend in Next.js
Replaces the Angular 18 app with Next.js 16 / React 19 / Tailwind 4 / shadcn, the same stack and design system as nachklang-feedback, planned in docs/rewrite-plan.md. - Admin: all calendars in one mobile-friendly list (month groups, calendar chips, Kommend/Vergangen/Alle, search, sort, filters in the URL), an edit sheet for create/edit/duplicate/delete, publish confirmation, and an "Abonnieren" dialog with subscription links for every calendar. - Public landing page: subscribe links from env instead of hardcoded, plus the next public events, server-rendered and revalidated every 5 minutes. - All times handled explicitly as Europe/Berlin; whole-day events stored as 00:00-23:59. Fixes carried over from the Angular app: the move dialog leaking a cancelled calendar change, saves that looked saved when they failed, in-place Date mutation, and duplicated calendar-id mappings. - Same shared-session auth as before (proxy.ts gate, /admin/me, 401 vs 403). - 112 Vitest tests over lib/; docs in docs/ (architecture, features, gotchas, API wish list, deployment). Needs the API branch feature/calendar-ical-escaping-subscriptions deployed first (GET /calendar/events/subscriptions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
138 files changed
+15942
-24010
No files matched your search
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { goToAdminLogin } from "@/lib/admin-auth";
|
||||
|
||||
/**
|
||||
* This app has no login form: signing in happens once, on admin.nachklang.art,
|
||||
* for every Nachklang app. Copied from nachklang-feedback.
|
||||
*
|
||||
* The route exists as a forwarder so proxy.ts has a stable path on this origin
|
||||
* to send signed-out visitors to, rather than building an external URL inside
|
||||
* the proxy.
|
||||
*/
|
||||
export default function AdminLoginPage() {
|
||||
// Read from the URL directly rather than with useSearchParams(): this page is
|
||||
// prerendered, and useSearchParams() opts the whole route into client-side
|
||||
// rendering unless it sits inside a <Suspense> boundary.
|
||||
const [redirect] = useState(() =>
|
||||
typeof window === "undefined" ? null : new URLSearchParams(window.location.search).get("redirect"),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
// Passed straight through; the admin app validates it against its own
|
||||
// origin allow-list, and a second check here could only drift from that.
|
||||
goToAdminLogin(redirect || "/admin");
|
||||
}, [redirect]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen flex-col items-center justify-center px-6 text-center">
|
||||
<p className="text-sm text-muted-foreground">Weiterleitung zur Nachklang-Anmeldung …</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user