Finish the audit leftovers

- One mediaUrl in media.ts instead of 12 identical aliases and a
  kind map; orgPath builds on hrefs.ts's orgHref
- One Logo component (hides itself or shows a fallback when the file
  is missing) for event cards, org lists and chapter marks
- useHistory is a thin wrapper over useRecord
- adminSchema.ts split into adminSchema/, one file per entity plus
  shared.ts; the registry is unchanged (checked by loading both)
- JS smooth scrolls respect reduced motion (lib/motion.ts)
- Content-Security-Policy in Report-Only, with /api/csp-report logging
  what it would block

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:49:07 -05:00
parent c74ad746f5
commit e4a9c96f7e
42 changed files with 1968 additions and 2043 deletions

View file

@ -23,6 +23,7 @@
fetch.
═══════════════════════════════════════════════════════════════ */
import { isBadId, orgHref } from "./hrefs.ts";
import { useResource } from "./useResource.ts";
@ -41,20 +42,15 @@ export function useOrganizations(kind) {
}
/* ── Where an organization's page lives ────────────────────────
One place to change when routes move. Kinds with no page of
their own return null, and a list should render no link rather
than a dead one.
The route is hrefs.ts's (orgHref). A list links only the kinds
with a page of their own, and renders no link rather than a dead
one for the rest (NGU itself) or a bad id.
───────────────────────────────────────────────────────────── */
const PATHS = {
region: "/regions",
chapter: "/chapters",
partner: "/partners",
};
const WITH_PAGE = new Set(["region", "chapter", "partner"]);
export function orgPath(org) {
const base = PATHS[org?.kind];
return base ? `${base}/${org.id}` : null;
return WITH_PAGE.has(org?.kind) && !isBadId(org.id) ? orgHref(org.id, org.kind) : null;
}
/* ── "AK, ID, MT, OR, UT (Salt Lake City area), WA" ────────────