Merge claude/graphql-enum-names: fix /api/graphql 500 (title separator enum names)
Site settings -> Title separator values are GraphQL enum names (pipe, endash, hyphen, middot, slash); legacy stored characters map on read and write, MongoDB is rewritten on init, Postgres projects add titleSeparatorSql() to the generated migration. test/graphqlSchema.test.ts builds the full schema. Merge resolution, docs/CHANGELOG.md (one Unreleased section): both new "What projects must update" items kept — 5 graphql-scalars override, 6 title separator SQL, plus a note that code reading settings.titleSeparator gets a name (titleSeparatorChar).
This commit is contained in:
@@ -629,6 +629,9 @@ Most routes and metadata are already ready in `createContentHelpers` (`generateP
|
||||
| `buildSummaryField(args?)` | `@intecion/ipal-kit` | Localized `aiSummary` field (auto-filled from content when empty) — a description for AI; then `summaryField: 'aiSummary'` in llms/search/MCP. |
|
||||
| `buildAutoFillMetaHook(mapping?)` | `@intecion/ipal-kit` | `beforeChange` hook that fills empty `meta.title`/`meta.description` from content. The plugin wires it itself on the `seo.collections` collections (option `seo.autoFill`) — do not call. |
|
||||
| `injectAutoFillMeta(config, seo)` | `@intecion/ipal-kit` | Injects the hook above into the SEO collections. The plugin wires it itself — do not call. |
|
||||
| `TITLE_SEPARATORS` | `@intecion/ipal-kit` | Site settings → Title separator: stored name → character (`{ pipe: '\|', endash: '–', hyphen: '-', middot: '·', slash: '/' }`). Type `TitleSeparatorName`. |
|
||||
| `titleSeparatorChar(value)` | `@intecion/ipal-kit` | Stored separator value → the character in the title. A name maps through `TITLE_SEPARATORS`; an old stored character (≤ 1.14.4) or a project's own option is returned as is. For a custom title builder. `readSiteMetaConfig` already uses it. |
|
||||
| `titleSeparatorSql({ table?, column?, direction? })` | `@intecion/ipal-kit` | SQL `UPDATE` that rewrites old separator characters to names (`'up'`) or back (`'down'`). Put it in the Postgres migration after `SET DATA TYPE text;` (ipal-upgrade, CHANGELOG). |
|
||||
| `SKIP_AUTO_FILL` | `@intecion/ipal-kit` | `'ipalSkipAutoFill'` — `context` key (`context: { [SKIP_AUTO_FILL]: true }`) that turns off meta auto-fill and the AI summary on save (migrations, scripts). |
|
||||
| `validateFaviconField` | `@intecion/ipal-kit` | `FieldHook` that logs a server warning when the favicon is < 48×48 or not square (never blocks the save). The plugin wires it itself on the favicon field in SiteSettings — call it only for your own favicon field. |
|
||||
| `DocumentTitle` | `@intecion/ipal-kit/admin` | Client component `{ title }`: sets the browser-tab title of a custom admin view after load, so it follows the admin language (Payload's view `meta.title` is one fixed string). Render it in your view with a translated title; the statistics view uses it. |
|
||||
|
||||
@@ -165,6 +165,17 @@ the panel title, description, `openGraph` or `robots: noindex` — the plugin no
|
||||
(keep any key you really want: your `admin.meta` keys win). The credit reads "Technology support: Intecion.com".
|
||||
Check: `curl -s $URL/admin/login | grep -E 'og:|robots'` and paste an `/admin` link in Slack.
|
||||
|
||||
**→ title separator / GraphQL fix (CHANGELOG Unreleased, item 5):** Site settings → Title separator now stores
|
||||
names (`pipe`, `endash`, `hyphen`, `middot`, `slash`) instead of `|`, `–`… (which broke `/api/graphql` with 500).
|
||||
**Postgres:** `pnpm payload migrate:create title-separator`, then in the generated file add
|
||||
`${sql.raw(titleSeparatorSql())}` right after the first `ALTER TABLE "site_settings" ALTER COLUMN "title_separator"
|
||||
SET DATA TYPE text;` in `up` and `${sql.raw(titleSeparatorSql({ direction: 'down' }))}` at the same place in `down`
|
||||
(`import { titleSeparatorSql } from '@intecion/ipal-kit'`). Without it the migration fails with `invalid input value
|
||||
for enum` and rolls back. **SQLite / MongoDB:** nothing required. Old values keep working, and MongoDB is rewritten
|
||||
at start. A project with its own separator options (`globalOverrides`): use values matching `/^[_A-Za-z][_A-Za-z0-9]*$/`.
|
||||
Check: `curl -s -X POST $URL/api/graphql -H 'content-type: application/json' -d '{"query":"{ SiteSetting { titleSeparator } }"}'` → 200,
|
||||
and the browser tab shows the same separator.
|
||||
|
||||
## 2. Inventory (no code changes)
|
||||
For **every** item in the PROGRAMISTA §6 table show evidence (grep / file) of whether
|
||||
it applies to the project. Run the **ipal-audit** skill (`--quick`) and attach the result.
|
||||
|
||||
Reference in New Issue
Block a user