From 26447b3c59ff78902c1da40898bc3ff71c7dea24 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 25 Aug 2023 16:07:38 +0200 Subject: [PATCH] Switch edit title button with icons Signed-off-by: Sebastian Martinez --- src/components/Icon.svelte | 58 +++++++++++++++++++------ src/views/projects/Cob/CobHeader.svelte | 27 ++++++------ tests/e2e/project/issues.spec.ts | 4 +- 3 files changed, 60 insertions(+), 29 deletions(-) diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte index 1930957fc..21ebf89a6 100644 --- a/src/components/Icon.svelte +++ b/src/components/Icon.svelte @@ -14,12 +14,12 @@ | "chevron-up" | "clipboard" | "clipboard-small" - | "face" | "cross" | "diff" | "ellipsis" | "exclamation" | "exclamation-circle" + | "face" | "file" | "folder" | "folder-open" @@ -30,6 +30,7 @@ | "moon" | "network" | "patch" + | "pen" | "sun"; @@ -169,18 +170,6 @@ 15.5 8.5 14.8284 8.5 14V9.5ZM10 5.5C9.72386 5.5 9.5 5.72386 9.5 6V14C9.5 14.2761 9.72386 14.5 10 14.5H18C18.2761 14.5 18.5 14.2761 18.5 14V6C18.5 5.72386 18.2761 5.5 18 5.5H10Z" /> - {:else if name === "face"} - .only - - - - {:else if name === "clipboard-small"} + {:else if name === "face"} + .only + + + + {:else if name === "file"} + {:else if name === "pen"} + {:else if name === "sun"}
@@ -72,19 +76,14 @@ No title {/if} {#if action === "edit"} - +
+ { + editable = !editable; + dispatch("editTitle", title); + }} /> +
{/if}
diff --git a/tests/e2e/project/issues.spec.ts b/tests/e2e/project/issues.spec.ts index ceeac5fcc..c0d6677ba 100644 --- a/tests/e2e/project/issues.spec.ts +++ b/tests/e2e/project/issues.spec.ts @@ -181,9 +181,9 @@ test("go through the entire ui issue flow", async ({ page.getByLabel("chip").filter({ hasText: "bug" }), ).toBeVisible(); - await page.getByRole("button", { name: "edit" }).first().click(); + await page.getByLabel("editTitle").click(); await page.getByPlaceholder("Title").fill("This is a new title"); - await page.getByRole("button", { name: "save" }).click(); + await page.getByLabel("editTitle").click(); await expect(page.getByText("This is a new title")).toBeVisible(); await page.getByPlaceholder("Leave your comment").fill("This is a comment");