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 -2
View File
@@ -14,7 +14,7 @@ import { addToCookieList } from './sync.js'
/**
* One approval for everything a scan or crawl found: the "Approve cookies" view
* lists what is waiting, grouped by consent category, and one button adds the
* ticked cookies to Cookie banner → Cookies — which feeds the cookie banner's
* ticked cookies to Cookies → Cookies — which feeds the cookie banner's
* detailed window and the cookie policy table. Nothing is added before that.
*/
export const COOKIE_APPROVAL_PATH = '/ipal/cookie-approval'
@@ -102,7 +102,7 @@ export async function countPendingCookies(payload: BasePayload): Promise<number>
/**
* Approves pending entries (all of them, or only `ids`): each becomes accepted
* and goes to Cookie banner → Cookies in every locale — a missing row is added,
* and goes to Cookies → Cookies in every locale — a missing row is added,
* an existing one (same name or pattern) only gets its empty text filled, its
* category is kept. A cookie without a category gets `unknownCategory` (needs
* consent) and every cookie without a purpose is flagged "Needs description".