Theme switcher, table of contents, missing-page redirect, form placeholders and time field; audit and revalidate fixes
- buildRevalidateHook skips outside Next (no NEXT_RUNTIME) and with context.disableRevalidate - BuilderForm focuses only on a real step change (no scroll to the form on remount) - mediaImageProps: placeholder colour only for JPEG (placeholderColor); hook stores no colour for transparent images - buildLinkField: interface name per shape (CmsLink, CmsLinkPlain, CmsLinkNoLabel) + interfaceName option - Cookie Settings: buttons.save -> buttons.savePreferences (Mongoose reserved name) - ThemeScript, ThemeSwitcher, useTheme; Site Settings defaultTheme 'system' + themeToggleLabel; Turnstile follows page theme - extractHeadings, RenderRichText headingIds, TableOfContents, buildTableOfContentsField - createPageRoute onMissing: 'redirectHome' - Form builder: localized placeholder on text/email/textarea/number, new time field - ipal-audit: no false positive for object keys between JSX elements; /md route not reported as dynamic Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
23e033d7d7
commit
faa4ad679c
@@ -9,6 +9,16 @@ const config = { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'PL' }, { c
|
||||
const opts = { config, homeSlug: 'start', locale: 'pl' }
|
||||
const page = (slug: string) => ({ type: 'internal' as const, label: slug, page: { slug } })
|
||||
|
||||
describe('buildLinkField interface names', () => {
|
||||
test('each shape has its own type name, so generate:types never depends on field order', () => {
|
||||
expect(buildLinkField().interfaceName).toBe('CmsLink')
|
||||
expect(buildLinkField({ appearances: false }).interfaceName).toBe('CmsLinkPlain')
|
||||
expect(buildLinkField({ disableLabel: true }).interfaceName).toBe('CmsLinkNoLabel')
|
||||
expect(buildLinkField({ appearances: false, disableLabel: true }).interfaceName).toBe('CmsLinkPlainNoLabel')
|
||||
expect(buildLinkField({ appearances: false, interfaceName: 'CardLink' }).interfaceName).toBe('CardLink')
|
||||
})
|
||||
})
|
||||
|
||||
describe('resolveLink', () => {
|
||||
test('internal page → next/link, no target', () => {
|
||||
expect(resolveLink(page('kontakt'), opts)).toEqual({ href: '/pl/kontakt', internal: true, label: 'kontakt', newTab: false, targetProps: {} })
|
||||
|
||||
Reference in New Issue
Block a user