Update default branding palette for tenants and guests
This commit is contained in:
@@ -1025,10 +1025,10 @@ class EventPublicController extends BaseController
|
|||||||
private function resolveBrandingPayload(Event $event): array
|
private function resolveBrandingPayload(Event $event): array
|
||||||
{
|
{
|
||||||
$defaults = [
|
$defaults = [
|
||||||
'primary' => '#f43f5e',
|
'primary' => '#FF5A5F',
|
||||||
'secondary' => '#fb7185',
|
'secondary' => '#FFF8F5',
|
||||||
'background' => '#ffffff',
|
'background' => '#FFF8F5',
|
||||||
'surface' => '#ffffff',
|
'surface' => '#FFF8F5',
|
||||||
'font' => null,
|
'font' => null,
|
||||||
'size' => 'm',
|
'size' => 'm',
|
||||||
'logo_position' => 'left',
|
'logo_position' => 'left',
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ class SettingsController extends Controller
|
|||||||
$defaultSettings = [
|
$defaultSettings = [
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#3B82F6',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1F2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
'features' => [
|
'features' => [
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ class CheckoutController extends Controller
|
|||||||
'settings' => json_encode([
|
'settings' => json_encode([
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#3B82F6',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1F2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
'features' => [
|
'features' => [
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ class CheckoutGoogleController extends Controller
|
|||||||
'settings' => json_encode([
|
'settings' => json_encode([
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#3B82F6',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1F2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
'features' => [
|
'features' => [
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ class TestGuestEventController extends Controller
|
|||||||
'date' => ($validated['date'] ?? Carbon::now()->addWeeks(2)->toDateString()),
|
'date' => ($validated['date'] ?? Carbon::now()->addWeeks(2)->toDateString()),
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'primary_color' => '#f43f5e',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#fb7185',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class TenantFactory extends Factory
|
|||||||
'settings' => json_encode([
|
'settings' => json_encode([
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#3B82F6',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1F2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
'features' => [
|
'features' => [
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ class DemoTenantSeeder extends Seeder
|
|||||||
'contact_email' => $user->email,
|
'contact_email' => $user->email,
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#f43f5e',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1f2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ vi.mock('../../i18n/useTranslation', () => ({
|
|||||||
vi.mock('../../context/EventBrandingContext', () => ({
|
vi.mock('../../context/EventBrandingContext', () => ({
|
||||||
useEventBranding: () => ({
|
useEventBranding: () => ({
|
||||||
branding: {
|
branding: {
|
||||||
primaryColor: '#f43f5e',
|
primaryColor: '#FF5A5F',
|
||||||
secondaryColor: '#fb7185',
|
secondaryColor: '#FFF8F5',
|
||||||
buttons: { radius: 12, linkColor: '#fb7185' },
|
buttons: { radius: 12, linkColor: '#FFF8F5' },
|
||||||
typography: {},
|
typography: {},
|
||||||
fontFamily: 'Montserrat',
|
fontFamily: 'Montserrat',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,16 +7,16 @@ type EventBrandingContextValue = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const DEFAULT_EVENT_BRANDING: EventBranding = {
|
export const DEFAULT_EVENT_BRANDING: EventBranding = {
|
||||||
primaryColor: '#f43f5e',
|
primaryColor: '#FF5A5F',
|
||||||
secondaryColor: '#fb7185',
|
secondaryColor: '#FFF8F5',
|
||||||
backgroundColor: '#ffffff',
|
backgroundColor: '#FFF8F5',
|
||||||
fontFamily: 'Montserrat, Inter, "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
|
fontFamily: 'Montserrat, Inter, "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
|
||||||
logoUrl: null,
|
logoUrl: null,
|
||||||
palette: {
|
palette: {
|
||||||
primary: '#f43f5e',
|
primary: '#FF5A5F',
|
||||||
secondary: '#fb7185',
|
secondary: '#FFF8F5',
|
||||||
background: '#ffffff',
|
background: '#FFF8F5',
|
||||||
surface: '#ffffff',
|
surface: '#FFF8F5',
|
||||||
},
|
},
|
||||||
typography: {
|
typography: {
|
||||||
heading: 'Playfair Display, "Times New Roman", serif',
|
heading: 'Playfair Display, "Times New Roman", serif',
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ export default function PublicGalleryPage(): React.ReactElement | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const palette = state.meta.branding.palette ?? {};
|
const palette = state.meta.branding.palette ?? {};
|
||||||
const primary = palette.primary ?? state.meta.branding.primary_color ?? '#f43f5e';
|
const primary = palette.primary ?? state.meta.branding.primary_color ?? '#FF5A5F';
|
||||||
const secondary = palette.secondary ?? state.meta.branding.secondary_color ?? '#fb7185';
|
const secondary = palette.secondary ?? state.meta.branding.secondary_color ?? '#FFF8F5';
|
||||||
const background = palette.background ?? state.meta.branding.background_color ?? '#ffffff';
|
const background = palette.background ?? state.meta.branding.background_color ?? '#ffffff';
|
||||||
const surface = palette.surface ?? state.meta.branding.surface_color ?? background;
|
const surface = palette.surface ?? state.meta.branding.surface_color ?? background;
|
||||||
const mode = state.meta.branding.mode ?? 'auto';
|
const mode = state.meta.branding.mode ?? 'auto';
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { MissionActionCard } from '../HomePage';
|
|||||||
vi.mock('../../context/EventBrandingContext', () => ({
|
vi.mock('../../context/EventBrandingContext', () => ({
|
||||||
useEventBranding: () => ({
|
useEventBranding: () => ({
|
||||||
branding: {
|
branding: {
|
||||||
primaryColor: '#f43f5e',
|
primaryColor: '#FF5A5F',
|
||||||
secondaryColor: '#fb7185',
|
secondaryColor: '#FFF8F5',
|
||||||
buttons: { radius: 12 },
|
buttons: { radius: 12 },
|
||||||
typography: {},
|
typography: {},
|
||||||
fontFamily: 'Montserrat',
|
fontFamily: 'Montserrat',
|
||||||
@@ -18,7 +18,7 @@ vi.mock('../../context/EventBrandingContext', () => ({
|
|||||||
|
|
||||||
vi.mock('../../lib/emotionTheme', () => ({
|
vi.mock('../../lib/emotionTheme', () => ({
|
||||||
getEmotionTheme: () => ({
|
getEmotionTheme: () => ({
|
||||||
gradientBackground: 'linear-gradient(135deg, #f43f5e, #fb7185)',
|
gradientBackground: 'linear-gradient(135deg, #FF5A5F, #FFF8F5)',
|
||||||
}),
|
}),
|
||||||
getEmotionIcon: () => '🙂',
|
getEmotionIcon: () => '🙂',
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ describe('UploadActionCard', () => {
|
|||||||
<MemoryRouter>
|
<MemoryRouter>
|
||||||
<UploadActionCard
|
<UploadActionCard
|
||||||
token="demo"
|
token="demo"
|
||||||
accentColor="#f43f5e"
|
accentColor="#FF5A5F"
|
||||||
secondaryAccent="#fb7185"
|
secondaryAccent="#FFF8F5"
|
||||||
radius={12}
|
radius={12}
|
||||||
requiresApproval={false}
|
requiresApproval={false}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ vi.mock('../../context/EventStatsContext', () => ({
|
|||||||
vi.mock('../../context/EventBrandingContext', () => ({
|
vi.mock('../../context/EventBrandingContext', () => ({
|
||||||
useEventBranding: () => ({
|
useEventBranding: () => ({
|
||||||
branding: {
|
branding: {
|
||||||
primaryColor: '#f43f5e',
|
primaryColor: '#FF5A5F',
|
||||||
secondaryColor: '#fb7185',
|
secondaryColor: '#FFF8F5',
|
||||||
buttons: { radius: 12 },
|
buttons: { radius: 12 },
|
||||||
typography: {},
|
typography: {},
|
||||||
fontFamily: 'Montserrat',
|
fontFamily: 'Montserrat',
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ vi.mock('../../context/EventStatsContext', () => ({
|
|||||||
vi.mock('../../context/EventBrandingContext', () => ({
|
vi.mock('../../context/EventBrandingContext', () => ({
|
||||||
useEventBranding: () => ({
|
useEventBranding: () => ({
|
||||||
branding: {
|
branding: {
|
||||||
primaryColor: '#f43f5e',
|
primaryColor: '#FF5A5F',
|
||||||
secondaryColor: '#fb7185',
|
secondaryColor: '#FFF8F5',
|
||||||
buttons: { radius: 12 },
|
buttons: { radius: 12 },
|
||||||
typography: {},
|
typography: {},
|
||||||
fontFamily: 'Montserrat',
|
fontFamily: 'Montserrat',
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SettingsApiTest extends TenantTestCase
|
|||||||
|
|
||||||
$response->assertStatus(200)
|
$response->assertStatus(200)
|
||||||
->assertJson(['message' => 'Settings erfolgreich abgerufen.'])
|
->assertJson(['message' => 'Settings erfolgreich abgerufen.'])
|
||||||
->assertJsonPath('data.settings.branding.primary_color', '#3B82F6')
|
->assertJsonPath('data.settings.branding.primary_color', '#FF5A5F')
|
||||||
->assertJsonPath('data.settings.features.photo_likes_enabled', true);
|
->assertJsonPath('data.settings.features.photo_likes_enabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class SettingsApiTest extends TenantTestCase
|
|||||||
|
|
||||||
$response->assertStatus(200)
|
$response->assertStatus(200)
|
||||||
->assertJson(['message' => 'Settings auf Standardwerte zurueckgesetzt.'])
|
->assertJson(['message' => 'Settings auf Standardwerte zurueckgesetzt.'])
|
||||||
->assertJsonPath('data.settings.branding.primary_color', '#3B82F6')
|
->assertJsonPath('data.settings.branding.primary_color', '#FF5A5F')
|
||||||
->assertJsonPath('data.settings.features.photo_likes_enabled', true);
|
->assertJsonPath('data.settings.features.photo_likes_enabled', true);
|
||||||
|
|
||||||
$this->assertDatabaseHas('tenants', [
|
$this->assertDatabaseHas('tenants', [
|
||||||
@@ -109,8 +109,8 @@ class SettingsApiTest extends TenantTestCase
|
|||||||
'settings' => json_encode([
|
'settings' => json_encode([
|
||||||
'branding' => [
|
'branding' => [
|
||||||
'logo_url' => null,
|
'logo_url' => null,
|
||||||
'primary_color' => '#3B82F6',
|
'primary_color' => '#FF5A5F',
|
||||||
'secondary_color' => '#1F2937',
|
'secondary_color' => '#FFF8F5',
|
||||||
'font_family' => 'Inter, sans-serif',
|
'font_family' => 'Inter, sans-serif',
|
||||||
],
|
],
|
||||||
'features' => [
|
'features' => [
|
||||||
@@ -185,7 +185,7 @@ class SettingsApiTest extends TenantTestCase
|
|||||||
$response = $this->authenticatedRequest('GET', '/api/v1/tenant/settings');
|
$response = $this->authenticatedRequest('GET', '/api/v1/tenant/settings');
|
||||||
|
|
||||||
$response->assertStatus(200)
|
$response->assertStatus(200)
|
||||||
->assertJsonPath('data.settings.branding.primary_color', '#3B82F6') // Default for this tenant
|
->assertJsonPath('data.settings.branding.primary_color', '#FF5A5F') // Default for this tenant
|
||||||
->assertJsonMissing(['#FF0000']); // Other tenant's color
|
->assertJsonMissing(['#FF0000']); // Other tenant's color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user