feat(admin): material column + inline material manager in the Sessions view
- Sessions table gains a Material column (uploaded pill with the clean filename in its tooltip, dash when none) - Expanded session row: shared MaterialPanel (open / download / delete with confirm) plus immediate upload/replace via MaterialUploadRow - Schedule session modal refactored onto the same MaterialPanel; its upload keeps the uploads-on-Save behavior - sessions-view e2e: new test pins the pill, panel buttons, clean filename, unlock hint and replace control
This commit is contained in:
1 parent
d3f083a99e
commit
076904ffd3
6 files changed
+210
-77
No files matched your search
@@ -0,0 +1,145 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
|
import {
|
||||||
|
downloadSessionMaterial,
|
||||||
|
openSessionMaterial,
|
||||||
|
removeSessionMaterial,
|
||||||
|
sessionMaterialName,
|
||||||
|
uploadSessionMaterial,
|
||||||
|
} from '../lib/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See / open / download / delete a session's material file. Admins bypass the
|
||||||
|
* attendee time-lock in storage RLS (`can_read_session_material` /
|
||||||
|
* `can_write_session_material` allow `is_admin()`), so every action works at
|
||||||
|
* any time — the `unlocksAt` hint is only about when *attendees* get access.
|
||||||
|
* Shared by the Schedule session modal and the Sessions view's expanded row.
|
||||||
|
*/
|
||||||
|
export function MaterialPanel(props: {
|
||||||
|
session: { id: string; material_path: string | null };
|
||||||
|
/** Human-readable unlock moment, e.g. "Thu, Oct 22, 16:30" — null falls back to a generic hint. */
|
||||||
|
unlocksAt?: string | null;
|
||||||
|
/** Notified after a successful delete (reload / close). */
|
||||||
|
onChanged: () => void;
|
||||||
|
}) {
|
||||||
|
const [busy, setBusy] = useState<'open' | 'download' | 'delete' | null>(null);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const path = props.session.material_path;
|
||||||
|
|
||||||
|
if (!path) return <p className="muted small">No material uploaded yet.</p>;
|
||||||
|
|
||||||
|
const name = sessionMaterialName(path);
|
||||||
|
|
||||||
|
async function run(action: 'open' | 'download' | 'delete', fn: () => Promise<void>) {
|
||||||
|
setBusy(action);
|
||||||
|
setError(null);
|
||||||
|
try {
|
||||||
|
await fn();
|
||||||
|
} catch (cause) {
|
||||||
|
setError(cause instanceof Error ? cause.message : 'Material action failed');
|
||||||
|
} finally {
|
||||||
|
setBusy(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="material-panel" data-testid={`material-panel-${props.session.id}`}>
|
||||||
|
<div className="material-file" title={path}>
|
||||||
|
📎 {name}
|
||||||
|
</div>
|
||||||
|
<div className="material-actions">
|
||||||
|
<button
|
||||||
|
className="btn small"
|
||||||
|
onClick={() => void run('open', () => openSessionMaterial(path))}
|
||||||
|
disabled={busy !== null}
|
||||||
|
>
|
||||||
|
{busy === 'open' ? 'Opening…' : 'Open'}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn small"
|
||||||
|
onClick={() => void run('download', () => downloadSessionMaterial(path))}
|
||||||
|
disabled={busy !== null}
|
||||||
|
>
|
||||||
|
{busy === 'download' ? 'Downloading…' : '⬇ Download'}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn small danger"
|
||||||
|
onClick={() => {
|
||||||
|
if (!window.confirm(`Delete "${name}"? Attendees and the speaker will no longer be able to download it.`)) return;
|
||||||
|
void run('delete', async () => {
|
||||||
|
await removeSessionMaterial(props.session.id);
|
||||||
|
props.onChanged();
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
disabled={busy !== null}
|
||||||
|
>
|
||||||
|
{busy === 'delete' ? 'Deleting…' : 'Delete'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p className="muted small">
|
||||||
|
{props.unlocksAt
|
||||||
|
? `Attendees can download it once the session ends (${props.unlocksAt}).`
|
||||||
|
: 'Attendees can download it once the session ends.'}
|
||||||
|
</p>
|
||||||
|
{error && (
|
||||||
|
<p className="feedback-error" role="alert">
|
||||||
|
{error}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Immediate (not on-save) upload/replace of a session material — uploads the
|
||||||
|
* picked file and points the session at it in one go, removing the previous
|
||||||
|
* object. Used in the Sessions view's expanded row; the Schedule modal keeps
|
||||||
|
* its upload-on-save behavior instead.
|
||||||
|
*/
|
||||||
|
export function MaterialUploadRow(props: {
|
||||||
|
session: { id: string; material_path: string | null };
|
||||||
|
onUploaded: (path: string) => void;
|
||||||
|
}) {
|
||||||
|
const [busy, setBusy] = useState(false);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
const [uploadedName, setUploadedName] = useState<string | null>(null);
|
||||||
|
const previousPath = props.session.material_path;
|
||||||
|
|
||||||
|
async function upload(file: File) {
|
||||||
|
setBusy(true);
|
||||||
|
setError(null);
|
||||||
|
setUploadedName(null);
|
||||||
|
try {
|
||||||
|
const path = await uploadSessionMaterial(props.session.id, file, previousPath);
|
||||||
|
setUploadedName(file.name);
|
||||||
|
props.onUploaded(path);
|
||||||
|
} catch (cause) {
|
||||||
|
setError(cause instanceof Error ? cause.message : 'Upload failed');
|
||||||
|
} finally {
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="material-upload">
|
||||||
|
<label className="btn small" style={{ cursor: 'pointer' }}>
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
style={{ display: 'none' }}
|
||||||
|
disabled={busy}
|
||||||
|
onChange={(e) => {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
e.target.value = '';
|
||||||
|
if (file) void upload(file);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{busy ? 'Uploading…' : previousPath ? 'Replace file…' : 'Upload file…'}
|
||||||
|
</label>
|
||||||
|
{uploadedName && !busy && <span className="muted small">Uploaded “{uploadedName}”</span>}
|
||||||
|
{error && (
|
||||||
|
<span className="feedback-error small" role="alert">
|
||||||
|
{error}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -354,6 +354,10 @@ tr.row-detail > td { padding: 0; background: var(--surface-2); border-bottom: 1p
|
|||||||
.session-detail { padding: 16px 18px 20px; }
|
.session-detail { padding: 16px 18px 20px; }
|
||||||
.session-desc { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--text); max-width: 80ch; white-space: pre-wrap; }
|
.session-desc { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--text); max-width: 80ch; white-space: pre-wrap; }
|
||||||
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
|
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
|
||||||
|
.material-panel { display: flex; flex-direction: column; gap: 8px; }
|
||||||
|
.material-panel .material-file { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
|
||||||
|
.material-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
|
||||||
|
.material-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
|
||||||
.detail-cols h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #5a5555; margin: 0 0 9px; }
|
.detail-cols h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: #5a5555; margin: 0 0 9px; }
|
||||||
.detail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; max-height: 280px; overflow-y: auto; }
|
.detail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; max-height: 280px; overflow-y: auto; }
|
||||||
.detail-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
|
.detail-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
|
||||||
|
|||||||
@@ -2,21 +2,18 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|||||||
import { supabase } from '../lib/supabase';
|
import { supabase } from '../lib/supabase';
|
||||||
import {
|
import {
|
||||||
deleteEventSchedule,
|
deleteEventSchedule,
|
||||||
downloadSessionMaterial,
|
|
||||||
getAllContacts,
|
getAllContacts,
|
||||||
getAllSessionSpeakers,
|
getAllSessionSpeakers,
|
||||||
getActiveEvent,
|
getActiveEvent,
|
||||||
getSessions,
|
getSessions,
|
||||||
getSlots,
|
getSlots,
|
||||||
removeSessionMaterial,
|
|
||||||
openSessionMaterial,
|
|
||||||
sessionMaterialName,
|
|
||||||
setSessionSpeakers,
|
setSessionSpeakers,
|
||||||
uploadSessionMaterial,
|
uploadSessionMaterial,
|
||||||
} from '../lib/api';
|
} from '../lib/api';
|
||||||
import type { Contact, Event, Session, SessionSpeaker, Slot, SlotType } from '../lib/types';
|
import type { Contact, Event, Session, SessionSpeaker, Slot, SlotType } from '../lib/types';
|
||||||
import { useSilentRefresh } from '../lib/useSilentRefresh';
|
import { useSilentRefresh } from '../lib/useSilentRefresh';
|
||||||
import { useToast } from '../context/ToastContext';
|
import { useToast } from '../context/ToastContext';
|
||||||
|
import { MaterialPanel } from '../components/MaterialPanel';
|
||||||
import { Empty, Modal, Spinner, TypeBadge } from '../components/ui';
|
import { Empty, Modal, Spinner, TypeBadge } from '../components/ui';
|
||||||
|
|
||||||
const SLOT_TYPES: SlotType[] = ['session', 'service_session'];
|
const SLOT_TYPES: SlotType[] = ['session', 'service_session'];
|
||||||
@@ -470,8 +467,6 @@ function SessionModal({
|
|||||||
const [area, setArea] = useState(session?.area ?? '');
|
const [area, setArea] = useState(session?.area ?? '');
|
||||||
const [speakerEmails, setSpeakerEmails] = useState<string[]>(currentSpeakers);
|
const [speakerEmails, setSpeakerEmails] = useState<string[]>(currentSpeakers);
|
||||||
const [material, setMaterial] = useState<File | null>(null);
|
const [material, setMaterial] = useState<File | null>(null);
|
||||||
const [matBusy, setMatBusy] = useState(false);
|
|
||||||
const [matError, setMatError] = useState<string | null>(null);
|
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
@@ -580,66 +575,11 @@ function SessionModal({
|
|||||||
{session && (
|
{session && (
|
||||||
<div className="field" data-testid="session-material">
|
<div className="field" data-testid="session-material">
|
||||||
<label>Material</label>
|
<label>Material</label>
|
||||||
{session.material_path ? (
|
<MaterialPanel
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
session={session}
|
||||||
<div className="muted small">📎 {sessionMaterialName(session.material_path)}</div>
|
unlocksAt={slot ? `${fmtDate(slot.slot_date)}, ${fmtTime(slot.end_time)}` : null}
|
||||||
<div className="row" style={{ gap: 10, flexWrap: 'wrap' }}>
|
onChanged={() => onSaved('Material removed')}
|
||||||
<button
|
/>
|
||||||
className="btn small"
|
|
||||||
disabled={busy || matBusy}
|
|
||||||
onClick={async () => {
|
|
||||||
setMatBusy(true);
|
|
||||||
setMatError(null);
|
|
||||||
try {
|
|
||||||
await openSessionMaterial(session.material_path!);
|
|
||||||
} catch (e) {
|
|
||||||
setMatError(e instanceof Error ? e.message : 'Could not open material');
|
|
||||||
} finally {
|
|
||||||
setMatBusy(false);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Open
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="btn small"
|
|
||||||
disabled={busy || matBusy}
|
|
||||||
onClick={async () => {
|
|
||||||
setMatBusy(true);
|
|
||||||
setMatError(null);
|
|
||||||
try {
|
|
||||||
await downloadSessionMaterial(session.material_path!);
|
|
||||||
} catch (e) {
|
|
||||||
setMatError(e instanceof Error ? e.message : 'Download failed');
|
|
||||||
} finally {
|
|
||||||
setMatBusy(false);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
⬇ Download
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
className="btn small danger"
|
|
||||||
disabled={busy || matBusy}
|
|
||||||
onClick={async () => {
|
|
||||||
if (!confirm(`Delete material "${sessionMaterialName(session.material_path!)}"? Attendees and speakers lose access immediately.`)) return;
|
|
||||||
setMatBusy(true);
|
|
||||||
try {
|
|
||||||
await removeSessionMaterial(session.id);
|
|
||||||
onSaved('Material removed');
|
|
||||||
} catch (e) {
|
|
||||||
setMatBusy(false);
|
|
||||||
setMatError(e instanceof Error ? e.message : 'Delete failed');
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<span className="muted small">No material uploaded yet.</span>
|
|
||||||
)}
|
|
||||||
<input
|
<input
|
||||||
className="input"
|
className="input"
|
||||||
type="file"
|
type="file"
|
||||||
@@ -650,14 +590,6 @@ function SessionModal({
|
|||||||
{session.material_path ? 'Replaces current file on Save' : 'Uploads on Save'}: {material.name}
|
{session.material_path ? 'Replaces current file on Save' : 'Uploads on Save'}: {material.name}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{slot && (
|
|
||||||
<span className="muted small">
|
|
||||||
{session.material_path
|
|
||||||
? `Attendees can download it once the session ends (${fmtDate(slot.slot_date)}, ${fmtTime(slot.end_time)}).`
|
|
||||||
: `Once uploaded, attendees can download it when the session ends (${fmtDate(slot.slot_date)}, ${fmtTime(slot.end_time)}).`}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{matError && <span className="feedback-error small">{matError}</span>}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
getLlmSettings,
|
getLlmSettings,
|
||||||
getSessions,
|
getSessions,
|
||||||
getSlots,
|
getSlots,
|
||||||
|
sessionMaterialName,
|
||||||
} from '../lib/api';
|
} from '../lib/api';
|
||||||
import type {
|
import type {
|
||||||
Checkin,
|
Checkin,
|
||||||
@@ -24,6 +25,7 @@ import type {
|
|||||||
Slot,
|
Slot,
|
||||||
} from '../lib/types';
|
} from '../lib/types';
|
||||||
import { Avatar, Empty, Spinner, Tooltip } from '../components/ui';
|
import { Avatar, Empty, Spinner, Tooltip } from '../components/ui';
|
||||||
|
import { MaterialPanel, MaterialUploadRow } from '../components/MaterialPanel';
|
||||||
import { useSilentRefresh } from '../lib/useSilentRefresh';
|
import { useSilentRefresh } from '../lib/useSilentRefresh';
|
||||||
|
|
||||||
const timeLabel = (slot?: Slot) => (slot ? `${slot.start_time.slice(0, 5)}–${slot.end_time.slice(0, 5)}` : '');
|
const timeLabel = (slot?: Slot) => (slot ? `${slot.start_time.slice(0, 5)}–${slot.end_time.slice(0, 5)}` : '');
|
||||||
@@ -429,6 +431,7 @@ export function Sessions() {
|
|||||||
<th>When</th>
|
<th>When</th>
|
||||||
<th>Session</th>
|
<th>Session</th>
|
||||||
<th>Speakers</th>
|
<th>Speakers</th>
|
||||||
|
<th>Material</th>
|
||||||
<th style={{ textAlign: 'right' }}>Check-ins</th>
|
<th style={{ textAlign: 'right' }}>Check-ins</th>
|
||||||
<th style={{ textAlign: 'right' }}>Feedback</th>
|
<th style={{ textAlign: 'right' }}>Feedback</th>
|
||||||
<th>AI summary</th>
|
<th>AI summary</th>
|
||||||
@@ -478,6 +481,19 @@ export function Sessions() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
{s.material_path ? (
|
||||||
|
<Tooltip title={sessionMaterialName(s.material_path)} content="Manage it in the expanded row">
|
||||||
|
<span className="pill green" data-testid={`material-yes-${s.id}`}>
|
||||||
|
uploaded
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
<span className="muted small" data-testid={`material-none-${s.id}`}>
|
||||||
|
—
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
<td style={{ textAlign: 'right' }}>
|
<td style={{ textAlign: 'right' }}>
|
||||||
<span className={att.length > 0 ? 'att-count' : 'muted'}>{att.length}</span>
|
<span className={att.length > 0 ? 'att-count' : 'muted'}>{att.length}</span>
|
||||||
{s.capacity ? <span className="muted small"> / {s.capacity}</span> : null}
|
{s.capacity ? <span className="muted small"> / {s.capacity}</span> : null}
|
||||||
@@ -507,7 +523,7 @@ export function Sessions() {
|
|||||||
</tr>
|
</tr>
|
||||||
{open && (
|
{open && (
|
||||||
<tr className="row-detail">
|
<tr className="row-detail">
|
||||||
<td colSpan={6}>
|
<td colSpan={7}>
|
||||||
<div className="session-detail">
|
<div className="session-detail">
|
||||||
{s.description && <p className="session-desc">{s.description}</p>}
|
{s.description && <p className="session-desc">{s.description}</p>}
|
||||||
<div className="detail-cols">
|
<div className="detail-cols">
|
||||||
@@ -568,6 +584,15 @@ export function Sessions() {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<h3 className="h3">Material</h3>
|
||||||
|
<MaterialPanel
|
||||||
|
session={s}
|
||||||
|
unlocksAt={slot ? `${fmtDay(slot.slot_date)}, ${slot.end_time.slice(0, 5)}` : null}
|
||||||
|
onChanged={() => void load(true)}
|
||||||
|
/>
|
||||||
|
<MaterialUploadRow session={s} onUploaded={() => void load(true)} />
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ It runs on **port 3001** (Vite dev) or as the `convivo-admin` Docker container
|
|||||||
| **Registrations** | Per active event: list (contact, type, **QR token**, checked_in, points). Change type (enforces the sponsor rule — a failed sponsor change opens an **in-place sponsor lookup** popup), mark checked-in, **view the QR token** (final — no reset), and **preview the attendee's badge** (renders the event's badge layout with that row's own name / ticket type / QR token / company), plus a **Print** button that queues the badge on the print station ([../backend/printing.md](../backend/printing.md)). When the event has **no badge configured**, the Badge button stays visible but **grayed out**, and hovering it shows a tooltip explaining a badge must be designed first. A general search matches **first name, last name, email address or type**; the **Type**, **QR token** (ticket) and **Checked in** columns each have an Excel-style **multi-select filter** with live counts. The **checked-in toggle is per-row and optimistic**: it patches that one row (and its points) in place — **no list reload**, so rows never jump or vanish mid-edit (the list is sorted by points) — while a small "Saving…" pulse marks the busy row and only that checkbox is disabled; other rows stay live and a second row can be toggled concurrently. A rejected write rolls the row back to the server's values. Changing the type behaves the same way. The toggle is what grants front-desk eligibility from the console (see [../backend/rpcs.md](../backend/rpcs.md)). Points moved here from Contacts: each point-earning row of the **active** event carries a **Points** button (`adjust_points` always targets the active event's pass, so on other events the button is disabled with an explanatory tooltip), opening a modal that applies the delta, patches the row in place — no reload, no reordering — and lets the silent refresher settle the truth. Rows excluded from points (the `_points_eligible` mirror: type staff, Admin contact, `@appe.at`) show the "no points" marker and no button. |
|
| **Registrations** | Per active event: list (contact, type, **QR token**, checked_in, points). Change type (enforces the sponsor rule — a failed sponsor change opens an **in-place sponsor lookup** popup), mark checked-in, **view the QR token** (final — no reset), and **preview the attendee's badge** (renders the event's badge layout with that row's own name / ticket type / QR token / company), plus a **Print** button that queues the badge on the print station ([../backend/printing.md](../backend/printing.md)). When the event has **no badge configured**, the Badge button stays visible but **grayed out**, and hovering it shows a tooltip explaining a badge must be designed first. A general search matches **first name, last name, email address or type**; the **Type**, **QR token** (ticket) and **Checked in** columns each have an Excel-style **multi-select filter** with live counts. The **checked-in toggle is per-row and optimistic**: it patches that one row (and its points) in place — **no list reload**, so rows never jump or vanish mid-edit (the list is sorted by points) — while a small "Saving…" pulse marks the busy row and only that checkbox is disabled; other rows stay live and a second row can be toggled concurrently. A rejected write rolls the row back to the server's values. Changing the type behaves the same way. The toggle is what grants front-desk eligibility from the console (see [../backend/rpcs.md](../backend/rpcs.md)). Points moved here from Contacts: each point-earning row of the **active** event carries a **Points** button (`adjust_points` always targets the active event's pass, so on other events the button is disabled with an explanatory tooltip), opening a modal that applies the delta, patches the row in place — no reload, no reordering — and lets the silent refresher settle the truth. Rows excluded from points (the `_points_eligible` mirror: type staff, Admin contact, `@appe.at`) show the "no points" marker and no button. |
|
||||||
| **Sponsors** | List (paid only visible to attendees; admin sees all). Add/edit (type, name, email, phone, paid, amount, **contact search-and-pick**). |
|
| **Sponsors** | List (paid only visible to attendees; admin sees all). Add/edit (type, name, email, phone, paid, amount, **contact search-and-pick**). |
|
||||||
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state and `average_feedback`), plus an admin-only **Delete current schedule** action for the active event. |
|
| **Schedule** | Slots (with a **type optionset** — `Session` / `Service Session`) + sessions (with speakers 1:N via a **multi-select search dropdown**, material upload with a **submitted / not submitted** state and `average_feedback`), plus an admin-only **Delete current schedule** action for the active event. |
|
||||||
| **Sessions** | Everything about the **active event's sessions** in one place (nav sits between Schedule and Activity): one row per session with its slot date/time, room / level / area, **speakers**, **check-in count** (with capacity when set), **average rating and response count**, and whether an AI summary is stored, **out of date**, or impossible. Click a row to expand it: description, the full **speaker list**, the **roster of who checked in** (with time and which staff member scanned them), and the stored **AI summary**. A **search** box matches title, room, level, area or speaker, and the **attendee filter** answers "which sessions did this person actually attend?" — the list narrows to those sessions, the header states the count, and the expanded roster highlights that person. **Generate AI Feedback Summary** (see below) summarises every session with feedback in one click. Data comes from `sessions` ⨝ `slots` ⨝ `session_speakers` ⨝ `checkins` ⨝ `feedback`, joined in the client so the numbers match the other views exactly and no new RLS policy is needed. |
|
| **Sessions** | Everything about the **active event's sessions** in one place (nav sits between Schedule and Activity): one row per session with its slot date/time, room / level / area, **speakers**, **material** (an `uploaded` pill — see [Session material](#session-material)), **check-in count** (with capacity when set), **average rating and response count**, and whether an AI summary is stored, **out of date**, or impossible. Click a row to expand it: description, the full **speaker list**, the **roster of who checked in** (with time and which staff member scanned them), the stored **AI summary**, and the **material manager** (open / download / delete / upload on behalf of the speaker). A **search** box matches title, room, level, area or speaker, and the **attendee filter** answers "which sessions did this person actually attend?" — the list narrows to those sessions, the header states the count, and the expanded roster highlights that person. **Generate AI Feedback Summary** (see below) summarises every session with feedback in one click. Data comes from `sessions` ⨝ `slots` ⨝ `session_speakers` ⨝ `checkins` ⨝ `feedback`, joined in the client so the numbers match the other views exactly and no new RLS policy is needed. |
|
||||||
| **Activity** | Tables of check-ins, connections, and feedback (per active event; staff auto-pairings — `connections.auto` — are hidden here too), with manual **Generate AI Summary** controls for the event and individual sessions. |
|
| **Activity** | Tables of check-ins, connections, and feedback (per active event; staff auto-pairings — `connections.auto` — are hidden here too), with manual **Generate AI Summary** controls for the event and individual sessions. |
|
||||||
| **Raffle** | Draws eligible attendees one at a time for the active event. Configure the number of picks (default 5), then **Spin** a roulette that decelerates onto a server-chosen winner; repeat until the pick count is reached. Excludes staff/Admin and the leaderboard top 3, and no one can win twice in a run. **New run** clears the current winners. See [../backend/rpcs.md#raffle](../backend/rpcs.md#raffle). |
|
| **Raffle** | Draws eligible attendees one at a time for the active event. Configure the number of picks (default 5), then **Spin** a roulette that decelerates onto a server-chosen winner; repeat until the pick count is reached. Excludes staff/Admin and the leaderboard top 3, and no one can win twice in a run. **New run** clears the current winners. See [../backend/rpcs.md#raffle](../backend/rpcs.md#raffle). |
|
||||||
| **Badges** | A **per-event WYSIWYG badge / PDF layout editor** (modelled on pretix's PDF Editor). Pick the event, then design one or more named **layouts** (a **Default** per event, switchable / creatable / deletable). Add **text boxes**, **QR codes** and **images** to a millimetre canvas; drag to move, use the 8 resize handles + rotation handle, **Shift-click to multi-select**, and **press `Del`** to remove. While dragging, **PowerPoint-style smart guides** appear — dashed alignment lines (edges / centres, page and neighbouring items) plus equal-spacing lines — and the element **snaps** to them. A **Word-style align** toolbar (left / center / right, top / middle / bottom) plus **PowerPoint-style** object alignment — align to the **page** or to the **selection**, and **distribute** horizontally / vertically — with the same controls in the properties panel. Text binds to attendee fields (name, email, ticket type, QR token, event name, **company / organizer**, or static) with font, size, line-height, colour, bold/italic, a labelled **Align text in box** section (horizontal left / center / right and vertical top / middle / bottom, inside the element's own frame) and case transform; QR binds to the token / check-in URL / email / name / static. **Undo/redo** (`Ctrl`+`Z` / `Ctrl`+`Y`, also `Ctrl`+`Shift`+`Z`), a **Preview** mode (no handles), a **JSON** view of the layout, and **Save**. Previewed against a real sample registration. See [../backend/rpcs.md#badge-editor](../backend/rpcs.md#badge-editor). |
|
| **Badges** | A **per-event WYSIWYG badge / PDF layout editor** (modelled on pretix's PDF Editor). Pick the event, then design one or more named **layouts** (a **Default** per event, switchable / creatable / deletable). Add **text boxes**, **QR codes** and **images** to a millimetre canvas; drag to move, use the 8 resize handles + rotation handle, **Shift-click to multi-select**, and **press `Del`** to remove. While dragging, **PowerPoint-style smart guides** appear — dashed alignment lines (edges / centres, page and neighbouring items) plus equal-spacing lines — and the element **snaps** to them. A **Word-style align** toolbar (left / center / right, top / middle / bottom) plus **PowerPoint-style** object alignment — align to the **page** or to the **selection**, and **distribute** horizontally / vertically — with the same controls in the properties panel. Text binds to attendee fields (name, email, ticket type, QR token, event name, **company / organizer**, or static) with font, size, line-height, colour, bold/italic, a labelled **Align text in box** section (horizontal left / center / right and vertical top / middle / bottom, inside the element's own frame) and case transform; QR binds to the token / check-in URL / email / name / static. **Undo/redo** (`Ctrl`+`Z` / `Ctrl`+`Y`, also `Ctrl`+`Shift`+`Z`), a **Preview** mode (no handles), a **JSON** view of the layout, and **Save**. Previewed against a real sample registration. See [../backend/rpcs.md#badge-editor](../backend/rpcs.md#badge-editor). |
|
||||||
@@ -303,6 +303,12 @@ the attendee time-lock):
|
|||||||
directly), the previous object is deleted, and a failed DB update rolls the
|
directly), the previous object is deleted, and a failed DB update rolls the
|
||||||
fresh upload back. New sessions upload right after creation.
|
fresh upload back. New sessions upload right after creation.
|
||||||
|
|
||||||
|
The **Sessions** view carries the same manager: a **Material** column shows an
|
||||||
|
`uploaded` pill (clean filename in its tooltip) or a dash, and the expanded
|
||||||
|
row exposes **Open / Download / Delete** plus an **immediate upload/replace**
|
||||||
|
input — handy for answering "my file is missing" tickets without hunting the
|
||||||
|
schedule grid. Both surfaces share `components/MaterialPanel.tsx`.
|
||||||
|
|
||||||
### Feedback AI Summaries
|
### Feedback AI Summaries
|
||||||
|
|
||||||
Configure the complete OpenAI-compatible HTTPS endpoint, model and optional key
|
Configure the complete OpenAI-compatible HTTPS endpoint, model and optional key
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ type Harness = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mkSessions = () => [
|
const mkSessions = () => [
|
||||||
{ id: 's1', event_id: eventId, slot_id: 1, title: 'Opening Keynote', description: 'Why we are here.', room: 'Hall A', capacity: 200, level: 'all', area: 'keynote', average_feedback: null, ai_generated_feedback: null, material_path: null, created_at: 'x' },
|
{ id: 's1', event_id: eventId, slot_id: 1, title: 'Opening Keynote', description: 'Why we are here.', room: 'Hall A', capacity: 200, level: 'all', area: 'keynote', average_feedback: null, ai_generated_feedback: null, material_path: 'sessions/s1/1730000000000-keynote.pdf', created_at: 'x' },
|
||||||
{ id: 's2', event_id: eventId, slot_id: 1, title: 'Power Apps Deep Dive', description: null, room: 'Room 2', capacity: 40, level: '200', area: 'power apps', average_feedback: null, ai_generated_feedback: null, material_path: null, created_at: 'x' },
|
{ id: 's2', event_id: eventId, slot_id: 1, title: 'Power Apps Deep Dive', description: null, room: 'Room 2', capacity: 40, level: '200', area: 'power apps', average_feedback: null, ai_generated_feedback: null, material_path: null, created_at: 'x' },
|
||||||
{ id: 's3', event_id: eventId, slot_id: 2, title: 'Copilot Workshop', description: null, room: 'Room 3', capacity: null, level: null, area: null, average_feedback: null, ai_generated_feedback: null, material_path: null, created_at: 'x' },
|
{ id: 's3', event_id: eventId, slot_id: 2, title: 'Copilot Workshop', description: null, room: 'Room 3', capacity: null, level: null, area: null, average_feedback: null, ai_generated_feedback: null, material_path: null, created_at: 'x' },
|
||||||
];
|
];
|
||||||
@@ -164,6 +164,27 @@ test.describe('Sessions view', () => {
|
|||||||
await page.screenshot({ path: testInfo.outputPath('sessions-desktop.png'), fullPage: true });
|
await page.screenshot({ path: testInfo.outputPath('sessions-desktop.png'), fullPage: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('shows a Material column and lets staff manage the file from the expanded row', async ({ page }) => {
|
||||||
|
const h: Harness = { feedbackSessions: [], stored: [], summaryDelayMs: 0, failFor: [], summaryRequests: [] };
|
||||||
|
await openAdmin(page, h);
|
||||||
|
|
||||||
|
const keynote = sessionRows(page).filter({ hasText: 'Opening Keynote' }).first();
|
||||||
|
const workshop = sessionRows(page).filter({ hasText: 'Copilot Workshop' }).first();
|
||||||
|
await expect(keynote.getByTestId('material-yes-s1')).toHaveText('uploaded');
|
||||||
|
await expect(workshop.getByTestId('material-none-s3')).toBeVisible();
|
||||||
|
|
||||||
|
await keynote.click();
|
||||||
|
const detail = page.locator('tr.row-detail');
|
||||||
|
await expect(detail.getByRole('heading', { name: 'Material' })).toBeVisible();
|
||||||
|
// The clean filename is shown (storage timestamp prefix stripped).
|
||||||
|
await expect(detail.getByTestId('material-panel-s1')).toContainText('keynote.pdf');
|
||||||
|
await expect(detail.getByRole('button', { name: 'Open' })).toBeVisible();
|
||||||
|
await expect(detail.getByRole('button', { name: '⬇ Download' })).toBeVisible();
|
||||||
|
await expect(detail.getByRole('button', { name: 'Delete' })).toBeVisible();
|
||||||
|
await expect(detail.getByText('Attendees can download it once the session ends (Nov 01, 10:00).')).toBeVisible();
|
||||||
|
await expect(detail.getByText('Replace file…')).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
test('the attendee filter narrows to the sessions that person checked into', async ({ page }) => {
|
test('the attendee filter narrows to the sessions that person checked into', async ({ page }) => {
|
||||||
const h: Harness = { feedbackSessions: ['s1', 's2'], stored: [], summaryDelayMs: 0, failFor: [], summaryRequests: [] };
|
const h: Harness = { feedbackSessions: ['s1', 's2'], stored: [], summaryDelayMs: 0, failFor: [], summaryRequests: [] };
|
||||||
await openAdmin(page, h);
|
await openAdmin(page, h);
|
||||||
|
|||||||
Reference in new issue
Block a user