Adjust branding defaults and tenant presets

This commit is contained in:
Codex Agent
2026-01-30 18:15:52 +01:00
parent b3bf45482a
commit 6e19c3d7b6
9 changed files with 592 additions and 220 deletions

View File

@@ -6,6 +6,8 @@ const defaults = {
accent: '#222222',
background: '#ffffff',
surface: '#f0f0f0',
headingFont: 'Default Heading',
bodyFont: 'Default Body',
mode: 'auto' as const,
buttonStyle: 'filled' as const,
buttonRadius: 12,
@@ -87,7 +89,6 @@ describe('extractBrandingForm', () => {
position: 'center',
size: 'l',
},
use_default_branding: true,
},
};
@@ -105,7 +106,6 @@ describe('extractBrandingForm', () => {
expect(result.logoValue).toBe('🎉');
expect(result.logoPosition).toBe('center');
expect(result.logoSize).toBe('l');
expect(result.useDefaultBranding).toBe(true);
});
it('normalizes stored logo paths for previews', () => {

View File

@@ -17,7 +17,6 @@ export type BrandingFormValues = {
buttonPrimary: string;
buttonSecondary: string;
linkColor: string;
useDefaultBranding: boolean;
};
export type BrandingFormDefaults = Pick<
@@ -26,6 +25,8 @@ export type BrandingFormDefaults = Pick<
| 'accent'
| 'background'
| 'surface'
| 'headingFont'
| 'bodyFont'
| 'mode'
| 'buttonStyle'
| 'buttonRadius'
@@ -130,8 +131,8 @@ export function extractBrandingForm(settings: unknown, defaults: BrandingFormDef
accent,
background,
surface,
headingFont: headingFont ?? '',
bodyFont: bodyFont ?? '',
headingFont: headingFont ?? defaults.headingFont ?? '',
bodyFont: bodyFont ?? defaults.bodyFont ?? '',
fontSize,
logoDataUrl: resolveAssetPreviewUrl(logoUploadValue),
logoValue,
@@ -144,6 +145,5 @@ export function extractBrandingForm(settings: unknown, defaults: BrandingFormDef
buttonPrimary,
buttonSecondary,
linkColor,
useDefaultBranding: branding.use_default_branding === true,
};
}