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:
Lago committed 2026-09-21 22:34:25 +02:00
1 parent 08ab41898b
commit 3adc0fd58f
35 files changed
+3973 -54

No files matched your search

+101 -4
View File
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { AuthProvider, useAuth } from './context/AuthContext';
import { ToastProvider } from './context/ToastContext';
import { ToastProvider, useToast } from './context/ToastContext';
import { Login } from './screens/Login';
import { Dashboard } from './views/Dashboard';
import { Contacts } from './views/Contacts';
@@ -10,7 +10,9 @@ import { Schedule } from './views/Schedule';
import { Activity } from './views/Activity';
import { Events } from './views/Events';
import { Interfaces } from './views/Interfaces';
import { Spinner } from './components/ui';
import { Reports } from './views/Reports';
import { Spinner, Modal } from './components/ui';
import { DEFAULT_ADMIN_PASSWORD } from './lib/api';
export type View =
| 'dashboard'
@@ -20,7 +22,8 @@ export type View =
| 'schedule'
| 'activity'
| 'events'
| 'interfaces';
| 'interfaces'
| 'reports';
const NAV: { id: View; label: string; ico: string }[] = [
{ id: 'dashboard', label: 'Dashboard', ico: '📊' },
@@ -31,8 +34,100 @@ const NAV: { id: View; label: string; ico: string }[] = [
{ id: 'activity', label: 'Activity', ico: '⚡' },
{ id: 'events', label: 'Events', ico: '📅' },
{ id: 'interfaces', label: 'Interfaces', ico: '🔌' },
{ id: 'reports', label: 'Reports', ico: '📤' },
];
/**
* Shown once per session when an admin signs in with the default password
* (`appe-admin-2026`). Prompts them to set a personal password. Dismissable
* ("Not now"); the prompt re-appears on the next sign-in while the default is
* in use.
*/
function ChangePasswordPrompt() {
const { contact, changePassword } = useAuth();
const { push } = useToast();
const [open, setOpen] = useState(false);
const [newPassword, setNewPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
// Open the prompt when the signed-in admin is using the default password.
useEffect(() => {
if (contact && contact.password === DEFAULT_ADMIN_PASSWORD) setOpen(true);
}, [contact]);
async function onSubmit() {
if (newPassword.length < 6) {
setError('Password must be at least 6 characters.');
return;
}
if (newPassword !== confirmPassword) {
setError('Passwords do not match.');
return;
}
setBusy(true);
setError(null);
try {
await changePassword(newPassword);
push('success', 'Password updated');
setOpen(false);
setNewPassword('');
setConfirmPassword('');
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to change password');
} finally {
setBusy(false);
}
}
return (
<Modal
open={open}
onClose={() => setOpen(false)}
title="Change your password"
footer={
<>
<button className="btn ghost" onClick={() => setOpen(false)}>
Not now
</button>
<button className="btn primary" onClick={onSubmit} disabled={busy}>
{busy ? 'Saving…' : 'Save password'}
</button>
</>
}
>
<p style={{ margin: 0, fontSize: 13.5, color: 'var(--muted)' }}>
You signed in with the default admin password. Set a personal password
so only you can access this account.
</p>
<div className="field">
<label>New password</label>
<input
className="input"
type="password"
placeholder="••••••••••"
value={newPassword}
onChange={(e) => setNewPassword(e.target.value)}
autoComplete="new-password"
/>
</div>
<div className="field">
<label>Confirm new password</label>
<input
className="input"
type="password"
placeholder="••••••••••"
value={confirmPassword}
onChange={(e) => setConfirmPassword(e.target.value)}
autoComplete="new-password"
/>
</div>
{error && <div className="login-err">{error}</div>}
</Modal>
);
}
function Shell() {
const { contact, loading, signOut } = useAuth();
const [view, setView] = useState<View>('dashboard');
@@ -49,6 +144,7 @@ function Shell() {
return (
<div className="app">
<ChangePasswordPrompt />
<aside className="sidebar">
<div className="brand">
<div className="logo"><img src="/icon-192.png" alt="APPE" /></div>
@@ -99,6 +195,7 @@ function Shell() {
{view === 'activity' && <Activity />}
{view === 'events' && <Events />}
{view === 'interfaces' && <Interfaces />}
{view === 'reports' && <Reports />}
</main>
</div>
);