[UI] Snippet editor (#12299)

* Implement admin editor for report snippets

* Report asset management

* Add playwright test for report snippets

* Add playwright test for "Report Assets" panel

* Updated docs
This commit is contained in:
Oliver
2026-07-03 19:04:50 +10:00
committed by GitHub
parent 15c64d6695
commit 4cb29f37c6
9 changed files with 634 additions and 141 deletions
+31
View File
@@ -254,6 +254,37 @@ test('Settings - Admin', async ({ browser }) => {
await loadTab(page, 'Category Parameters');
await loadTab(page, 'Label Templates');
await loadTab(page, 'Report Templates');
// Check the "report snippets" panel
await loadTab(page, 'Report Snippets');
await page
.getByText(
'Snippets are reusable pieces of HTML content that can be inserted into reports and labels.'
)
.waitFor();
// Launch the dialog to upload a new snippet
await page.getByLabel('action-button-add-snippet').click();
await page.getByText('Add Snippet', { exact: true }).waitFor();
await page.locator('input[type="file"]').waitFor({ state: 'attached' });
await page.getByLabel('text-field-description').waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
// Check the "report assets" panel
await loadTab(page, 'Report Assets');
await page
.getByText(
'Assets are files (such as images) which can be used when rendering reports and labels.'
)
.waitFor();
// Launch the dialog to upload a new asset
await page.getByLabel('action-button-add-asset').click();
await page.getByText('Add Asset', { exact: true }).waitFor();
await page.locator('input[type="file"]').waitFor({ state: 'attached' });
await page.getByLabel('text-field-description').waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
await loadTab(page, 'Plugins');
// Adjust some "location type" items