Admin: per-event registrations view, contact deletion, collapsible interface logs
- 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]>
This commit is contained in:
1 parent
509e342204
commit
a1fd108e4c
4 files changed
+197
-66
No files matched your search
@@ -37,6 +37,8 @@ export function Interfaces() {
|
||||
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);
|
||||
@@ -346,54 +348,85 @@ export function Interfaces() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Recent Pretix runs (audit) */}
|
||||
<div className="card" style={{ marginBottom: 18 }}>
|
||||
<h2 className="h2">📜 Recent Pretix runs {selected ? `— ${selected.name}` : ''}</h2>
|
||||
{pretixRuns.length === 0 ? (
|
||||
<Empty icon="🎟" text="No Pretix sync runs recorded for this event yet." />
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table className="data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Started</th>
|
||||
<th>Finished</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{pretixRuns.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>
|
||||
{/* 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 runs (audit) */}
|
||||
<div className="card">
|
||||
<h2 className="h2">📜 Recent runs {selected ? `— ${selected.name}` : ''}</h2>
|
||||
{runs.length === 0 ? (
|
||||
<Empty icon="📜" text="No 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">
|
||||
<div className="table-wrap" style={{ marginTop: 12 }}>
|
||||
<table className="data">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -425,12 +458,8 @@ export function Interfaces() {
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{result && <SyncResultModal result={result} onClose={() => setResult(null)} />}
|
||||
{excelResult && <ExcelResultModal result={excelResult} onClose={() => setExcelResult(null)} />}
|
||||
{pretixResult && <PretixResultModal result={pretixResult} onClose={() => setPretixResult(null)} />}
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user