fix(events): show customer phone in event details view (#331)

The phone field added in #322 was wired into the edit form but never
rendered in the read-only event-info panel, so admins could only see the
number while editing. Add a phone row gated on event_phone_field_enabled
(same toggle the form uses), and tighten the Event type so customer_phone
is no longer accessed via `(event as any)`.
This commit is contained in:
Paul Nothaft
2026-04-28 15:05:22 +02:00
parent ca8acacd43
commit 4c73d228ed
2 changed files with 15 additions and 1 deletions
+14 -1
View File
@@ -431,7 +431,7 @@ export const EventDetailsPage: React.FC = () => {
hero_photo_id: event.hero_photo_id || null,
customer_name: event.customer_name || '',
customer_email: event.customer_email || '',
customer_phone: (event as any).customer_phone || '',
customer_phone: event.customer_phone || '',
source_mode: event.source_mode === 'reference' ? 'reference' : 'managed',
external_path: event.external_path || '',
require_password: normalizeRequirePassword(event.require_password),
@@ -1504,6 +1504,19 @@ export const EventDetailsPage: React.FC = () => {
</div>
</div>
{phoneFieldEnabled && (
<div>
<dt className="text-sm font-medium text-neutral-500 dark:text-neutral-400">
{t('events.customerPhone', 'Customer Phone')}
</dt>
<dd className="mt-1 text-sm text-neutral-900 dark:text-neutral-100">
{event.customer_phone || (
<span className="text-neutral-400">{t('common.notSet')}</span>
)}
</dd>
</div>
)}
<div className="grid grid-cols-2 gap-4">
<div>
<dt className="text-sm font-medium text-neutral-500 dark:text-neutral-400">{t('events.created')}</dt>
+1
View File
@@ -7,6 +7,7 @@ export interface Event {
event_date: string | null;
customer_name?: string;
customer_email: string;
customer_phone?: string | null;
admin_email: string;
welcome_message?: string;
color_theme?: string;