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:
@@ -431,7 +431,7 @@ export const EventDetailsPage: React.FC = () => {
|
|||||||
hero_photo_id: event.hero_photo_id || null,
|
hero_photo_id: event.hero_photo_id || null,
|
||||||
customer_name: event.customer_name || '',
|
customer_name: event.customer_name || '',
|
||||||
customer_email: event.customer_email || '',
|
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',
|
source_mode: event.source_mode === 'reference' ? 'reference' : 'managed',
|
||||||
external_path: event.external_path || '',
|
external_path: event.external_path || '',
|
||||||
require_password: normalizeRequirePassword(event.require_password),
|
require_password: normalizeRequirePassword(event.require_password),
|
||||||
@@ -1504,6 +1504,19 @@ export const EventDetailsPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</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 className="grid grid-cols-2 gap-4">
|
||||||
<div>
|
<div>
|
||||||
<dt className="text-sm font-medium text-neutral-500 dark:text-neutral-400">{t('events.created')}</dt>
|
<dt className="text-sm font-medium text-neutral-500 dark:text-neutral-400">{t('events.created')}</dt>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface Event {
|
|||||||
event_date: string | null;
|
event_date: string | null;
|
||||||
customer_name?: string;
|
customer_name?: string;
|
||||||
customer_email: string;
|
customer_email: string;
|
||||||
|
customer_phone?: string | null;
|
||||||
admin_email: string;
|
admin_email: string;
|
||||||
welcome_message?: string;
|
welcome_message?: string;
|
||||||
color_theme?: string;
|
color_theme?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user