Cookies: fill empty languages, and one Cookies entry in the admin

Every language filled (fillEmptyLocales, default on): text saved in one
language goes to every language where the same field is still empty, never
over a language's own text. Applies to the cookie list (purpose, duration)
and the cookie review (purpose, duration). Scanner and approval writes give
a language without its own text the default language's text. Building
blocks: buildFillEmptyLocalesGlobalHook / CollectionHook, fillEmptyLocales,
withFillLocales.

One Cookies entry (cookieScanner.adminLayout, default combined): the
Cookie banner global is now labelled Cookies and gets Review and approve
(scan box and approval list inline) and Site check tabs, built from ui
fields. Cookie review and Cookie check leave the navigation
(admin.group false) but keep their pages, data and API. This is
presentation only: no schema change and no migration, only
generate:importmap. adminLayout separate keeps the old layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-28 22:55:11 +01:00
co-authored by Claude Opus 5.5
parent a9e1adc03b
commit b10c2dc0e3
34 changed files with 812 additions and 96 deletions
+2 -1
View File
@@ -132,7 +132,8 @@ describe('cookie scanner against a real Payload', () => {
const pl = (await cookieList('pl')).filter((c) => c.name === '_ga')
expect(pl).toHaveLength(1)
expect(pl[0]).toMatchObject({ duration: '2 lata', provider: 'Google', purpose: 'Tekst redaktora' })
expect((await cookieList('en')).find((c) => c.name === '_ga')?.purpose).toContain('Google Analytics')
// The editor wrote Polish only; saving filled the empty English text from it (fillEmptyLocales) — the scan keeps it.
expect((await cookieList('en')).find((c) => c.name === '_ga')?.purpose).toBe('Tekst redaktora')
})
test('an entry without a category cannot be accepted', async () => {