feat(cms): English translation status with a public gate (MITHOME-113)
Every page global and legal page gets a shared "English translation status" sidebar field (none / AI draft awaiting review / approved). The content adapter reads through readGated(): an English page renders English text only when its translation is approved, otherwise the Hungarian text of the same page, while links keep resolving to /en/... Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0eb6594acc
commit
32b6643fbc
@@ -221,3 +221,21 @@ describe('Payload globals', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('MITHOME-113 English translation status', () => {
|
||||
it.each([Home, About, Services, Contact, Common, LegalPages].map((d) => [d.slug, d] as const))(
|
||||
'should give %s a shared sidebar status that defaults to "none"',
|
||||
(_slug, doc) => {
|
||||
const field = findField(doc.fields, 'enTranslationStatus') as unknown as {
|
||||
type: string
|
||||
localized?: boolean
|
||||
defaultValue: string
|
||||
options: { value: string }[]
|
||||
admin: { position: string }
|
||||
}
|
||||
expect(field).toMatchObject({ type: 'select', defaultValue: 'none', admin: { position: 'sidebar' } })
|
||||
expect(field.localized).toBeUndefined()
|
||||
expect(field.options.map((o) => o.value)).toEqual(['none', 'ai-draft', 'approved'])
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user