Archived
Staff, supervisor and admin dashboards start with what's on today (checked in vs places, children in now, volunteers here; money in today and this week for supervisors) and, for supervisors and admins, what's waiting for someone (unpaid registrations, consent, waitlists, cover requests, roster gaps; for admins cashups, reconciling, privacy requests, failed webhooks), each linking to where it's dealt with. Ctrl+K opens a palette of pages, settings, reports and actions for the role, with search: events, payments by amount, people and registrations (admins). All campus-scoped. Bulk actions and saved filters follow as 1.49.1 and 1.49.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69 lines
6.2 KiB
TypeScript
69 lines
6.2 KiB
TypeScript
// What the Ctrl+K command palette can jump to without searching (1.49.0): pages, settings tabs,
|
|
// reports and quick actions, each for the roles that can open it. `keywords` widen matching.
|
|
|
|
export type Role = "staff" | "supervisor" | "admin";
|
|
export type CommandPage = { label: string; href: string; group: "Actions" | "Pages" | "Settings" | "Reports"; roles: Role[]; keywords?: string };
|
|
|
|
const S: Role[] = ["staff", "supervisor", "admin"];
|
|
const SUP: Role[] = ["supervisor", "admin"];
|
|
const ADM: Role[] = ["admin"];
|
|
|
|
export const COMMAND_PAGES: CommandPage[] = [
|
|
// Actions
|
|
{ group: "Actions", label: "New event", href: "/dashboard/supervisor/events?new=1", roles: SUP, keywords: "create add event" },
|
|
{ group: "Actions", label: "Register someone (manual registration)", href: "/dashboard/supervisor/manual", roles: SUP, keywords: "add registration walk-in guest" },
|
|
{ group: "Actions", label: "Scan tickets", href: "/dashboard/staff/ticket-scanning", roles: S, keywords: "scanner check in qr door" },
|
|
{ group: "Actions", label: "Kids check-in desk", href: "/dashboard/staff/kids", roles: S, keywords: "children pickup code" },
|
|
{ group: "Actions", label: "Record a payment", href: "/dashboard/supervisor/payments", roles: SUP, keywords: "cash eft donation pay" },
|
|
{ group: "Actions", label: "Email attendees", href: "/dashboard/supervisor/email-attendees", roles: SUP, keywords: "message send mail" },
|
|
{ group: "Actions", label: "WhatsApp attendees", href: "/dashboard/supervisor/whatsapp-attendees", roles: SUP, keywords: "message send" },
|
|
// Pages
|
|
{ group: "Pages", label: "Events", href: "/dashboard/supervisor/events", roles: SUP, keywords: "manage edit copy" },
|
|
{ group: "Pages", label: "Event series", href: "/dashboard/supervisor/series", roles: SUP, keywords: "season pass follow" },
|
|
{ group: "Pages", label: "Registrations", href: "/dashboard/admin/registrations", roles: ADM, keywords: "orders cancel status" },
|
|
{ group: "Pages", label: "Users", href: "/dashboard/admin/users", roles: ADM, keywords: "people accounts roles" },
|
|
{ group: "Pages", label: "At the door", href: "/dashboard/supervisor/at-the-door", roles: SUP, keywords: "walk-ins print" },
|
|
{ group: "Pages", label: "Payments & donations", href: "/dashboard/supervisor/payments", roles: SUP, keywords: "reconcile yoco payfast" },
|
|
{ group: "Pages", label: "Cashup", href: "/dashboard/admin/cashup", roles: ADM, keywords: "close costs reconcile takings" },
|
|
{ group: "Pages", label: "Rooms & groups", href: "/dashboard/supervisor/allocations", roles: SUP, keywords: "allocations cabins buses" },
|
|
{ group: "Pages", label: "Attendance register", href: "/dashboard/supervisor/attendance", roles: S, keywords: "sessions certificates" },
|
|
{ group: "Pages", label: "Waitlist", href: "/dashboard/supervisor/waitlist", roles: S, keywords: "sold out offers" },
|
|
{ group: "Pages", label: "Parental consent", href: "/dashboard/supervisor/consent", roles: S, keywords: "youth medical" },
|
|
{ group: "Pages", label: "Volunteer rosters", href: "/dashboard/supervisor/volunteers", roles: SUP, keywords: "serving roles cover" },
|
|
{ group: "Pages", label: "Volunteers today", href: "/dashboard/staff/volunteers", roles: S, keywords: "serving check-in qr" },
|
|
{ group: "Pages", label: "Kids check-in setup", href: "/dashboard/supervisor/kids", roles: SUP, keywords: "rooms ratios" },
|
|
{ group: "Pages", label: "Kids room screen", href: "/dashboard/staff/kids/rooms", roles: S, keywords: "children leaders on duty" },
|
|
{ group: "Pages", label: "Coupon codes", href: "/dashboard/supervisor/coupons", roles: SUP, keywords: "discount" },
|
|
{ group: "Pages", label: "Bundle deals", href: "/dashboard/supervisor/bundles", roles: SUP, keywords: "family deal" },
|
|
{ group: "Pages", label: "Event tickets & printing", href: "/dashboard/staff/event-tickets", roles: S, keywords: "print list" },
|
|
{ group: "Pages", label: "Offline scanning", href: "/dashboard/supervisor/offline-scans", roles: SUP, keywords: "devices sync" },
|
|
{ group: "Pages", label: "Attendee forms", href: "/dashboard/admin/forms", roles: ADM, keywords: "answers" },
|
|
{ group: "Pages", label: "Audit log", href: "/dashboard/admin/audit-log", roles: ADM, keywords: "history who changed" },
|
|
{ group: "Pages", label: "Privacy (POPIA)", href: "/dashboard/admin/privacy", roles: ADM, keywords: "notice operators retention breaches readiness" },
|
|
{ group: "Pages", label: "Privacy requests", href: "/dashboard/admin/data-requests", roles: ADM, keywords: "delete download correction popia" },
|
|
{ group: "Pages", label: "My profile & security", href: "/dashboard/user/profile", roles: S, keywords: "password two-factor" },
|
|
// Settings
|
|
...([
|
|
["organisation", "Organisation"], ["campuses", "Campuses"], ["branding", "Branding"], ["notifications", "Notifications"],
|
|
["email", "Email"], ["legal", "Legal"], ["whatsapp", "WhatsApp"], ["payments", "Payments"], ["webhooks", "Webhooks"],
|
|
["backups", "Backups"], ["jobs", "Background jobs"], ["licence", "Licence & updates"],
|
|
] as const).map(([tab, label]): CommandPage => ({ group: "Settings", label: `Settings: ${label}`, href: `/dashboard/admin/settings?tab=${tab}`, roles: ADM, keywords: "site settings" })),
|
|
// Reports
|
|
...([
|
|
["payments", "Payments between dates"], ["revenue", "Revenue summary"], ["regStatus", "Registration status"],
|
|
["funnel", "Registration funnel"], ["feedbackSummary", "Feedback summary"], ["usage", "Ticket usage"],
|
|
["financeReport", "Finance report"], ["seriesComparison", "Series: year on year"], ["discounts", "Discounts"],
|
|
] as const).map(([key, label]): CommandPage => ({ group: "Reports", label: `Report: ${label}`, href: `/dashboard/supervisor/reports?report=${key}`, roles: SUP, keywords: "report" })),
|
|
];
|
|
|
|
/** Pages for a role, matching every word of the query (in the label or keywords). */
|
|
export function matchPages(role: string, query: string): CommandPage[] {
|
|
const r = (["staff", "supervisor", "admin"].includes(role) ? role : null) as Role | null;
|
|
if (!r) return [];
|
|
const words = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
return COMMAND_PAGES.filter(p => p.roles.includes(r)).filter(p => {
|
|
const hay = `${p.label} ${p.keywords || ""} ${p.group}`.toLowerCase();
|
|
return words.every(w => hay.includes(w));
|
|
});
|
|
}
|