Campuses frontend, docs and e2e (1.43.0)

Site settings -> Campuses tab; campus picker in the event editor; campus
filter and badges on the events list, public events page (remembered,
starts on home campus) and reports/dashboards; /campus/<slug> pages and
sitemap; home campus on the profile; "Everyone at a campus" in email and
WhatsApp broadcasts. Help, FEATURES, SETTINGS, API docs, protocol doc
(campusCount), handover and roadmap updated; campuses seeded for e2e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 16:45:43 +02:00
co-authored by Claude Opus 5.5
parent e138d4811d
commit 7e8eeaa7a5
41 changed files with 942 additions and 47 deletions
@@ -14,6 +14,7 @@ import { HorizontalBarChart } from "./charts/HorizontalBarChart";
import { AreaTrendChart } from "@/components/charts/AreaTrendChart";
import { errorMessage } from "@/lib/utils";
import { registrationOptionUnitPrice } from "@/lib/pricing";
import { CampusFilter, matchesCampus } from "@/components/shared/CampusFilter";
import type { ConsentRow, Event, EventCashup, EventFinancials, MedicalRow, Payment, Registration, Ticket, UserSummary } from "@/types";
const METHOD_KEYS = ["cash", "card", "eft", "other"] as const;
@@ -164,6 +165,8 @@ export default function ReportsV2({ backHref }: { backHref?: string } = {}) {
// hiding them by default would work against those reports' whole purpose. This toggle
// lets staff exclude them when they only want currently-open events.
const [showClosedEvents, setShowClosedEvents] = useState(true);
// Multi-campus: one campus's events, church-wide ones, or all (the church-wide total).
const [campus, setCampus] = useState("");
const isAdmin = role === "admin";
const filteredEvents = useMemo(() => {
@@ -172,9 +175,10 @@ export default function ReportsV2({ backHref }: { backHref?: string } = {}) {
if (!showPastEvents && ev.endDate && new Date(ev.endDate) < now) return false;
if (!showInactiveEvents && ev.isActive === false) return false;
if (!showClosedEvents && ev.cashupStatus === "closed") return false;
if (!matchesCampus(ev, campus)) return false;
return true;
});
}, [events, showPastEvents, showInactiveEvents, showClosedEvents]);
}, [events, showPastEvents, showInactiveEvents, showClosedEvents, campus]);
useEffect(() => {
(async () => {
@@ -1457,6 +1461,15 @@ export default function ReportsV2({ backHref }: { backHref?: string } = {}) {
)}
{error && <div className="p-3 mb-3 border rounded bg-red-50 text-red-700 text-sm">{error}</div>}
<CampusFilter
value={campus}
onChange={v => { setCampus(v); setSelectedEventIds([]); }}
withChurchWide
everyLabel="All campuses (church-wide total)"
className="mb-3"
id="reports-campus"
/>
<ReportsShell
events={filteredEvents}
isAdmin={isAdmin}