From fa5d28f7566aaa4c607692bdddad82bceb443b57 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Thu, 18 Jul 2024 22:54:11 +0100 Subject: [PATCH 01/10] Added Ariz button --- widget/page/project/Metadata.jsx | 49 +++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/widget/page/project/Metadata.jsx b/widget/page/project/Metadata.jsx index 9ae3c6d8..54b8d234 100644 --- a/widget/page/project/Metadata.jsx +++ b/widget/page/project/Metadata.jsx @@ -94,6 +94,28 @@ const EditButton = ({ item }) => { ); }; +const HyperLink = styled.a` + all: unset; + display: inline-flex; + padding: 8px 15px; + justify-content: center; + align-items: center; + gap: 4px; + border-radius: 8px; + font-size: 14px; + font-weight: 600; + line-height: normal; + font-family: "Poppins", sans-serif; + + transition: all 300ms; + border: 1px solid #e2c58d; + cursor: pointer; + :hover { + background: #e2c58d; + color: #3d5443; + } +`; + const Metadata = ({ profile, accountId, @@ -101,6 +123,7 @@ const Metadata = ({ projectAccountId, projectId, }) => { + const isOwner = accountId === projectAccountId; return (
@@ -140,13 +163,25 @@ const Metadata = ({
Links - +
+ + {/* {isOwner && ( */} + + {/* */} + Ariz Portfolio + + {/* )} */} +
Date: Thu, 18 Jul 2024 23:11:32 +0100 Subject: [PATCH 02/10] Added owner check --- widget/page/project/Metadata.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widget/page/project/Metadata.jsx b/widget/page/project/Metadata.jsx index 54b8d234..4fa4e9a4 100644 --- a/widget/page/project/Metadata.jsx +++ b/widget/page/project/Metadata.jsx @@ -171,16 +171,16 @@ const Metadata = ({ profile, }} /> - {/* {isOwner && ( */} + {isOwner && ( {/* */} - Ariz Portfolio + Open Ariz Portfolio - {/* )} */} + )}
From 67d5d0da03a844b308dae8aecd2949e6aa691347 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Thu, 18 Jul 2024 23:13:57 +0100 Subject: [PATCH 03/10] cleanup --- widget/page/project/Metadata.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/widget/page/project/Metadata.jsx b/widget/page/project/Metadata.jsx index 4fa4e9a4..406bd9ea 100644 --- a/widget/page/project/Metadata.jsx +++ b/widget/page/project/Metadata.jsx @@ -172,14 +172,14 @@ const Metadata = ({ }} /> {isOwner && ( - - {/* */} - Open Ariz Portfolio - + + {/* */} + Open Ariz Portfolio + )} From 327183333b3722245cc5e3b55cb38d868d176077 Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Fri, 19 Jul 2024 08:29:31 +0100 Subject: [PATCH 04/10] Repositioned button and added logo --- widget/page/project/Layout.jsx | 28 ++++++++++++++++++ widget/page/project/Metadata.jsx | 49 +++++--------------------------- 2 files changed, 35 insertions(+), 42 deletions(-) diff --git a/widget/page/project/Layout.jsx b/widget/page/project/Layout.jsx index 80adf83f..c31b3dc7 100644 --- a/widget/page/project/Layout.jsx +++ b/widget/page/project/Layout.jsx @@ -7,6 +7,12 @@ const { Metadata } = VM.require( const { href } = VM.require("${alias_devs}/widget/lib.url") || { href: () => {}, }; + +const { Button } = VM.require("${config_account}/widget/components.Index") || { + Button: () => <>, +}; + + const Layout = ({ projectAccountId, projectId, @@ -21,6 +27,7 @@ const Layout = ({ if (!projectAccountId) { return

No Account ID

; } + const isOwner = accountId === projectAccountId; return ( <>
@@ -37,6 +44,27 @@ const Layout = ({ Back to Projects + {!isOwner && ( + + )}
{ ); }; -const HyperLink = styled.a` - all: unset; - display: inline-flex; - padding: 8px 15px; - justify-content: center; - align-items: center; - gap: 4px; - border-radius: 8px; - font-size: 14px; - font-weight: 600; - line-height: normal; - font-family: "Poppins", sans-serif; - - transition: all 300ms; - border: 1px solid #e2c58d; - cursor: pointer; - :hover { - background: #e2c58d; - color: #3d5443; - } -`; - const Metadata = ({ profile, accountId, @@ -123,7 +101,6 @@ const Metadata = ({ projectAccountId, projectId, }) => { - const isOwner = accountId === projectAccountId; return (
@@ -163,25 +140,13 @@ const Metadata = ({
Links -
- - {isOwner && ( - - {/* */} - Open Ariz Portfolio - - )} -
+
Date: Fri, 19 Jul 2024 10:31:35 +0100 Subject: [PATCH 05/10] Added tests --- playwright-tests/tests/project.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/playwright-tests/tests/project.spec.js b/playwright-tests/tests/project.spec.js index 952972f1..af58ca61 100644 --- a/playwright-tests/tests/project.spec.js +++ b/playwright-tests/tests/project.spec.js @@ -15,6 +15,15 @@ test.describe("?page=project&id=", () => { await backToProjects.click(); expect(page.url()).toContain("?page=projects"); }); + test("should show Ariz portfolio button when owner of project", async ({ page }) => { + const arizButton = await page.getByTestId("ariz-portfolio"); + expect(arizButton).toBeInTheDocument(); + }); + test("should navigate to Ariz portfolio when clicked", async ({ page }) => { + const arizButton = await page.getByTestId("ariz-portfolio"); + await arizButton.click(); + await expect(page).toHaveURL(/https:\/\/arizportfolio\.near\.page\//); + }); test.describe("Overview Page", () => { test("should display 'Project Details", async ({ page }) => { From ddeb7249424871345a3d062362e6e69bc38145fb Mon Sep 17 00:00:00 2001 From: Jiku Godwill Date: Fri, 19 Jul 2024 10:32:04 +0100 Subject: [PATCH 06/10] cleanup --- playwright-tests/tests/project.spec.js | 4 +++- widget/page/project/Layout.jsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/playwright-tests/tests/project.spec.js b/playwright-tests/tests/project.spec.js index af58ca61..4479b9af 100644 --- a/playwright-tests/tests/project.spec.js +++ b/playwright-tests/tests/project.spec.js @@ -15,7 +15,9 @@ test.describe("?page=project&id=", () => { await backToProjects.click(); expect(page.url()).toContain("?page=projects"); }); - test("should show Ariz portfolio button when owner of project", async ({ page }) => { + test("should show Ariz portfolio button when owner of project", async ({ + page, + }) => { const arizButton = await page.getByTestId("ariz-portfolio"); expect(arizButton).toBeInTheDocument(); }); diff --git a/widget/page/project/Layout.jsx b/widget/page/project/Layout.jsx index c31b3dc7..f97af832 100644 --- a/widget/page/project/Layout.jsx +++ b/widget/page/project/Layout.jsx @@ -44,7 +44,7 @@ const Layout = ({ Back to Projects - {!isOwner && ( + {isOwner && (