Call local chapters groups, everywhere
The organization kind is 'group', its side table is groups, pages live at /groups/<id> and the Community page's section is #groups. Migration 052 converts existing databases: the kind and the tables whose CHECKs name chapters are rebuilt, the front page count and request category follow, and the site's own /chapters/ and #chapters links in records are rewritten. Request files now go in Requests/Groups on the shared drive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
175a18976d
commit
38aff34c97
42 changed files with 473 additions and 254 deletions
|
|
@ -5,7 +5,7 @@
|
|||
never sends paths, it sends `{ kind, id }` and, for an
|
||||
organization, the `org_kind` that decides which of the three
|
||||
routes a slug belongs to. Deciding that in each component is how
|
||||
/regions/x and /chapters/x end up both existing for the same
|
||||
/regions/x and /groups/x end up both existing for the same
|
||||
record, and how the history timeline ended up emitting /event/:id
|
||||
while the router only knew /retreats/:id.
|
||||
|
||||
|
|
@ -30,16 +30,16 @@
|
|||
detailPath() returns null for it, so useRecord never fetches it.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
export type OrgKind = 'national' | 'region' | 'chapter' | 'partner'
|
||||
export type OrgKind = 'national' | 'region' | 'group' | 'partner'
|
||||
export type RefKind = 'event' | 'organization' | 'team' | 'award' | 'person'
|
||||
|
||||
/* A region, a chapter and a partner read as different things to a
|
||||
/* A region, a group and a partner read as different things to a
|
||||
visitor even though they are one table, so they get one route
|
||||
each. 'national' is NGU itself, one record, no listing to sit
|
||||
under, so it falls through to the generic path. */
|
||||
const ORG_BASE: Record<string, string> = {
|
||||
region: '/regions',
|
||||
chapter: '/chapters',
|
||||
group: '/groups',
|
||||
partner: '/partners',
|
||||
national: '/organizations',
|
||||
}
|
||||
|
|
@ -152,14 +152,14 @@ export function refHref(
|
|||
}
|
||||
}
|
||||
|
||||
/* Where "back" goes from a record page. A chapter belongs to
|
||||
/* Where "back" goes from a record page. A group belongs to
|
||||
/community, a retreat to /retreats. */
|
||||
export function orgListHref(kind?: string | null): { to: string; label: string } {
|
||||
switch (kind) {
|
||||
case 'region':
|
||||
return { to: '/community#regions', label: 'All regions' }
|
||||
case 'chapter':
|
||||
return { to: '/community#chapters', label: 'All chapters' }
|
||||
case 'group':
|
||||
return { to: '/community#groups', label: 'All groups' }
|
||||
case 'partner':
|
||||
return { to: '/community#partners', label: 'All partner organizations' }
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue