- The colour defaults have one source, server/src/themeDefaults.js, read by the server and the admin; the build stops if src/index.css disagrees with it - server/src/admin-schema.js split into admin-schema/, one file per entity plus columns.js (the registry checked identical) - loadOwned() in shape.js replaces the same three loads on four detail routes (every public route checked identical); one NO_STORE - One OrgLogo component for the org lists and the chapter map; an organization's own page now shows the same initials as the lists - One localISO() for the viewer's calendar day, in place of three - Boot refuses a descriptor dropdown value the table's CHECK doesn't allow, instead of it failing on save - Deleted the unused Other.tsx and white-background logo; chapters.ts is useCommunity.ts; isSuper() in the Panel; stale comments and docs corrected Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
2.1 KiB
JavaScript
86 lines
2.1 KiB
JavaScript
import { text, int, real, bool, enumeration, placeColumns, timelineExtension, linksChild, blocksChild } from "./columns.js";
|
|
|
|
/* ── Organizations ───────────────────────────────────────────── */
|
|
|
|
export const organizations = {
|
|
key: "organizations",
|
|
table: "organizations",
|
|
idColumn: "id",
|
|
idKind: "slug",
|
|
concurrency: "updated_at",
|
|
|
|
list: {
|
|
columns: [
|
|
"id",
|
|
"kind",
|
|
"name",
|
|
"short_name",
|
|
"locality",
|
|
"state_code",
|
|
"is_published",
|
|
"is_listed",
|
|
"sort_order",
|
|
"updated_at",
|
|
],
|
|
filters: ["kind", "is_published", "is_listed"],
|
|
search: ["name", "id", "locality"],
|
|
order: "kind, sort_order, name",
|
|
},
|
|
|
|
columns: [
|
|
enumeration("kind", ["national", "region", "chapter", "partner"], {
|
|
required: true,
|
|
}),
|
|
text("name", { required: true }),
|
|
text("short_name"),
|
|
text("tagline"),
|
|
text("color"),
|
|
text("logo"),
|
|
...placeColumns,
|
|
bool("is_published"),
|
|
bool("is_listed"),
|
|
int("sort_order"),
|
|
bool("in_timeline"),
|
|
],
|
|
|
|
extensions: [
|
|
timelineExtension("organization"),
|
|
{
|
|
key: "region",
|
|
table: "regions",
|
|
idColumn: "id",
|
|
when: { column: "kind", value: "region" },
|
|
columns: [
|
|
enumeration("scope", ["domestic", "international", "virtual"], {
|
|
required: true,
|
|
}),
|
|
text("map_note"),
|
|
],
|
|
},
|
|
{
|
|
key: "chapter",
|
|
table: "chapters",
|
|
idColumn: "id",
|
|
when: { column: "kind", value: "chapter" },
|
|
columns: [text("region_id"), text("meets"), text("started")],
|
|
},
|
|
],
|
|
|
|
children: [
|
|
linksChild("organization"),
|
|
blocksChild("organization"),
|
|
{
|
|
key: "region_areas",
|
|
table: "region_areas",
|
|
owner: { column: "region_id" },
|
|
when: { column: "kind", value: "region" },
|
|
order: "area_code",
|
|
columns: [
|
|
text("area_code", { required: true }),
|
|
real("share"),
|
|
enumeration("edge", ["top", "bottom"]),
|
|
text("note"),
|
|
],
|
|
},
|
|
],
|
|
};
|