fix: close all remaining known gaps across modules
Every 'read-only placeholder' and 'missing functionality' gap from the QA audit is now resolved: COURSES — categories/instructors/locations can now be deleted: - Added update/delete methods to course-reference-data.service.ts - Added deleteCategory/deleteInstructor/deleteLocation server actions - Created DeleteRefDataButton client component with confirmation dialog - Wired delete buttons into all three table pages BOOKINGS — calendar month navigation now works: - Calendar was hardcoded to current month with disabled prev/next - Added year/month search params for server-side month rendering - Replaced disabled buttons with Link-based navigation - Verified: clicking next/prev correctly renders different months DOCUMENTS — templates page now reads from database: - Was hardcoded empty array; now queries document_templates table - Table exists since migration 20260414000006_shared_templates.sql FISCHEREI — statistics page shows real data: - Replaced dashed-border placeholder with 6 real stat cards - Queries waters, species, stocking, catch_books, leases, permits - Shows counts + stocking costs + pending catch books - Falls back to helpful message when no data exists VERBAND — statistics page shows real KPIs: - Added server-side data fetching (clubs, members, fees) - Passes activeClubs, totalMembers, openFees as props - Added 4 KPI cards: Aktive Vereine, Gesamtmitglieder, ∅ Mitglieder/Verein, Offene Beiträge - Kept existing trend charts below KPI cards
This commit is contained in:
@@ -14,6 +14,7 @@ import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ account: string }>;
|
||||
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
||||
}
|
||||
|
||||
const WEEKDAYS = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'];
|
||||
@@ -51,8 +52,9 @@ function isDateInRange(
|
||||
return date >= checkIn && date < checkOut;
|
||||
}
|
||||
|
||||
export default async function BookingCalendarPage({ params }: PageProps) {
|
||||
export default async function BookingCalendarPage({ params, searchParams }: PageProps) {
|
||||
const { account } = await params;
|
||||
const search = await searchParams;
|
||||
const t = await getTranslations('bookings');
|
||||
const client = getSupabaseServerClient();
|
||||
|
||||
@@ -73,8 +75,15 @@ export default async function BookingCalendarPage({ params }: PageProps) {
|
||||
const api = createBookingManagementApi(client);
|
||||
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
const year = Number(search.year) || now.getFullYear();
|
||||
const month = search.month != null ? Number(search.month) - 1 : now.getMonth();
|
||||
|
||||
// Compute prev/next month for navigation links
|
||||
const prevMonth = month === 0 ? 12 : month;
|
||||
const prevYear = month === 0 ? year - 1 : year;
|
||||
const nextMonth = month === 11 ? 1 : month + 2;
|
||||
const nextYear = month === 11 ? year + 1 : year;
|
||||
|
||||
const daysInMonth = getDaysInMonth(year, month);
|
||||
const firstWeekday = getFirstWeekday(year, month);
|
||||
|
||||
@@ -160,10 +169,12 @@ export default async function BookingCalendarPage({ params }: PageProps) {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
disabled
|
||||
asChild
|
||||
aria-label={t('calendar.previousMonth')}
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" aria-hidden="true" />
|
||||
<Link href={`/home/${account}/bookings/calendar?year=${prevYear}&month=${prevMonth}`}>
|
||||
<ChevronLeft className="h-4 w-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</Button>
|
||||
<CardTitle>
|
||||
{MONTH_NAMES[month]} {year}
|
||||
@@ -171,10 +182,12 @@ export default async function BookingCalendarPage({ params }: PageProps) {
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
disabled
|
||||
asChild
|
||||
aria-label={t('calendar.nextMonth')}
|
||||
>
|
||||
<ChevronRight className="h-4 w-4" aria-hidden="true" />
|
||||
<Link href={`/home/${account}/bookings/calendar?year=${nextYear}&month=${nextMonth}`}>
|
||||
<ChevronRight className="h-4 w-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user