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:
parent
1c94ffb281
commit
d1a6332a45
12 changed files with 66 additions and 75 deletions
|
|
@ -43,6 +43,8 @@ import { THEME_TOKENS, checkTheme } from "./theme.js";
|
|||
/* ── Column helpers ──────────────────────────────────────────── */
|
||||
|
||||
const text = (name, opts = {}) => ({ name, type: "text", ...opts });
|
||||
// Text that is a link: refuses javascript:, data: and other schemes.
|
||||
const url = (name, opts = {}) => ({ name, type: "url", ...opts });
|
||||
const int = (name, opts = {}) => ({ name, type: "int", ...opts });
|
||||
const real = (name, opts = {}) => ({ name, type: "real", ...opts });
|
||||
const bool = (name, opts = {}) => ({ name, type: "bool", ...opts });
|
||||
|
|
@ -95,7 +97,7 @@ const timelineFields = [
|
|||
text("title"),
|
||||
text("blurb"),
|
||||
text("meta"),
|
||||
text("link_url"),
|
||||
url("link_url"),
|
||||
bool("is_featured"),
|
||||
bool("is_published"),
|
||||
int("sort_order"),
|
||||
|
|
@ -138,7 +140,7 @@ const featuredCardsChild = (ownerKind) => ({
|
|||
enumeration("kind", ["record", "link", "video"], { required: true }),
|
||||
enumeration("ref_kind", ["event", "organization", "person", "team", "award"]),
|
||||
text("ref_id"),
|
||||
text("url"),
|
||||
url("url"),
|
||||
text("eyebrow"),
|
||||
text("title"),
|
||||
text("blurb"),
|
||||
|
|
@ -158,7 +160,7 @@ const linksChild = (ownerKind) => ({
|
|||
}),
|
||||
text("platform"),
|
||||
text("label", { required: true }),
|
||||
text("url", { required: true }),
|
||||
url("url", { required: true }),
|
||||
bool("is_primary"),
|
||||
],
|
||||
});
|
||||
|
|
@ -190,7 +192,7 @@ const blocksChild = (ownerKind) => ({
|
|||
),
|
||||
text("text"),
|
||||
text("media"),
|
||||
text("href"),
|
||||
url("href"),
|
||||
text("alt"),
|
||||
text("cite"),
|
||||
],
|
||||
|
|
@ -203,7 +205,7 @@ const blocksChild = (ownerKind) => ({
|
|||
columns: [
|
||||
text("text", { required: true }),
|
||||
text("detail"),
|
||||
text("url"),
|
||||
url("url"),
|
||||
// Schedule entries only (034_schedule_block.sql).
|
||||
text("day"),
|
||||
text("time"),
|
||||
|
|
@ -731,13 +733,13 @@ const frontPage = {
|
|||
text("headline"),
|
||||
text("subhead"),
|
||||
text("primary_label"),
|
||||
text("primary_url"),
|
||||
url("primary_url"),
|
||||
text("secondary_label"),
|
||||
text("secondary_url"),
|
||||
url("secondary_url"),
|
||||
int("slide_seconds"),
|
||||
text("livestream_url"),
|
||||
url("livestream_url"),
|
||||
text("livestream_title"),
|
||||
text("video_url"),
|
||||
url("video_url"),
|
||||
text("video_title"),
|
||||
text("countdown_event_id"),
|
||||
text("countdown_scope_id"),
|
||||
|
|
@ -754,7 +756,7 @@ const frontPage = {
|
|||
text("media", { required: true }),
|
||||
text("alt"),
|
||||
text("caption"),
|
||||
text("link_url"),
|
||||
url("link_url"),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -812,7 +814,7 @@ const frontPage = {
|
|||
columns: [
|
||||
text("label", { required: true }),
|
||||
text("description"),
|
||||
text("url", { required: true }),
|
||||
url("url", { required: true }),
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
@ -888,7 +890,7 @@ const communityPage = {
|
|||
int("internal_slots"),
|
||||
text("external_title"),
|
||||
int("external_slots"),
|
||||
text("external_url"),
|
||||
url("external_url"),
|
||||
text("external_label"),
|
||||
],
|
||||
|
||||
|
|
@ -906,7 +908,7 @@ const communityPage = {
|
|||
table: "community_page_feeds",
|
||||
owner: { column: "page_id" },
|
||||
order: "sort_order",
|
||||
columns: [text("url", { required: true }), text("label")],
|
||||
columns: [url("url", { required: true }), text("label")],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue