Detailed cookie settings window (CookieBanner settings="detailed")
A third settings mode next to 'inline' and 'modal': a large dialog where every consent category is a card with its on/off control, description and an expandable list of the cookies it covers (name, provider, purpose, duration), taken from Cookie Settings → Cookies — the same rows as <CookieTable>. The developer picks the mode with one prop; the component default stays 'inline', so existing sites are unchanged. Cookie Settings gets a localized detailLabels group (list labels, English fallback); getConsentTexts passes texts.cookies and texts.details, sharing the row mapping with getCookieTable. New classNames slots and data-ipal handles for the cards and lists. Docs for devs and agents: consent.md (modes compared, which to pick — new projects default to 'detailed' when the cookie list is filled), AGENT.md, PROGRAMISTA §2.8/§2.11/§6, skills ipal-setup, ipal-site, ipal-upgrade, ipal-locale-add, ipal-consent-check. Postgres/SQLite projects need migrate:create for the new fields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1413e96731
commit
6b4336f961
@@ -351,6 +351,23 @@ describe('cookie table', () => {
|
||||
expect(await getCookieTable({ locale: 'pl', payload })).toEqual([
|
||||
{ name: '_ga', category: 'analytics', duration: '2 lata', provider: 'Google', purpose: 'Statystyki' },
|
||||
])
|
||||
|
||||
// the same rows feed the detailed settings window, with English labels until the panel has them
|
||||
const texts = await getConsentTexts({ config: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }] }, locale: 'pl', payload, privacyPolicy: false })
|
||||
expect(texts.cookies).toEqual([{ name: '_ga', category: 'analytics', duration: '2 lata', provider: 'Google', purpose: 'Statystyki' }])
|
||||
expect(texts.details).toEqual({ cookies: 'Cookies used', duration: 'Duration', provider: 'Provider', purpose: 'Purpose' })
|
||||
|
||||
await payload.updateGlobal({
|
||||
slug: 'cookie-settings' as never,
|
||||
data: { detailLabels: { cookies: 'Używane ciasteczka', duration: 'Czas', provider: 'Dostawca', purpose: 'Cel' } } as never,
|
||||
locale: 'pl' as never,
|
||||
})
|
||||
expect((await getConsentTexts({ config: { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }] }, locale: 'pl', payload, privacyPolicy: false })).details).toEqual({
|
||||
cookies: 'Używane ciasteczka',
|
||||
duration: 'Czas',
|
||||
provider: 'Dostawca',
|
||||
purpose: 'Cel',
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user