Page management, step 2: the core pages as sections
Migrations 081 and 082: Feedback, Request, QR codes, Give, Privacy and Terms become pages of sections. Their forms and embeds are section types any page can use; Give's words and all of Privacy and Terms become blocks. The privacy contact email is written into the policy and its setting goes. Core pages keep their address and can't be deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1342691f49
commit
f33c0008fe
27 changed files with 298 additions and 645 deletions
|
|
@ -20,7 +20,12 @@ const PRESETS = {
|
|||
partner_list: "Organization cards (partners, ministries)",
|
||||
events: "Event carousel or grid",
|
||||
timeline: "Timeline",
|
||||
people_directory: "People directory (a tag's people)",
|
||||
people_directory: "People directory (tabs of people tags)",
|
||||
feedback_form: "Website feedback form",
|
||||
request_form: "Request form",
|
||||
data_request_form: "Data request form (see, correct or delete)",
|
||||
giving: "Giving button (Church Center)",
|
||||
qr_maker: "QR code maker",
|
||||
};
|
||||
|
||||
const ACCENT_OPTIONS = [
|
||||
|
|
@ -166,10 +171,10 @@ const sectionsChild = (presets: string[]) => ({
|
|||
const COMMUNITY = { path: "id", value: "community" };
|
||||
const ALL_PRESETS = Object.keys(PRESETS);
|
||||
|
||||
/* The pages the site draws in code (src/pages/fixedPages.ts, and the
|
||||
front page): no sections of their own yet. */
|
||||
export const FIXED_PAGE_IDS = ["home", "give", "feedback", "request", "qr", "privacy", "terms"];
|
||||
const isFixed = (row) => FIXED_PAGE_IDS.includes(row?.id);
|
||||
/* Pages the site's own code links to: their address stays
|
||||
(server/src/admin-schema/sitePages.js, CORE_PAGES). */
|
||||
const CORE_PAGE_IDS = ["home", "give", "feedback", "request", "qr", "privacy", "terms"];
|
||||
const isHome = (row) => row?.id === "home";
|
||||
|
||||
const communityGroups = (groups) => groups.map((group) => ({ ...group, when: COMMUNITY }));
|
||||
const communityChildren = (children) => children.map((child) => ({ ...child, when: COMMUNITY }));
|
||||
|
|
@ -202,7 +207,11 @@ export const pages = {
|
|||
path: "path",
|
||||
label: "Address",
|
||||
required: true,
|
||||
help: "Where it lives on the site, eg. /library. Lowercase letters, numbers, hyphens and /. Changing it breaks old links: update Navigation's too.",
|
||||
help: (row) =>
|
||||
CORE_PAGE_IDS.includes(row?.id)
|
||||
? "The site's own links point here, so this page's address stays."
|
||||
: "Where it lives on the site, eg. /library. Lowercase letters, numbers, hyphens and /. Changing it breaks old links: update Navigation's too.",
|
||||
readOnly: (row) => CORE_PAGE_IDS.includes(row?.id),
|
||||
},
|
||||
{ path: "description", label: "Intro", widget: "textarea", full: true, help: "The line under the title, and its description in search." },
|
||||
{
|
||||
|
|
@ -223,13 +232,7 @@ export const pages = {
|
|||
{
|
||||
legend: "Its content",
|
||||
note: "The front page's content is edited in Pages → Front page: its hero, and the bands it shows.",
|
||||
when: { test: (row) => row?.id === "home" },
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
legend: "Its content",
|
||||
note: "This page's content is built into the site (a form, an embed or set text), so it has no sections to edit here yet. Its title, intro, address and switches above are yours.",
|
||||
when: { test: (row) => isFixed(row) && row?.id !== "home" },
|
||||
when: { test: isHome },
|
||||
fields: [],
|
||||
},
|
||||
...communityGroups(
|
||||
|
|
@ -257,7 +260,7 @@ export const pages = {
|
|||
],
|
||||
|
||||
children: [
|
||||
{ ...sectionsChild(ALL_PRESETS), when: { test: (row) => !isFixed(row) } },
|
||||
{ ...sectionsChild(ALL_PRESETS), when: { test: (row) => !isHome(row) } },
|
||||
...communityChildren(
|
||||
[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -110,18 +110,6 @@ export const siteSettings = {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
legend: "Privacy",
|
||||
fields: [
|
||||
{
|
||||
path: "privacy_email",
|
||||
label: "Privacy contact email",
|
||||
help: `The Privacy page gives this for privacy questions and data requests, eg. privacy@nextgenerationofunity.org. ${
|
||||
siteConfiguration.privacyEmail ? `Default: ${siteConfiguration.privacyEmail}` : "Default: none, the page offers its request form only"
|
||||
}.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
legend: "Access (Google groups)",
|
||||
note: "Anyone in one of these Workspace groups can sign in to the admin with Google; their account is made at first sign-in, with the highest role their groups give. Their role follows the groups (checked at sign-in, hourly, and by Panel → Re-sync now); out of every group, the account is disabled. Superadmins and accounts made with admin-cli aren't affected. Needs GOOGLE_DIRECTORY_AS on the server (docs/google-sign-in.md).",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
import siteConfiguration from '../../site.json'
|
||||
|
||||
type SiteText = { title?: string; privacyEmail?: string; requestFiles?: boolean }
|
||||
type SiteText = { title?: string; requestFiles?: boolean }
|
||||
|
||||
/* What the server wrote into the page, if it did. */
|
||||
const fromServer: SiteText =
|
||||
|
|
@ -33,10 +33,6 @@ export const SITE_NAME: string = fromServer.title || siteConfiguration.title
|
|||
|
||||
export const SITE_ORIGIN: string = siteConfiguration.url
|
||||
|
||||
/** Where privacy questions and data requests go (Panel → Site
|
||||
* settings, else site.json). Blank: the Privacy page's form only. */
|
||||
export const PRIVACY_EMAIL: string = fromServer.privacyEmail ?? siteConfiguration.privacyEmail
|
||||
|
||||
/** Whether the Request form takes files (Google Drive is set up on
|
||||
* the server). Unknown (the Vite dev server) offers them, and the
|
||||
* server says so if it can't. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue