Post-event reporting + talk networking incentives
- Talk networking: per-event talk_networking_bonus awarded when two people who shared a checked-in talk accept a connection (accept_connection re-created, shared_talk flag, get_talk_cohort RPC, points_log category check widened); Convivo Networking sub-tab inside the Connect screen (Home quick action deep-links in; Connect button reflects existing connection state and is disabled for sent/connected/declined); admin Events view bonus input (0-10). - Reports: sidecar POST /export (CSV / multi-sheet XLSX / PDF report via new pdfkit dep); APPE Admin Reports view (any event: on-screen summary, session feedback summary, top-5, CSV/Excel/PDF downloads); Activity session-feedback per-session aggregate header. - Also carried: @appe.at admin trigger + default password, bulk contact delete, session level/area + event-level feedback, agenda level/area filters, admin password self-service, schedule level/area fields. - 18/18 RPC tests; both apps build; exports verified end-to-end.
This commit is contained in:
1 parent
08ab41898b
commit
3adc0fd58f
35 files changed
+3973
-54
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { useEvent } from '../lib/useEvent';
|
||||
import {
|
||||
@@ -26,8 +26,29 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
|
||||
const fileRef = useRef<HTMLInputElement>(null);
|
||||
const { toast } = useToast();
|
||||
|
||||
// Agenda filters: level + area (free-text, dynamic — built from the distinct
|
||||
// values actually present in the agenda, so it works for numeric levels
|
||||
// (100/200/300) or text levels (Beginner/Intermediate) alike).
|
||||
const [levelFilter, setLevelFilter] = useState<string>('');
|
||||
const [areaFilter, setAreaFilter] = useState<string>('');
|
||||
|
||||
const email = contact?.email ?? '';
|
||||
|
||||
// Distinct level + area values present in the agenda (for the filter dropdowns).
|
||||
const levelOptions = useMemo(() => {
|
||||
const set = new Set<string>();
|
||||
for (const { sessions } of slots) for (const s of sessions) if (s.level) set.add(s.level);
|
||||
return [...set].sort();
|
||||
}, [slots]);
|
||||
const areaOptions = useMemo(() => {
|
||||
const set = new Set<string>();
|
||||
for (const { sessions } of slots) for (const s of sessions) if (s.area) set.add(s.area);
|
||||
return [...set].sort();
|
||||
}, [slots]);
|
||||
|
||||
const matchesFilter = (s: Session) =>
|
||||
(!levelFilter || s.level === levelFilter) && (!areaFilter || s.area === areaFilter);
|
||||
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
(async () => {
|
||||
@@ -144,9 +165,60 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
|
||||
Pick <b>one session per slot</b> — you can change until the slot starts.
|
||||
</div>
|
||||
|
||||
{/* Agenda filters: level + area (only shown if there are values to filter by). */}
|
||||
{(levelOptions.length > 0 || areaOptions.length > 0) && (
|
||||
<div className="row" style={{ gap: 8, marginTop: 10, flexWrap: 'wrap' }}>
|
||||
{levelOptions.length > 0 && (
|
||||
<select
|
||||
className="input"
|
||||
style={{ flex: 1, minWidth: 120 }}
|
||||
value={levelFilter}
|
||||
onChange={(e) => setLevelFilter(e.target.value)}
|
||||
aria-label="Filter by level"
|
||||
>
|
||||
<option value="">All levels</option>
|
||||
{levelOptions.map((l) => (
|
||||
<option key={l} value={l}>{l}</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
{areaOptions.length > 0 && (
|
||||
<select
|
||||
className="input"
|
||||
style={{ flex: 1, minWidth: 120 }}
|
||||
value={areaFilter}
|
||||
onChange={(e) => setAreaFilter(e.target.value)}
|
||||
aria-label="Filter by area"
|
||||
>
|
||||
<option value="">All areas</option>
|
||||
{areaOptions.map((a) => (
|
||||
<option key={a} value={a}>{a}</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
{(levelFilter || areaFilter) && (
|
||||
<button
|
||||
className="btn ghost small"
|
||||
onClick={() => { setLevelFilter(''); setAreaFilter(''); }}
|
||||
aria-label="Clear filters"
|
||||
>
|
||||
✕
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
{slots.map(({ slot, sessions }) => {
|
||||
const status = slotStatus(slot, now);
|
||||
const isServiceSlot = slot.type === 'service_session';
|
||||
// Apply the level/area filter to non-service sessions only (service
|
||||
// sessions have no level/area and are always shown).
|
||||
const visibleSessions = isServiceSlot
|
||||
? sessions
|
||||
: sessions.filter(matchesFilter);
|
||||
// Skip the slot if it's a talk slot and all its sessions are filtered out.
|
||||
if (!isServiceSlot && visibleSessions.length === 0) return null;
|
||||
return (
|
||||
<div className="slot-card" key={slot.id}>
|
||||
<div className="slot-head">
|
||||
@@ -160,7 +232,7 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
|
||||
{status === 'now' && <span className="pill violet">● Live</span>}
|
||||
{status === 'next' && <span className="pill cyan">Up next</span>}
|
||||
</div>
|
||||
{sessions.map((s) => {
|
||||
{visibleSessions.map((s) => {
|
||||
const picked = pickFor(slot.id) === s.id;
|
||||
const isMySession = mySpeakerSessions.includes(s.id);
|
||||
const isService = slot.type === 'service_session';
|
||||
@@ -204,6 +276,8 @@ export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) =>
|
||||
</div>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 14, flexWrap: 'wrap' }}>
|
||||
<span className="pill">{selIsService ? '' : '🎤 '}{selected.speakers}</span>
|
||||
{selected.level && <span className="pill violet">📶 {selected.level}</span>}
|
||||
{selected.area && <span className="pill cyan">🗂 {selected.area}</span>}
|
||||
{selected.capacity && <span className="pill">👥 {selected.capacity}</span>}
|
||||
{selCheckedIn && <span className="pill green">✓ Checked in</span>}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user