More audit cleanup: shared route cache helper, url columns, tab keys

- One CACHE and json() in shape.js for the seven public route files
- A url column type: link fields (13 of them) refuse javascript:, data:
  and any other scheme on save, not only when drawn
- The chapter map's logo uses the shared Logo component
- Schedule tabs take Home and End as well as the arrows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-29 02:02:24 -05:00
parent 1c94ffb281
commit d1a6332a45
12 changed files with 66 additions and 75 deletions

View file

@ -3,6 +3,7 @@ import { useCommunity } from "../../lib/chapters.ts";
import { Link } from "react-router-dom";
import ArrowLink from "../../components/ArrowLink.tsx";
import { mediaUrl } from "../../lib/media.ts";
import Logo from "../../components/Logo.tsx";
import { initialsFor, orgPath } from "../../lib/organizations.ts";
import { AREAS, AREA_NAMES } from "../../data/mapGrid.ts";
import { withAlpha, accentText, readableOn } from '../../lib/color.ts'
@ -466,29 +467,23 @@ function RegionBlock({
color. Selecting another card swaps the panel's contents.
═══════════════════════════════════════════════════════════════ */
/* Logo, or the organization's initials when there's no file. */
/* Logo, or the organization's initials when there's no file or it
fails to load. Decorative: the name is right beside it. */
function OrgLogo({ org, color, size = "h-14 w-14" }) {
const [failed, setFailed] = useState(false);
if (org.logo && !failed) {
return (
<img
src={mediaUrl(org.logo) ?? undefined}
alt={org.name}
onError={() => setFailed(true)}
className={`${size} object-contain rounded-xl shrink-0`}
/>
);
}
return (
<div
className={`${size} rounded-xl shrink-0 flex items-center justify-center font-extrabold`}
style={{ border: `1px solid ${color}`, color }}
aria-label={org.name}
>
{initialsFor(org.name)}
</div>
<Logo
src={mediaUrl(org.logo)}
className={`${size} object-contain rounded-xl shrink-0`}
fallback={
<div
className={`${size} rounded-xl shrink-0 flex items-center justify-center font-extrabold`}
style={{ border: `1px solid ${color}`, color: accentText(color) }}
aria-hidden="true"
>
{initialsFor(org.name)}
</div>
}
/>
);
}