feat(cms): localize legal pages with a lossless migration (MITHOME-112)
Legal page title, last-updated text and section titles/contents become
localized; slug and section ids stay shared. A Payload migration wraps
existing values into { hu: value } on every legal page and its whole
version history, like the globals migration (MITHOME-111).
The migration helper now handles collections as well as globals
(rewriteDocs) and can scope version rewrites to the latest working copy,
which the upcoming English import needs. Migration tests share an
in-memory Mongo fake that honours query filters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ef93cec935
commit
0eb6594acc
@@ -12,6 +12,11 @@ import { collectionVersions } from '../lib/payload-versions'
|
||||
* valódi Markdown- vagy richText-parserrel. Ugyanaz a döntés, mint a
|
||||
* Contact global gdpr.label mezőjénél (MITHOME-87) — a bootstrap szinten
|
||||
* nem vezetünk be külön szerializációt egy még nem létező render-rétegért.
|
||||
*
|
||||
* MITHOME-112 lokalizáció: a cím, a dátumszöveg és a szakaszok címe/tartalma
|
||||
* lokalizált; a `slug` (URL-azonosító) és a szakasz-`id` közös, a `sections`
|
||||
* tömb maga is közös (sorrend nyelvenként azonos). A meglévő adatot a
|
||||
* src/migrations/20260929_localize_legal_pages.ts alakítja át.
|
||||
*/
|
||||
export const LegalPages: CollectionConfig = {
|
||||
slug: 'legal-pages',
|
||||
@@ -30,11 +35,12 @@ export const LegalPages: CollectionConfig = {
|
||||
description: 'URL-azonosító, pl. "adatvedelem" vagy "hasznalati-feltetelek".',
|
||||
},
|
||||
},
|
||||
{ name: 'title', type: 'text', required: true },
|
||||
{ name: 'title', type: 'text', required: true, localized: true },
|
||||
{
|
||||
name: 'lastUpdated',
|
||||
type: 'text',
|
||||
required: true,
|
||||
localized: true,
|
||||
admin: {
|
||||
description: 'Szabad szöveg (pl. "2026. augusztus 22."), nem dátum mező — így marad a JSON forrással kompatibilis.',
|
||||
},
|
||||
@@ -45,8 +51,8 @@ export const LegalPages: CollectionConfig = {
|
||||
required: true,
|
||||
fields: [
|
||||
{ name: 'id', type: 'text', required: true },
|
||||
{ name: 'title', type: 'text', required: true },
|
||||
{ name: 'content', type: 'textarea', required: true },
|
||||
{ name: 'title', type: 'text', required: true, localized: true },
|
||||
{ name: 'content', type: 'textarea', required: true, localized: true },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user