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
@@ -29,7 +29,7 @@ type Harness = {
|
||||
};
|
||||
|
||||
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: '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 });
|
||||
});
|
||||
|
||||
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 }) => {
|
||||
const h: Harness = { feedbackSessions: ['s1', 's2'], stored: [], summaryDelayMs: 0, failFor: [], summaryRequests: [] };
|
||||
await openAdmin(page, h);
|
||||
|
||||
Reference in new issue
Block a user