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 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
22d2418125
commit
45ab567355
6 files changed
+210
-77
No files matched your search
@@ -12,6 +12,7 @@ import {
|
||||
getLlmSettings,
|
||||
getSessions,
|
||||
getSlots,
|
||||
sessionMaterialName,
|
||||
} from '../lib/api';
|
||||
import type {
|
||||
Checkin,
|
||||
@@ -24,6 +25,7 @@ import type {
|
||||
Slot,
|
||||
} from '../lib/types';
|
||||
import { Avatar, Empty, Spinner, Tooltip } from '../components/ui';
|
||||
import { MaterialPanel, MaterialUploadRow } from '../components/MaterialPanel';
|
||||
import { useSilentRefresh } from '../lib/useSilentRefresh';
|
||||
|
||||
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>Session</th>
|
||||
<th>Speakers</th>
|
||||
<th>Material</th>
|
||||
<th style={{ textAlign: 'right' }}>Check-ins</th>
|
||||
<th style={{ textAlign: 'right' }}>Feedback</th>
|
||||
<th>AI summary</th>
|
||||
@@ -478,6 +481,19 @@ export function Sessions() {
|
||||
</div>
|
||||
)}
|
||||
</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' }}>
|
||||
<span className={att.length > 0 ? 'att-count' : 'muted'}>{att.length}</span>
|
||||
{s.capacity ? <span className="muted small"> / {s.capacity}</span> : null}
|
||||
@@ -507,7 +523,7 @@ export function Sessions() {
|
||||
</tr>
|
||||
{open && (
|
||||
<tr className="row-detail">
|
||||
<td colSpan={6}>
|
||||
<td colSpan={7}>
|
||||
<div className="session-detail">
|
||||
{s.description && <p className="session-desc">{s.description}</p>}
|
||||
<div className="detail-cols">
|
||||
@@ -568,6 +584,15 @@ export function Sessions() {
|
||||
</p>
|
||||
)}
|
||||
</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>
|
||||
</td>
|
||||
|
||||
Reference in new issue
Block a user