feat(admin): full session material management in the session editor

See the attached file (clean name), Open (signed-URL preview), Download
(authenticated blob under the original filename), Delete (confirm, storage
object + path, errors surface), and Upload/Replace with previous-object
cleanup and upload rollback on DB failure. Admins already passed every
storage RLS gate for material writes, so no migration; this also documents
and smoke-verifies insert/read/update/delete as an impersonated admin.
Also fixes the stale e2e expectation that the speaker-portal download is an
<a href> (it became an authenticated blob button with the private bucket).

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:
committed 2026-10-21 21:17:02 +02:00
1 parent ea1ed87fc9
commit 5619b94c97
5 files changed
+150 -43

No files matched your search

+3 -2
View File
@@ -88,14 +88,15 @@ test.describe('Speaker portal', () => {
await expect(page.getByText('Future talk', { exact: true })).toBeVisible();
await expect(page.getByTestId('checkin-required-gate')).toHaveCount(0);
await article.getByLabel(`Upload material for ${title}`).setInputFiles({ name: 'slides.txt', mimeType: 'text/plain', buffer: Buffer.from('First slides') });
await expect(article.getByRole('link', { name: 'Download material' })).toBeVisible();
await expect(article.getByRole('button', { name: 'Download material' })).toBeVisible();
const firstPath = materialPath;
await article.getByLabel(`Replace material for ${title}`).setInputFiles({ name: 'slides.txt', mimeType: 'text/plain', buffer: Buffer.from('Replacement slides') });
await expect.poll(() => uploaded.length).toBe(2);
await expect(article.getByRole('button', { name: 'Remove material' })).toBeEnabled();
expect(materialPath).not.toBe(firstPath);
expect(removed).toEqual([firstPath]);
await expect(article.getByRole('link', { name: 'Download material' })).toHaveAttribute('href', new RegExp(`${materialPath}$`));
// Authenticated blob download (private bucket) — a button, no href anymore.
await expect(article.getByRole('button', { name: 'Download material' })).toBeEnabled();
await page.screenshot({ path: `/tmp/convivo-speaker-${width}-${title.split(' ')[0]}.png`, fullPage: true });
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);
page.once('dialog', (dialog) => dialog.accept());