NGU-Web/server/src/admin-schema/siteSettings.js
Aidan Dona e8aab4d7ec Planning Center: compare a People list with the site's people and apply what an admin picks
Migration 085 adds people.pco_id and Site settings' list. Data ->
Planning Center fetches the list, suggests matches (linked, same email,
same name), shows each field that would change (Planning Center wins),
and applies the chosen links, updates and new unpublished people in one
transaction. Needs PCO_APP_ID and PCO_SECRET.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:46:29 -05:00

63 lines
1.8 KiB
JavaScript

import { THEME_TOKENS, checkTheme } from "../theme.js";
import { text, int, enumeration } from "./columns.js";
/* ── Site settings (035_site_settings.sql) ──────────────────────
A singleton of overrides for what site.json says: name,
description, preview image, icons and search indexing (static
pages' titles and intros are Pages → Navigation's, siteNav.js).
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("notify_emails"),
text("access_group_viewer"),
text("access_group_editor"),
text("access_group_admin"),
enumeration("report_daily", ["on", "off"]),
enumeration("report_weekly", ["on", "off"]),
// Rotating words' defaults (084).
enumeration("word_motion", ["slide", "flip", "fade", "type", "mirror"]),
enumeration("word_direction", ["top", "bottom"]),
int("word_seconds"),
// Data → Planning Center's list (085).
text("pco_list_id"),
],
children: [
{
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,
};