- Registrations: event selector dropdown (default = active event), event name shown prominently in header with active badge, 'Delete all contacts for this event' action (deletes the contacts registered for the selected event) - Contacts: per-row Delete button (with confirm; cascades to registrations) - Interfaces: Sessionize + Pretix 'Recent runs' tables now in per-interface collapsibles, collapsed by default - api: deleteContact + deleteContacts helpers Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
671 lines
23 KiB
TypeScript
671 lines
23 KiB
TypeScript
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
import {
|
|
getAllEvents,
|
|
getPretixRuns,
|
|
getSidecarStatus,
|
|
getSyncRuns,
|
|
importSessionizeExcel,
|
|
runPretixSync,
|
|
runSessionizeSync,
|
|
} from '../lib/api';
|
|
import type {
|
|
Event,
|
|
ExcelSyncResult,
|
|
PretixRun,
|
|
PretixSyncResult,
|
|
SidecarStatus,
|
|
SyncResult,
|
|
SyncRun,
|
|
} from '../lib/types';
|
|
import { useToast } from '../context/ToastContext';
|
|
import { Empty, Modal, Spinner } from '../components/ui';
|
|
|
|
export function Interfaces() {
|
|
const { push } = useToast();
|
|
const [events, setEvents] = useState<Event[]>([]);
|
|
const [loaded, setLoaded] = useState(false);
|
|
const [error, setError] = useState<string | null>(null);
|
|
const [status, setStatus] = useState<SidecarStatus | null>(null);
|
|
const [sidecarError, setSidecarError] = useState<string | null>(null);
|
|
const [selectedId, setSelectedId] = useState<string>('');
|
|
const [runs, setRuns] = useState<SyncRun[]>([]);
|
|
const [running, setRunning] = useState(false);
|
|
const [result, setResult] = useState<SyncResult | null>(null);
|
|
const [excelFile, setExcelFile] = useState<File | null>(null);
|
|
const [excelBusy, setExcelBusy] = useState(false);
|
|
const [excelResult, setExcelResult] = useState<ExcelSyncResult | null>(null);
|
|
const [pretixRuns, setPretixRuns] = useState<SyncRun[]>([]);
|
|
const [pretixRunning, setPretixRunning] = useState(false);
|
|
const [pretixResult, setPretixResult] = useState<PretixSyncResult | null>(null);
|
|
const [sessionizeLogsOpen, setSessionizeLogsOpen] = useState(false);
|
|
const [pretixLogsOpen, setPretixLogsOpen] = useState(false);
|
|
const fileRef = useRef<HTMLInputElement>(null);
|
|
|
|
const loadableEvents = events.filter((e) => e.sessionize_endpoint);
|
|
|
|
async function load() {
|
|
try {
|
|
const evs = await getAllEvents();
|
|
setEvents(evs);
|
|
const first = evs.find((e) => e.sessionize_endpoint);
|
|
if (first) setSelectedId((cur) => cur || first.id);
|
|
setLoaded(true);
|
|
} catch (e) {
|
|
setError(e instanceof Error ? e.message : 'Failed to load');
|
|
}
|
|
}
|
|
|
|
async function loadStatus() {
|
|
try {
|
|
setStatus(await getSidecarStatus());
|
|
setSidecarError(null);
|
|
} catch (e) {
|
|
setStatus(null);
|
|
setSidecarError(e instanceof Error ? e.message : 'Sidecar unreachable');
|
|
}
|
|
}
|
|
|
|
async function loadRuns(eventId: string) {
|
|
try {
|
|
setRuns(await getSyncRuns(eventId));
|
|
} catch {
|
|
setRuns([]);
|
|
}
|
|
}
|
|
|
|
async function loadPretixRuns(eventId: string) {
|
|
try {
|
|
setPretixRuns(await getPretixRuns(eventId));
|
|
} catch {
|
|
setPretixRuns([]);
|
|
}
|
|
}
|
|
|
|
useEffect(() => {
|
|
load();
|
|
loadStatus();
|
|
}, []);
|
|
|
|
useEffect(() => {
|
|
if (selectedId) {
|
|
loadRuns(selectedId);
|
|
loadPretixRuns(selectedId);
|
|
}
|
|
}, [selectedId]);
|
|
|
|
// Poll the sidecar status while a sync is running (the run call is blocking,
|
|
// so this mainly refreshes the "running" indicator + last run).
|
|
const pollStatus = useCallback(() => {
|
|
loadStatus();
|
|
}, []);
|
|
useEffect(() => {
|
|
if (!running && !pretixRunning) return;
|
|
const t = setInterval(pollStatus, 3000);
|
|
return () => clearInterval(t);
|
|
}, [running, pretixRunning, pollStatus]);
|
|
|
|
async function runSync() {
|
|
if (!selectedId) return;
|
|
setRunning(true);
|
|
try {
|
|
const res = await runSessionizeSync(selectedId);
|
|
setResult(res);
|
|
await Promise.all([load(), loadStatus(), loadRuns(selectedId)]);
|
|
push('success', 'Sessionize sync finished');
|
|
} catch (e) {
|
|
push('error', e instanceof Error ? e.message : 'Sync failed');
|
|
} finally {
|
|
setRunning(false);
|
|
}
|
|
}
|
|
|
|
async function runPretixNow() {
|
|
if (!selectedId) return;
|
|
setPretixRunning(true);
|
|
try {
|
|
const res = await runPretixSync(selectedId);
|
|
setPretixResult(res);
|
|
await Promise.all([load(), loadStatus(), loadPretixRuns(selectedId)]);
|
|
push('success', 'Pretix sync finished');
|
|
} catch (e) {
|
|
push('error', e instanceof Error ? e.message : 'Pretix sync failed');
|
|
} finally {
|
|
setPretixRunning(false);
|
|
}
|
|
}
|
|
|
|
async function importExcel() {
|
|
if (!selectedId || !excelFile) return;
|
|
setExcelBusy(true);
|
|
try {
|
|
const res = await importSessionizeExcel(selectedId, excelFile);
|
|
setExcelResult(res);
|
|
await Promise.all([load(), loadStatus(), loadRuns(selectedId)]);
|
|
push('success', 'Excel import finished');
|
|
} catch (e) {
|
|
push('error', e instanceof Error ? e.message : 'Excel import failed');
|
|
} finally {
|
|
setExcelBusy(false);
|
|
}
|
|
}
|
|
|
|
if (error) return <Empty icon="⚠️" text={error} />;
|
|
if (!loaded)
|
|
return (
|
|
<div className="loading-screen">
|
|
<Spinner />
|
|
</div>
|
|
);
|
|
|
|
const selected = events.find((e) => e.id === selectedId);
|
|
|
|
return (
|
|
<div>
|
|
<div className="page-head">
|
|
<div>
|
|
<h1>Interfaces</h1>
|
|
<div className="sub">External data sources. The Sessionize sidecar runs on demand only.</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Sidecar status */}
|
|
<div className="card" style={{ marginBottom: 18 }}>
|
|
<h2 className="h2">🔌 Sidecar status</h2>
|
|
{sidecarError ? (
|
|
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
|
{sidecarError}
|
|
</div>
|
|
) : status ? (
|
|
<div style={{ display: 'flex', gap: 10, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
<span className={`pill ${status.ok ? 'green' : 'red'}`}>{status.ok ? 'online' : 'offline'}</span>
|
|
{status.running && <span className="pill amber">sync running…</span>}
|
|
{status.lastRun && (
|
|
<span className="muted small">
|
|
last run {fmtTime(status.lastRun.finished_at)} —{' '}
|
|
<span className={status.lastRun.status === 'success' ? 'pill green' : 'pill red'}>
|
|
{status.lastRun.status}
|
|
</span>
|
|
</span>
|
|
)}
|
|
</div>
|
|
) : (
|
|
<Spinner />
|
|
)}
|
|
</div>
|
|
|
|
{/* Run control */}
|
|
<div className="card" style={{ marginBottom: 18 }}>
|
|
<h2 className="h2">▶ Run a sync</h2>
|
|
{loadableEvents.length === 0 ? (
|
|
<Empty icon="🔌" text="No events have a Sessionize endpoint yet. Set one in the Events menu." />
|
|
) : (
|
|
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
<select
|
|
className="input"
|
|
style={{ maxWidth: 320 }}
|
|
value={selectedId}
|
|
onChange={(e) => setSelectedId(e.target.value)}
|
|
>
|
|
{loadableEvents.map((e) => (
|
|
<option key={e.id} value={e.id}>
|
|
{e.name}
|
|
</option>
|
|
))}
|
|
</select>
|
|
<button className="btn primary" disabled={running || !selectedId} onClick={runSync}>
|
|
{running ? 'Syncing…' : 'Run sync'}
|
|
</button>
|
|
{selected?.last_synced_at && (
|
|
<span className="muted small">last synced {fmtTime(selected.last_synced_at)}</span>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
|
|
{/* Excel import (Sessions & speakers advanced) */}
|
|
<div className="card" style={{ marginBottom: 18 }}>
|
|
<h2 className="h2">📄 Import from Sessionize export</h2>
|
|
<div className="muted small" style={{ marginBottom: 12, maxWidth: 640 }}>
|
|
Upload the <strong>“Sessions and speakers (advanced)”</strong> .xlsx export from your
|
|
Sessionize event. It imports speakers (by email), sessions, the agenda, and creates the
|
|
speaker registrations — no API key needed.
|
|
</div>
|
|
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
<select
|
|
className="input"
|
|
style={{ maxWidth: 320 }}
|
|
value={selectedId}
|
|
onChange={(e) => setSelectedId(e.target.value)}
|
|
>
|
|
{events.map((e) => (
|
|
<option key={e.id} value={e.id}>
|
|
{e.name}
|
|
</option>
|
|
))}
|
|
</select>
|
|
<input
|
|
ref={fileRef}
|
|
type="file"
|
|
accept=".xlsx,.xls"
|
|
style={{ display: 'none' }}
|
|
onChange={(e) => setExcelFile(e.target.files?.[0] ?? null)}
|
|
/>
|
|
<button className="btn" disabled={excelBusy} onClick={() => fileRef.current?.click()}>
|
|
{excelFile ? `📎 ${excelFile.name}` : 'Choose .xlsx…'}
|
|
</button>
|
|
<button className="btn primary" disabled={excelBusy || !excelFile || !selectedId} onClick={importExcel}>
|
|
{excelBusy ? 'Importing…' : 'Import'}
|
|
</button>
|
|
<div className="uiverse-tooltip">
|
|
<button type="button" className="uiverse-btn">
|
|
<span>
|
|
<svg viewBox="0 0 24 24" stroke="currentColor" fill="none" width="16" height="16">
|
|
<path d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" strokeWidth="2" strokeLinejoin="round" strokeLinecap="round" />
|
|
</svg>
|
|
How to get this file
|
|
</span>
|
|
</button>
|
|
<div className="uiverse-card">
|
|
<div className="uiverse-head">
|
|
<div className="uiverse-ico">
|
|
<svg viewBox="0 0 20 20" fill="currentColor" width="16" height="16">
|
|
<path clipRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" fillRule="evenodd" />
|
|
</svg>
|
|
</div>
|
|
<h3>Export from Sessionize</h3>
|
|
</div>
|
|
<p>
|
|
In your Sessionize event, open <strong>Export</strong> → <strong>“Sessions and
|
|
speakers (advanced)”</strong> and download the .xlsx. Any organizer with access to
|
|
the event can generate it. Upload it here to import speakers, sessions, the agenda
|
|
and speaker registrations.
|
|
</p>
|
|
<div className="uiverse-foot">No API key required</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Pretix */}
|
|
<div className="card" style={{ marginBottom: 18 }}>
|
|
<h2 className="h2">🎟 Pretix</h2>
|
|
<div style={{ marginBottom: 12 }}>
|
|
{status?.pretixConfigured === false ? (
|
|
<span className="pill amber" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
|
Pretix not configured (no API key on the sidecar)
|
|
</span>
|
|
) : (
|
|
<div className="muted small" style={{ display: 'flex', gap: 10, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
<span>
|
|
Pretix auto-sync: every {status?.pretixIntervalMs ? status.pretixIntervalMs / 1000 : 60}s
|
|
</span>
|
|
{status?.lastPretixRun && (
|
|
<span>
|
|
last run {fmtTime(status.lastPretixRun.finished_at)} —{' '}
|
|
<span
|
|
className={`pill ${
|
|
status.lastPretixRun.status === 'success'
|
|
? 'green'
|
|
: status.lastPretixRun.status === 'skipped'
|
|
? 'amber'
|
|
: 'red'
|
|
}`}
|
|
>
|
|
{status.lastPretixRun.status}
|
|
</span>
|
|
{status.lastPretixRun.status === 'success' && (
|
|
<span className="muted">
|
|
{' '}
|
|
· {status.lastPretixRun.orders ?? 0} orders · {status.lastPretixRun.attendees ?? 0}{' '}
|
|
attendees · {status.lastPretixRun.skipped ?? 0} skipped
|
|
</span>
|
|
)}
|
|
{(status.lastPretixRun.status === 'error' || status.lastPretixRun.status === 'skipped') &&
|
|
(status.lastPretixRun.error || status.lastPretixRun.reason) && (
|
|
<span className="muted"> · {status.lastPretixRun.error || status.lastPretixRun.reason}</span>
|
|
)}
|
|
</span>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
<select
|
|
className="input"
|
|
style={{ maxWidth: 320 }}
|
|
value={selectedId}
|
|
onChange={(e) => setSelectedId(e.target.value)}
|
|
>
|
|
{events.map((e) => (
|
|
<option key={e.id} value={e.id}>
|
|
{e.name}
|
|
</option>
|
|
))}
|
|
</select>
|
|
<button className="btn primary" disabled={pretixRunning || !selectedId} onClick={runPretixNow}>
|
|
{pretixRunning ? 'Syncing…' : 'Run Pretix now'}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Recent Pretix runs (audit) — collapsible, collapsed by default */}
|
|
<CollapsibleRuns
|
|
icon="🎟"
|
|
title="Recent Pretix runs"
|
|
eventName={selected?.name}
|
|
open={pretixLogsOpen}
|
|
onToggle={() => setPretixLogsOpen((v) => !v)}
|
|
runs={pretixRuns}
|
|
emptyText="No Pretix sync runs recorded for this event yet."
|
|
/>
|
|
|
|
{/* Recent Sessionize runs (audit) — collapsible, collapsed by default */}
|
|
<CollapsibleRuns
|
|
icon="📜"
|
|
title="Recent runs"
|
|
eventName={selected?.name}
|
|
open={sessionizeLogsOpen}
|
|
onToggle={() => setSessionizeLogsOpen((v) => !v)}
|
|
runs={runs}
|
|
emptyText="No sync runs recorded for this event yet."
|
|
/>
|
|
|
|
{result && <SyncResultModal result={result} onClose={() => setResult(null)} />}
|
|
{excelResult && <ExcelResultModal result={excelResult} onClose={() => setExcelResult(null)} />}
|
|
{pretixResult && <PretixResultModal result={pretixResult} onClose={() => setPretixResult(null)} />}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
/** A collapsible "recent runs" audit card. Collapsed by default. */
|
|
function CollapsibleRuns({
|
|
icon,
|
|
title,
|
|
eventName,
|
|
open,
|
|
onToggle,
|
|
runs,
|
|
emptyText,
|
|
}: {
|
|
icon: string;
|
|
title: string;
|
|
eventName?: string;
|
|
open: boolean;
|
|
onToggle: () => void;
|
|
runs: SyncRun[];
|
|
emptyText: string;
|
|
}) {
|
|
return (
|
|
<div className="card" style={{ marginBottom: 18 }}>
|
|
<button
|
|
type="button"
|
|
onClick={onToggle}
|
|
style={{
|
|
display: 'flex',
|
|
width: '100%',
|
|
alignItems: 'center',
|
|
justifyContent: 'space-between',
|
|
gap: 10,
|
|
background: 'none',
|
|
border: 'none',
|
|
cursor: 'pointer',
|
|
padding: 0,
|
|
textAlign: 'left',
|
|
}}
|
|
aria-expanded={open}
|
|
>
|
|
<h2 className="h2" style={{ margin: 0 }}>
|
|
{icon} {title}
|
|
{eventName ? ` — ${eventName}` : ''}
|
|
</h2>
|
|
<span className="muted small" style={{ whiteSpace: 'nowrap' }}>
|
|
{runs.length} run{runs.length === 1 ? '' : 's'} {open ? '▾' : '▸'}
|
|
</span>
|
|
</button>
|
|
{open && (
|
|
runs.length === 0 ? (
|
|
<Empty icon={icon} text={emptyText} />
|
|
) : (
|
|
<div className="table-wrap" style={{ marginTop: 12 }}>
|
|
<table className="data">
|
|
<thead>
|
|
<tr>
|
|
<th>Started</th>
|
|
<th>Finished</th>
|
|
<th>Created</th>
|
|
<th>Updated</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{runs.map((r) => (
|
|
<tr key={r.id}>
|
|
<td className="muted">{fmtTime(r.started_at)}</td>
|
|
<td className="muted">{r.finished_at ? fmtTime(r.finished_at) : '—'}</td>
|
|
<td className="muted">{r.created}</td>
|
|
<td className="muted">{r.updated}</td>
|
|
<td>
|
|
{r.error ? (
|
|
<span className="pill red" title={r.error}>
|
|
error
|
|
</span>
|
|
) : (
|
|
<span className="pill green">ok</span>
|
|
)}
|
|
</td>
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
)
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function PretixResultModal({ result, onClose }: { result: PretixRun; onClose: () => void }) {
|
|
const s = result.summary;
|
|
return (
|
|
<Modal
|
|
open
|
|
title={`Pretix sync — ${result.event_name ?? result.event_id}`}
|
|
onClose={onClose}
|
|
footer={
|
|
<button className="btn primary" onClick={onClose}>
|
|
Close
|
|
</button>
|
|
}
|
|
>
|
|
{result.status === 'error' || result.status === 'skipped' ? (
|
|
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
|
{result.error ?? result.reason ?? 'Pretix sync failed'}
|
|
</div>
|
|
) : (
|
|
<>
|
|
<div className="stat-grid">
|
|
<div className="stat">
|
|
<div className="val">{result.orders ?? 0}</div>
|
|
<div className="lbl">Orders</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{result.attendees ?? 0}</div>
|
|
<div className="lbl">Attendees</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s?.created ?? 0}</div>
|
|
<div className="lbl">Created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s?.updated ?? 0}</div>
|
|
<div className="lbl">Updated</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{result.skipped ?? 0}</div>
|
|
<div className="lbl">Skipped</div>
|
|
</div>
|
|
</div>
|
|
{s && s.errors.length > 0 && (
|
|
<div style={{ marginTop: 12 }}>
|
|
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
|
{s.errors.length} error(s)
|
|
</div>
|
|
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
|
{s.errors.map((e, i) => (
|
|
<li key={i} className="small">
|
|
{e}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
)}
|
|
</>
|
|
)}
|
|
</Modal>
|
|
);
|
|
}
|
|
|
|
function ExcelResultModal({ result, onClose }: { result: ExcelSyncResult; onClose: () => void }) {
|
|
const s = result.summary;
|
|
return (
|
|
<Modal
|
|
open
|
|
title={`Excel import — ${result.event_name ?? result.event_id}`}
|
|
onClose={onClose}
|
|
footer={
|
|
<button className="btn primary" onClick={onClose}>
|
|
Close
|
|
</button>
|
|
}
|
|
>
|
|
{result.status === 'error' || !s ? (
|
|
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
|
{result.error ?? 'Import failed'}
|
|
</div>
|
|
) : (
|
|
<>
|
|
<div className="stat-grid">
|
|
<div className="stat">
|
|
<div className="val">{s.speakers_created}</div>
|
|
<div className="lbl">Speakers created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.sessions_created}</div>
|
|
<div className="lbl">Sessions created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.slots_created}</div>
|
|
<div className="lbl">Slots created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.speakers_linked}</div>
|
|
<div className="lbl">Speaker links</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.registrations_created}</div>
|
|
<div className="lbl">Speaker regs created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.registrations_updated}</div>
|
|
<div className="lbl">Speaker regs updated</div>
|
|
</div>
|
|
</div>
|
|
{s.errors.length > 0 && (
|
|
<div style={{ marginTop: 12 }}>
|
|
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
|
{s.errors.length} error(s)
|
|
</div>
|
|
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
|
{s.errors.map((e, i) => (
|
|
<li key={i} className="small">
|
|
{e}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
)}
|
|
</>
|
|
)}
|
|
</Modal>
|
|
);
|
|
}
|
|
|
|
function SyncResultModal({ result, onClose }: { result: SyncResult; onClose: () => void }) {
|
|
const s = result.summary;
|
|
return (
|
|
<Modal
|
|
open
|
|
title={`Sessionize sync — ${result.event_name ?? result.event_id}`}
|
|
onClose={onClose}
|
|
footer={
|
|
<button className="btn primary" onClick={onClose}>
|
|
Close
|
|
</button>
|
|
}
|
|
>
|
|
{result.status === 'error' || !s ? (
|
|
<div className="pill red" style={{ display: 'inline-block', padding: '8px 12px' }}>
|
|
{result.error ?? 'Sync failed'}
|
|
</div>
|
|
) : (
|
|
<>
|
|
<div className="stat-grid">
|
|
<div className="stat">
|
|
<div className="val">{s.speakers_created}</div>
|
|
<div className="lbl">Speakers created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.speakers_updated}</div>
|
|
<div className="lbl">Speakers updated</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.sessions_created}</div>
|
|
<div className="lbl">Sessions created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.sessions_updated}</div>
|
|
<div className="lbl">Sessions updated</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.slots_created}</div>
|
|
<div className="lbl">Slots created</div>
|
|
</div>
|
|
<div className="stat">
|
|
<div className="val">{s.speakers_linked}</div>
|
|
<div className="lbl">Speaker links</div>
|
|
</div>
|
|
</div>
|
|
{result.skipped_speakers && result.skipped_speakers.length > 0 && (
|
|
<div className="muted small">
|
|
Skipped {result.skipped_speakers.length} speaker(s) without an email: {result.skipped_speakers.join(', ')}
|
|
</div>
|
|
)}
|
|
{s.errors.length > 0 && (
|
|
<div style={{ marginTop: 12 }}>
|
|
<div className="pill red" style={{ display: 'inline-block', marginBottom: 8 }}>
|
|
{s.errors.length} error(s)
|
|
</div>
|
|
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
|
{s.errors.map((e, i) => (
|
|
<li key={i} className="small">
|
|
{e}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
)}
|
|
</>
|
|
)}
|
|
</Modal>
|
|
);
|
|
}
|
|
|
|
function fmtTime(iso: string): string {
|
|
return new Date(iso).toLocaleString([], {
|
|
month: 'short',
|
|
day: 'numeric',
|
|
hour: '2-digit',
|
|
minute: '2-digit',
|
|
});
|
|
}
|