Accounts 1.8.0, Website 1.1.0: admins redesigned as Cross Events' dashboard and settings
- Website: an icon sidebar in groups (Your site, Content, Go live, Team), a dashboard with cards and a tile per part of the admin, steps to the first publish across the top of every admin page, and a live preview beside the page editor and Template and style (computer or phone width, folds away, reloads on save). A framed request (Sec-Fetch-Dest: iframe) with an admin session reads the drafts, so no preview cookie is set. /preview/start takes ?to=. The page editor has Content and Page details tabs. - Accounts: /admin is an overview (cards, "Needs you", a tile per section); People moved to /admin/people; the sidebar shows the part you're in, grouped, with a count on Deletion requests; People redesigned, with a confirm before Deactivate; Email and WhatsApp split into two cards. - Both: darker grey labels for contrast; lucide-react in the Website. - e2e: the live preview shows drafts while the site stays live; axe on the page editor. - docs: VERSIONS, changelogs, WHATS-NEW. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,10 +21,12 @@ async function signIn(context: BrowserContext, role = "editor") {
|
||||
|
||||
async function aboutTitle(page: Page, title: string) {
|
||||
await page.goto("/admin/pages");
|
||||
await page.getByRole("link", { name: "About us", exact: true }).first().click();
|
||||
await page.getByRole("link", { name: /^About us\b/ }).first().click();
|
||||
// The list page has a Title field too (Add a page): wait for the page's own editor.
|
||||
await expect(page).toHaveURL(/\/admin\/pages\/[0-9a-f-]+$/);
|
||||
await expect(page.getByRole("heading", { level: 1, name: "About us" })).toBeVisible();
|
||||
// The editor opens on the page's content; the title is under Page details.
|
||||
await page.getByRole("tab", { name: "Page details" }).click();
|
||||
await page.getByLabel("Title", { exact: true }).fill(title);
|
||||
await page.getByRole("button", { name: "Save details" }).click();
|
||||
await expect(page.getByText("Saved as a draft.")).toBeVisible();
|
||||
@@ -58,6 +60,23 @@ test("edit, preview the whole site, publish: then visitors see it", async ({ pag
|
||||
await visitor.close();
|
||||
});
|
||||
|
||||
test("the live preview beside the editor shows the draft; the site itself doesn't", async ({ page, context }) => {
|
||||
await signIn(context);
|
||||
await aboutTitle(page, "Draft title");
|
||||
const frame = page.frameLocator('iframe[title="Live preview of this page"]');
|
||||
await expect(frame.getByRole("heading", { level: 1, name: "Draft title" })).toBeVisible();
|
||||
// No preview cookie: the same browser, outside the frame, still sees the live site.
|
||||
await page.goto("/about");
|
||||
await expect(page.getByRole("heading", { level: 1, name: "About us" })).toBeVisible();
|
||||
await expect(page.getByRole("region", { name: "Preview" })).toHaveCount(0);
|
||||
// Folded away, it stays folded.
|
||||
await page.goBack();
|
||||
await page.getByRole("button", { name: "Hide the preview" }).click();
|
||||
await expect(page.getByRole("button", { name: "Show the live preview" })).toBeVisible();
|
||||
await page.reload();
|
||||
await expect(page.getByRole("button", { name: "Show the live preview" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("discard one change", async ({ page, context }) => {
|
||||
await signIn(context);
|
||||
await aboutTitle(page, "Changed my mind");
|
||||
@@ -159,4 +178,10 @@ test("the admin's screens are accessible", async ({ page, context }) => {
|
||||
const axe = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"]).analyze();
|
||||
expect(axe.violations.map((v) => `${path}: ${v.id} (${v.nodes.length}) ${v.nodes[0]?.target}`)).toEqual([]);
|
||||
}
|
||||
// And a page's editor, with its live preview beside it.
|
||||
await page.goto("/admin/pages");
|
||||
await page.getByRole("link", { name: /^Home\b/ }).first().click();
|
||||
await expect(page.frameLocator('iframe[title="Live preview of this page"]').getByRole("heading", { level: 1 })).toBeVisible();
|
||||
const axe = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"]).analyze();
|
||||
expect(axe.violations.map((v) => `editor: ${v.id} (${v.nodes.length}) ${v.nodes[0]?.target}`)).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user