mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
04f2ec72c6
Add "guest" trip participants — people without a Trek account who can still be assigned to costs, packing, to-dos and day-plan activities. A guest is a credential-less users row (is_guest=1) joined into trip_members, so it is assignable everywhere a real member is, with the cost-splitting, settlement, packing and assignment paths working unchanged. Guests are firewalled from everything account-related: they can never sign in (password, OIDC and reset lookups skip them), never appear in the global user directory, the member-add picker or admin user management, are never resolved as notification recipients, can't be invited to another trip, and can't be made owner. The trip owner manages guests from the share dialog in a dedicated, clearly-labelled section (add / rename / remove), and guests carry a "Guest" badge wherever members are picked. All 22 locales stay in parity.
25 lines
914 B
TypeScript
25 lines
914 B
TypeScript
// Pure constants + helpers + types for the todo list. No React, no side effects.
|
|
|
|
export const KAT_COLORS = [
|
|
'#3b82f6', '#a855f7', '#ec4899', '#22c55e', '#f97316',
|
|
'#06b6d4', '#ef4444', '#eab308', '#8b5cf6', '#14b8a6',
|
|
]
|
|
|
|
export const PRIO_CONFIG: Record<number, { label: string; color: string }> = {
|
|
1: { label: 'P1', color: '#ef4444' },
|
|
2: { label: 'P2', color: '#f59e0b' },
|
|
3: { label: 'P3', color: '#3b82f6' },
|
|
}
|
|
|
|
export function katColor(kat: string, allCategories: string[]) {
|
|
const idx = allCategories.indexOf(kat)
|
|
if (idx >= 0) return KAT_COLORS[idx % KAT_COLORS.length]
|
|
let h = 0
|
|
for (let i = 0; i < kat.length; i++) h = ((h << 5) - h + kat.charCodeAt(i)) | 0
|
|
return KAT_COLORS[Math.abs(h) % KAT_COLORS.length]
|
|
}
|
|
|
|
export type FilterType = 'all' | 'my' | 'overdue' | 'done' | string
|
|
|
|
export interface Member { id: number; username: string; avatar: string | null; is_guest?: boolean }
|