Tidy the structure the audit found
- 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>
This commit is contained in:
parent
048c7599ce
commit
f934b1dd93
44 changed files with 1187 additions and 1170 deletions
58
server/src/admin-schema/siteSettings.js
Normal file
58
server/src/admin-schema/siteSettings.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
import { THEME_TOKENS, checkTheme } from "../theme.js";
|
||||
import { text, enumeration } from "./columns.js";
|
||||
|
||||
/* ── Site settings (035_site_settings.sql) ──────────────────────
|
||||
A singleton of overrides for what site.json says: name,
|
||||
description, preview image, icons, search indexing, and static
|
||||
pages' titles and intros. Superadmins only. pageMeta.js merges it
|
||||
over site.json. */
|
||||
export const siteSettings = {
|
||||
key: "site_settings",
|
||||
table: "site_settings",
|
||||
idColumn: "id",
|
||||
idKind: "slug",
|
||||
singleton: "site",
|
||||
concurrency: "updated_at",
|
||||
writeRole: "superadmin",
|
||||
|
||||
list: {
|
||||
columns: ["id", "site_name", "updated_at"],
|
||||
filters: [],
|
||||
search: [],
|
||||
order: "id",
|
||||
},
|
||||
|
||||
columns: [
|
||||
text("site_name"),
|
||||
text("description"),
|
||||
text("preview_image"),
|
||||
text("favicon"),
|
||||
text("apple_touch_icon"),
|
||||
enumeration("indexing", ["on", "off"]),
|
||||
text("privacy_email"),
|
||||
],
|
||||
|
||||
children: [
|
||||
{
|
||||
key: "pages",
|
||||
table: "site_setting_pages",
|
||||
owner: { column: "settings_id" },
|
||||
order: "sort_order",
|
||||
columns: [text("path", { required: true }), text("title"), text("description")],
|
||||
},
|
||||
{
|
||||
key: "colors",
|
||||
table: "site_setting_colors",
|
||||
owner: { column: "settings_id" },
|
||||
order: "sort_order",
|
||||
columns: [
|
||||
enumeration("token", THEME_TOKENS, { required: true }),
|
||||
text("light"),
|
||||
text("dark"),
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
// Refuses a palette that would make text hard to read (theme.js).
|
||||
check: checkTheme,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue