From ab5de4bda30f4050e4cf5d91821b42658ba6fff8 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:47:01 -0400 Subject: [PATCH 01/23] Fixes git history (#429) (#430) * Landing page (#290) * Add new landing page * Use new landing page --------- * Ft: New `buildhub` app (#303) * renamed new folder to `buildhub` * added github job * added mainnet job * prettier update * set new and old --------- * Fix: builddao.testnet public key * small change to trigger build * small change to trigger build * fix: gateway reference in testnet * Fix notification issues (#304) * Fix notifications count not resetting * Supress console.logs * Fix black background on notifications page * Revert changes to post and comment * Remove console logs and navbar from viewer for now * Remove white bg * Added commit modal bypass for all (#313) * Added commit modal bypass for all * Removed injectedConfig * clean features * changelog --------- * App.js formatting fix * Fix: Propose UI stuck partway through process (#302) * Bug Fix 244 * "cleanup" * New modal design implementation * new-changes * refactored code * resolved comments * latest-changes * Initialize with essential routes (#312) * Initialize with essential routes * Move home to /page * Add navbar * Add footer to all pages * Fix fmt? * fix links --------- * Test button Fix (#315) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * rename vertical * fix codeowners * Projects feed new (#319) * Sidebar * Initialize Projects page * Add CSS file * Align projects page with new design * Rename to kebab case * Align card design with new figma * Add List view * 100vh height * New projects feed updates & organization (#320) * reorganizing * formatting * adds label * Shift to pascal case * Add state for projects view * Rename folder structure * Fix links * Resolve comments --------- * fix-network-links (#323) * Resource page new (#325) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Remaining Projects Routes (#328) * Project Routes * Refactor StarProjects * Use star app logic for handling starring projects * Resolve comments * Project-new (#329) * Remove "Error" from project-data helper * Added route to index page for Project * Created layout * Added this to store entire project details with it's layout * Added changes to index file * Added overview * Added Metadata * Added activity and updated links * Updated link to project details * Used recent falbackUrl * Added new fallbackUrl * Updated links back to "projects" * Added the rest of the pages and retructured project component * Rearranged folder structure * renamed routes to meet * Prettier * Fixed link to Metadata * Navigation new (#331) * Move navbar to new app and fix default route for sidebar * Navbar changes to adapt to new style * Revert some changes for now * Add activity page * Notifications Page (#336) * Notifications Page * Notifications Items fix * Comments Resolved * Tests for Login and Logout (#333) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Resource page new (#335) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Adding new resources * Move activity to new app pattern (#337) * Move create project to separate page, edit support and refactoring (#321) * moved create project to page, added roles and edit support * show success modal after project is created * fmt * rebased and added reusable view container * bug fixes * add logs * css update * update login container css * Fixed task editor and minor UI updates (#339) * fixed task editor * remove logs * fmt * Fix projects visibility on testnet (#342) * Fix projects visibility * fmt * Convert starredProjects to star (#346) * convert starredProjects to star * notify account * fmt --------- * sets new index (#344) * yarn.lock * update bos-workspace * downgrade to .20 * latest * bos-workspace no bos-cli * Add feed to project page (#356) * Add feed to project page * Change editor * resolve comments * Resolve comment * use config_index --------- * Fix search in projects (#359) * Project creation form fixes (#360) * Add indicators for required fields * Add prefix to inputfield * Align typeahead with our input field style * Resolve commits * Fix projects bugs (#364) * fix tags structure * added border and error state * add border to list card * add autocomplete to projects * fmt --------- * Add form bounty template * Image uploader module (#361) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * run prettier format on commit (#369) * Responsiveness and Adding Missing Pages (#365) * Landing Page Update 3.0 * Responsiveness * Add Inspect and Profile Page to new app * Comments Resolved * update yarn * Fix red flashes, init to [] rather than {} and hide open roles (#370) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * Fix red flash (#371) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * default empty array * Move proposals related files and fix notification roles selector (#377) * move proposals related files * minor fixes * fix pre-commit command * Fixes authentication tests (#381) * remove Dummy * cleans up auth tests * fmt * Refactors Project Card (#382) * remove Dummy * cleans up auth tests * fmt * tests to validate navigation * combines and replaces two cards * fmt * Landing Page Refactor (#383) * Landing Page Update 4.0 * URL Update * fix links * fmt --------- * Upgrade the gateway to new app and some fixes (#386) * Upgrade the gateway to new app and some fixes * Fix project card * fmt * Update release-new-mainnet.yml * Login/Logout Page Update / Profile.Index Update (#389) * Landing Page Update 4.0 * URL Update * Login Logout Page Design Update * fix conflict * fix links for signin, signout --------- * fix landing page links (#394) * Defaults fallback for Object.keys (fix red flash on projects page) (#396) * increment * adds fallbacks * fmt * Ft: Project quick view (#388) * added canvas * add UI * css update * fix tests and add mobile responsiveness * fix potlock search (#397) * added changelog * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * Add resources tests (#425) * Add resources tests * Resolve comments * Delete project (#417) * added delete project * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * added delete project * added delete project test * add edit project test * fix tests * added delete project test * add edit project test * fix tests --------- * Landing page regression tests (#416) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title --------- * fix transfer proposal (#427) * Navbar reg tests (#424) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title * navbar-reg-tests * added page visiblity assertions * fixed source btn locator --------- * Fix overflow activity feed (#420) * Fix overflow activity feed * Sidebar style update * Move fix to CSS * increment version --------- Co-authored-by: Muhammad Saad Iqbal Co-authored-by: Zeeshan Ahmad Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Co-authored-by: Jiku Godwill Nsanwi <65053264+Jikugodwill@users.noreply.github.com> Co-authored-by: Marpureddy Saswat <91129111+Eren-Yeaager@users.noreply.github.com> Co-authored-by: heroes-bounty[bot] <167169790+heroes-bounty[bot]@users.noreply.github.com> From 608106f0227b8c397b091c06b8584dce318a1c8e Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:45:39 -0400 Subject: [PATCH 02/23] Fixes git history (#429) * Landing page (#290) * Add new landing page * Use new landing page --------- Co-authored-by: Zeeshan Ahmad * Ft: New `buildhub` app (#303) * renamed new folder to `buildhub` * added github job * added mainnet job * prettier update * set new and old --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Fix: builddao.testnet public key * small change to trigger build * small change to trigger build * fix: gateway reference in testnet * Fix notification issues (#304) * Fix notifications count not resetting * Supress console.logs * Fix black background on notifications page * Revert changes to post and comment * Remove console logs and navbar from viewer for now * Remove white bg * Added commit modal bypass for all (#313) * Added commit modal bypass for all * Removed injectedConfig * clean features * changelog --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * App.js formatting fix * Fix: Propose UI stuck partway through process (#302) * Bug Fix 244 * "cleanup" * New modal design implementation * new-changes * refactored code * resolved comments * latest-changes * Initialize with essential routes (#312) * Initialize with essential routes * Move home to /page * Add navbar * Add footer to all pages * Fix fmt? * fix links --------- Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Test button Fix (#315) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * rename vertical * fix codeowners * Projects feed new (#319) * Sidebar * Initialize Projects page * Add CSS file * Align projects page with new design * Rename to kebab case * Align card design with new figma * Add List view * 100vh height * New projects feed updates & organization (#320) * reorganizing * formatting * adds label * Shift to pascal case * Add state for projects view * Rename folder structure * Fix links * Resolve comments --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * fix-network-links (#323) * Resource page new (#325) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Remaining Projects Routes (#328) * Project Routes * Refactor StarProjects * Use star app logic for handling starring projects * Resolve comments * Project-new (#329) * Remove "Error" from project-data helper * Added route to index page for Project * Created layout * Added this to store entire project details with it's layout * Added changes to index file * Added overview * Added Metadata * Added activity and updated links * Updated link to project details * Used recent falbackUrl * Added new fallbackUrl * Updated links back to "projects" * Added the rest of the pages and retructured project component * Rearranged folder structure * renamed routes to meet * Prettier * Fixed link to Metadata * Navigation new (#331) * Move navbar to new app and fix default route for sidebar * Navbar changes to adapt to new style * Revert some changes for now * Add activity page * Notifications Page (#336) * Notifications Page * Notifications Items fix * Comments Resolved * Tests for Login and Logout (#333) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Resource page new (#335) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Adding new resources * Move activity to new app pattern (#337) * Move create project to separate page, edit support and refactoring (#321) * moved create project to page, added roles and edit support * show success modal after project is created * fmt * rebased and added reusable view container * bug fixes * add logs * css update * update login container css * Fixed task editor and minor UI updates (#339) * fixed task editor * remove logs * fmt * Fix projects visibility on testnet (#342) * Fix projects visibility * fmt * Convert starredProjects to star (#346) * convert starredProjects to star * notify account * fmt --------- Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> * sets new index (#344) * yarn.lock * update bos-workspace * downgrade to .20 * latest * bos-workspace no bos-cli * Add feed to project page (#356) * Add feed to project page * Change editor * resolve comments * Resolve comment * use config_index --------- Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> * Fix search in projects (#359) * Project creation form fixes (#360) * Add indicators for required fields * Add prefix to inputfield * Align typeahead with our input field style * Resolve commits * Fix projects bugs (#364) * fix tags structure * added border and error state * add border to list card * add autocomplete to projects * fmt --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Add form bounty template * Image uploader module (#361) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * run prettier format on commit (#369) * Responsiveness and Adding Missing Pages (#365) * Landing Page Update 3.0 * Responsiveness * Add Inspect and Profile Page to new app * Comments Resolved * update yarn * Fix red flashes, init to [] rather than {} and hide open roles (#370) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * Fix red flash (#371) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * default empty array * Move proposals related files and fix notification roles selector (#377) * move proposals related files * minor fixes * fix pre-commit command * Fixes authentication tests (#381) * remove Dummy * cleans up auth tests * fmt * Refactors Project Card (#382) * remove Dummy * cleans up auth tests * fmt * tests to validate navigation * combines and replaces two cards * fmt * Landing Page Refactor (#383) * Landing Page Update 4.0 * URL Update * fix links * fmt --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Upgrade the gateway to new app and some fixes (#386) * Upgrade the gateway to new app and some fixes * Fix project card * fmt * Update release-new-mainnet.yml * Login/Logout Page Update / Profile.Index Update (#389) * Landing Page Update 4.0 * URL Update * Login Logout Page Design Update * fix conflict * fix links for signin, signout --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * fix landing page links (#394) * Defaults fallback for Object.keys (fix red flash on projects page) (#396) * increment * adds fallbacks * fmt * Ft: Project quick view (#388) * added canvas * add UI * css update * fix tests and add mobile responsiveness * fix potlock search (#397) * added changelog * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * Add resources tests (#425) * Add resources tests * Resolve comments * Delete project (#417) * added delete project * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * added delete project * added delete project test * add edit project test * fix tests * added delete project test * add edit project test * fix tests --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Landing page regression tests (#416) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * fix transfer proposal (#427) * Navbar reg tests (#424) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title * navbar-reg-tests * added page visiblity assertions * fixed source btn locator --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> * Fix overflow activity feed (#420) * Fix overflow activity feed * Sidebar style update * Move fix to CSS * increment version --------- Co-authored-by: Muhammad Saad Iqbal Co-authored-by: Zeeshan Ahmad Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Co-authored-by: Jiku Godwill Nsanwi <65053264+Jikugodwill@users.noreply.github.com> Co-authored-by: Marpureddy Saswat <91129111+Eren-Yeaager@users.noreply.github.com> Co-authored-by: heroes-bounty[bot] <167169790+heroes-bounty[bot]@users.noreply.github.com> From d79b91c65d32e45dab59f48c7753c03e85c6d16b Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:47:01 -0400 Subject: [PATCH 03/23] Fixes git history (#429) (#430) * Landing page (#290) * Add new landing page * Use new landing page --------- * Ft: New `buildhub` app (#303) * renamed new folder to `buildhub` * added github job * added mainnet job * prettier update * set new and old --------- * Fix: builddao.testnet public key * small change to trigger build * small change to trigger build * fix: gateway reference in testnet * Fix notification issues (#304) * Fix notifications count not resetting * Supress console.logs * Fix black background on notifications page * Revert changes to post and comment * Remove console logs and navbar from viewer for now * Remove white bg * Added commit modal bypass for all (#313) * Added commit modal bypass for all * Removed injectedConfig * clean features * changelog --------- * App.js formatting fix * Fix: Propose UI stuck partway through process (#302) * Bug Fix 244 * "cleanup" * New modal design implementation * new-changes * refactored code * resolved comments * latest-changes * Initialize with essential routes (#312) * Initialize with essential routes * Move home to /page * Add navbar * Add footer to all pages * Fix fmt? * fix links --------- * Test button Fix (#315) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * rename vertical * fix codeowners * Projects feed new (#319) * Sidebar * Initialize Projects page * Add CSS file * Align projects page with new design * Rename to kebab case * Align card design with new figma * Add List view * 100vh height * New projects feed updates & organization (#320) * reorganizing * formatting * adds label * Shift to pascal case * Add state for projects view * Rename folder structure * Fix links * Resolve comments --------- * fix-network-links (#323) * Resource page new (#325) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Remaining Projects Routes (#328) * Project Routes * Refactor StarProjects * Use star app logic for handling starring projects * Resolve comments * Project-new (#329) * Remove "Error" from project-data helper * Added route to index page for Project * Created layout * Added this to store entire project details with it's layout * Added changes to index file * Added overview * Added Metadata * Added activity and updated links * Updated link to project details * Used recent falbackUrl * Added new fallbackUrl * Updated links back to "projects" * Added the rest of the pages and retructured project component * Rearranged folder structure * renamed routes to meet * Prettier * Fixed link to Metadata * Navigation new (#331) * Move navbar to new app and fix default route for sidebar * Navbar changes to adapt to new style * Revert some changes for now * Add activity page * Notifications Page (#336) * Notifications Page * Notifications Items fix * Comments Resolved * Tests for Login and Logout (#333) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Resource page new (#335) * Resources Page V0 * Resources Page V0 cleanup * Header Removed * Adding new resources * Move activity to new app pattern (#337) * Move create project to separate page, edit support and refactoring (#321) * moved create project to page, added roles and edit support * show success modal after project is created * fmt * rebased and added reusable view container * bug fixes * add logs * css update * update login container css * Fixed task editor and minor UI updates (#339) * fixed task editor * remove logs * fmt * Fix projects visibility on testnet (#342) * Fix projects visibility * fmt * Convert starredProjects to star (#346) * convert starredProjects to star * notify account * fmt --------- * sets new index (#344) * yarn.lock * update bos-workspace * downgrade to .20 * latest * bos-workspace no bos-cli * Add feed to project page (#356) * Add feed to project page * Change editor * resolve comments * Resolve comment * use config_index --------- * Fix search in projects (#359) * Project creation form fixes (#360) * Add indicators for required fields * Add prefix to inputfield * Align typeahead with our input field style * Resolve commits * Fix projects bugs (#364) * fix tags structure * added border and error state * add border to list card * add autocomplete to projects * fmt --------- * Add form bounty template * Image uploader module (#361) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * run prettier format on commit (#369) * Responsiveness and Adding Missing Pages (#365) * Landing Page Update 3.0 * Responsiveness * Add Inspect and Profile Page to new app * Comments Resolved * update yarn * Fix red flashes, init to [] rather than {} and hide open roles (#370) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * Fix red flash (#371) * fix red flashes, init to [] rather than {} and hide open roles * fix formatting * default empty array * Move proposals related files and fix notification roles selector (#377) * move proposals related files * minor fixes * fix pre-commit command * Fixes authentication tests (#381) * remove Dummy * cleans up auth tests * fmt * Refactors Project Card (#382) * remove Dummy * cleans up auth tests * fmt * tests to validate navigation * combines and replaces two cards * fmt * Landing Page Refactor (#383) * Landing Page Update 4.0 * URL Update * fix links * fmt --------- * Upgrade the gateway to new app and some fixes (#386) * Upgrade the gateway to new app and some fixes * Fix project card * fmt * Update release-new-mainnet.yml * Login/Logout Page Update / Profile.Index Update (#389) * Landing Page Update 4.0 * URL Update * Login Logout Page Design Update * fix conflict * fix links for signin, signout --------- * fix landing page links (#394) * Defaults fallback for Object.keys (fix red flash on projects page) (#396) * increment * adds fallbacks * fmt * Ft: Project quick view (#388) * added canvas * add UI * css update * fix tests and add mobile responsiveness * fix potlock search (#397) * added changelog * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * Add resources tests (#425) * Add resources tests * Resolve comments * Delete project (#417) * added delete project * Fix project creation w/ tests (#402) * init tests * fmt * rename test * fmt * clean test * formatting * working as-is test * fmt * fix upload image * fmt * complete editor tests * projects tests * fmt * remove unused * added delete project * added delete project test * add edit project test * fix tests * added delete project test * add edit project test * fix tests --------- * Landing page regression tests (#416) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title --------- * fix transfer proposal (#427) * Navbar reg tests (#424) * test-btn-fix * toggle gateway urls * New changes in design implemented * Network button implementation * Login and Logout tests * Image Uploader module * Implemented Files component * lp-reg-tests * start project and explore projects changes in redirection * added the assertion for login and changed the structure * added wait * connect-btn-test-fix * added wait for create project title * navbar-reg-tests * added page visiblity assertions * fixed source btn locator --------- * Fix overflow activity feed (#420) * Fix overflow activity feed * Sidebar style update * Move fix to CSS * increment version --------- Co-authored-by: Muhammad Saad Iqbal Co-authored-by: Zeeshan Ahmad Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Co-authored-by: Jiku Godwill Nsanwi <65053264+Jikugodwill@users.noreply.github.com> Co-authored-by: Marpureddy Saswat <91129111+Eren-Yeaager@users.noreply.github.com> Co-authored-by: heroes-bounty[bot] <167169790+heroes-bounty[bot]@users.noreply.github.com> From 5bd3ade50dc7f7467453207de129fd41ca16f1d3 Mon Sep 17 00:00:00 2001 From: Zeeshan Ahmad Date: Fri, 21 Jun 2024 16:00:15 +0500 Subject: [PATCH 04/23] Fix profile editor not showing for new accounts (#436) --- apps/old/widget/components/profile/ProfileEdit.jsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/old/widget/components/profile/ProfileEdit.jsx b/apps/old/widget/components/profile/ProfileEdit.jsx index 25036ac0..898ff3ca 100644 --- a/apps/old/widget/components/profile/ProfileEdit.jsx +++ b/apps/old/widget/components/profile/ProfileEdit.jsx @@ -15,10 +15,6 @@ if (!accountId) { const profile = Social.getr(`${accountId}/profile`); -if (!profile) { - return ""; -} - const [name, setName] = useState(profile.name ?? ""); const [description, setDescription] = useState(profile.description ?? ""); const [location, setLocation] = useState(profile.location ?? ""); From c32304a03a9bbece019d9eda63d5042aff56c7d0 Mon Sep 17 00:00:00 2001 From: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Date: Sun, 23 Jun 2024 15:29:59 -0400 Subject: [PATCH 05/23] Adds back missing landing page tests (#440) * adds landing page tests * fmt --- playwright-tests/tests/landing-page.spec.js | 126 ++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 playwright-tests/tests/landing-page.spec.js diff --git a/playwright-tests/tests/landing-page.spec.js b/playwright-tests/tests/landing-page.spec.js new file mode 100644 index 00000000..ea295748 --- /dev/null +++ b/playwright-tests/tests/landing-page.spec.js @@ -0,0 +1,126 @@ +import { expect, test } from "@playwright/test"; +import { ROOT_SRC } from "../util/constants"; + +test.describe("Navbar tabs redirection", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}`); + }); + test("Home", async ({ page }) => { + const homeTab = page.locator("span", { hasText: "Home" }); + await homeTab.click(); + expect(page.url()).toContain("?page=home"); + }); + + test("Activity", async ({ page }) => { + const activityTab = page.locator("span", { hasText: "Activity" }); + await activityTab.click(); + expect(page.url()).toContain("?page=activity"); + }); + test("Projects", async ({ page }) => { + const projectsTab = page.getByRole("link", { + name: "Projects", + exact: true, + }); + await projectsTab.click(); + expect(page.url()).toContain("?page=projects"); + }); + test("Resources", async ({ page }) => { + const resourcesTab = page.locator("span", { hasText: "Resources" }); + await resourcesTab.click(); + expect(page.url()).toContain("?page=resources"); + }); +}); + +test.describe("User is logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}`); + }); + test("Start project redirection for logged in users", async ({ page }) => { + const startProjectButton = page.getByRole("button", { + name: "Start Project", + }); + await expect(startProjectButton).toBeVisible(); + await startProjectButton.click(); + expect(page.url()).toContain("?page=projects&tab=editor"); + }); + test("Explore Projects redirection for logged in user", async ({ page }) => { + const exploreProjectsButton = page.getByRole("button", { + name: "Explore Project", + }); + await expect(exploreProjectsButton).toBeVisible(); + await exploreProjectsButton.click(); + expect(page.url()).toContain("?page=projects"); + }); + + test("Quickstart Guide page redirection", async ({ page }) => { + const quickStartGuideButton = page.getByRole("button", { + name: "Quickstart Guide", + }); + await expect(quickStartGuideButton).toBeVisible(); + await quickStartGuideButton.click(); + expect(page.url()).toContain("/NEARBuilders/quickstart.near"); + }); + + test("Workspace docs page redirection", async ({ page }) => { + const workSpaceButton = page.getByRole("button", { + name: "Workspace Docs", + }); + await page.waitForTimeout(2000); + await expect(workSpaceButton).toBeVisible(); + await workSpaceButton.click(); + expect(page.url()).toContain("/?page=resources&tab=gettingStarted"); + }); + test("Activity page redirection", async ({ page }) => { + const activityPageButton = page.getByRole("button", { + name: "Activity", + }); + await expect(activityPageButton).toBeVisible(); + await activityPageButton.click(); + expect(page.url()).toContain("?page=activity"); + }); + + test("Twitter redirection", async ({ page }) => { + const twitterButton = page.locator("button[type=icon]").nth(3); + await page.waitForTimeout(2000); + await expect(twitterButton).toBeVisible(); + await twitterButton.click(); + expect(page.url()).toContain("twitter"); + }); + test("Telegram redirection", async ({ page }) => { + const telegramButton = page.locator("button[type=icon]").nth(4); + await page.waitForTimeout(2000); + await expect(telegramButton).toBeVisible(); + await telegramButton.click(); + expect(page.url()).toBe("https://www.nearbuilders.com/tg-builders"); + }); + test("Github redirection", async ({ page }) => { + const githubButton = page.locator("button[type=icon]").nth(5); + await page.waitForTimeout(2000); + await expect(githubButton).toBeVisible(); + await githubButton.click(); + expect(page.url()).toBe("https://github.com/NEARBuilders"); + }); +}); + +test.describe("User is not logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-not-connected.json", + }); + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}`); + }); + test("Start project redirection for logged out users", async ({ page }) => { + const startProjectButton = page.getByRole("button", { + name: "Start Project", + }); + await expect(startProjectButton).toBeVisible(); + await startProjectButton.click(); + expect(page.url()).toContain("?page=projects&tab=editor"); + await page.waitForTimeout(2000); + const connectButton = page.getByRole("button", { name: "Connect" }); + await expect(connectButton).toBeVisible(); + }); +}); From eed77f3e82f1f12ee6dcd897f3c21b108930d982 Mon Sep 17 00:00:00 2001 From: Muhammad Saad Iqbal Date: Mon, 24 Jun 2024 19:56:57 +0500 Subject: [PATCH 06/23] Playwright Tests - Profile Page (#439) * Add Profile Tests * fmt * Add profile tests * Comments Resolved * Update playwright-tests/tests/profile.spec.js Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> * Update playwright-tests/tests/profile.spec.js Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> * Update playwright-tests/tests/profile.spec.js Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> * Update playwright-tests/tests/profile.spec.js Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> * clean up * fix mock --------- Co-authored-by: Elliot Braem <16282460+elliotBraem@users.noreply.github.com> Co-authored-by: Megha <100185149+Megha-Dev-19@users.noreply.github.com> --- playwright-tests/tests/profile.spec.js | 150 +++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 playwright-tests/tests/profile.spec.js diff --git a/playwright-tests/tests/profile.spec.js b/playwright-tests/tests/profile.spec.js new file mode 100644 index 00000000..3cb2a716 --- /dev/null +++ b/playwright-tests/tests/profile.spec.js @@ -0,0 +1,150 @@ +import { expect, test } from "@playwright/test"; +import { ROOT_SRC } from "../util/constants"; +import path from "path"; + +test.describe("?page=profile", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=profile`); + }); + + test.describe("User logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); + + test("should show profile page if no accountId is passed", async ({ + page, + }) => { + const profileId = page.getByText("anybody.near").nth(2); + await expect(profileId).toBeVisible(); + }); + + test("should show profile page when accountId is passed", async ({ + page, + }) => { + await page.goto(`/${ROOT_SRC}?page=profile&accountId=efiz.testnet`); + const profileName = page.getByRole("heading", { + name: "Elliot", + }); + await expect(profileName).toBeVisible(); + }); + + test("should navigate to 'Edit Profile' and save correct data", async ({ + page, + }) => { + await page.route("**/add", async (route) => { + const modifiedResponse = { + status: 200, + contentType: "application/json", + body: JSON.stringify({ cid: "simple_cid" }), + }; + + // Fulfill the route with the modified response + await route.fulfill(modifiedResponse); + }); + + const editButton = page.getByRole("button", { name: "Edit Profile" }); + await editButton.click(); + + // expect input field with label Name to be visible + const nameInput = page.getByLabel("Name"); + await expect(nameInput).toBeVisible(); + + const avatarInput = await page.locator("input[type=file]"); + await avatarInput.setInputFiles( + path.join(__dirname, "./assets/black.png"), + ); + + await page.getByPlaceholder("Enter full name").fill("Someone"); + + const description = await page + .frameLocator("iframe") + .locator('textarea[name="textarea"]'); + await description.fill("Someone"); + + await page.getByPlaceholder("eg. United States").fill("Someone"); + + await page.getByPlaceholder("twitter handle").fill("Someone"); + await page.getByPlaceholder("github handle").fill("Someone"); + await page.getByPlaceholder("telegram handle").fill("Someone"); + await page.getByPlaceholder("website link").fill("Someone.com"); + + const expectedResult = { + "anybody.near": { + profile: { + name: "Someone", + description: "Someone", + image: { + ipfs_cid: "simple_cid", + }, + location: "Someone", + linktree: { + twitter: "Someone", + github: "Someone", + telegram: "Someone", + website: "Someone.com", + }, + }, + }, + }; + // click button that triggers transaction + await page.getByRole("button", { name: "Save Profile" }).nth(0).click(); + const transactionObj = JSON.parse( + await page.locator("div.modal-body code").innerText(), + ); + // do something with transactionObj + expect(transactionObj).toMatchObject(expectedResult); + }); + }); + + test.describe("User not logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-not-connected.json", + }); + + test("should show login prompt if no accountId is passed", async ({ + page, + }) => { + await page.goto(`/${ROOT_SRC}?page=profile`); + const loginPrompt = page.getByText( + "AccountID prop or signed in account is required", + ); + await expect(loginPrompt).toBeVisible(); + }); + + test("should navigate to 'Posts' and display them", async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=profile&accountId=efiz.testnet`); + const postButton = page.getByRole("tab", { name: "Posts" }); + await postButton.click(); + + await expect(postButton).toHaveClass("nav-link active"); + }); + test("should navigate to 'NFTs' and display them", async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=profile&accountId=efiz.testnet`); + const nftButton = page.getByRole("tab", { name: "NFTs" }); + await nftButton.click(); + + await expect(nftButton).toHaveClass("nav-link active"); + }); + test("should navigate to 'Widgets' and display them", async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=profile&accountId=efiz.testnet`); + const widgetButton = page.getByRole("tab", { name: "Widgets" }); + await widgetButton.click(); + + const widgetTitle = page.getByRole("link", { + name: "efiz.testnet/widget/SimpleMDE", + }); + await expect(widgetTitle).toBeVisible({ timeout: 10000 }); + }); + test("should not navigate to 'Edit Profile'", async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=profile&accountId=efiz.testnet`); + const profileImageSection = page.locator(".profile-image-section"); + await expect(profileImageSection).toBeVisible(); + // expect no Edit Profile button in the profile image section + const editProfileButton = page.getByRole("button", { + name: "Edit Profile", + }); + await expect(editProfileButton).toBeHidden(); + }); + }); +}); From 6868725e1b4a536724a8f59ec7a7d6f9817378fb Mon Sep 17 00:00:00 2001 From: Megha <100185149+Megha-Dev-19@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:33:12 +0530 Subject: [PATCH 07/23] Projects test coverage (#422) * add search, filter, watchlist, involved projects view * fix tests * fix tests * add back some tests --- aliases.mainnet.json | 3 +- aliases.testnet.json | 3 +- apps/new/widget/components/project/Card.jsx | 1 + .../page/projects/MainViewContainer.jsx | 5 +- .../widget/page/projects/PotlockImport.jsx | 4 +- .../page/projects/PotlockProjectCard.jsx | 17 +- apps/old/widget/components/Button.jsx | 2 + playwright-tests/tests/editor.spec.js | 409 +++++++++--------- playwright-tests/tests/projects.spec.js | 146 ++++++- 9 files changed, 371 insertions(+), 219 deletions(-) diff --git a/aliases.mainnet.json b/aliases.mainnet.json index 50c01a79..708cfe5e 100644 --- a/aliases.mainnet.json +++ b/aliases.mainnet.json @@ -5,5 +5,6 @@ "socialdb": "social.near", "gateway_url": "https://nearbuilders.org", "new": "builddao.near", - "old": "buildhub.near" + "old": "buildhub.near", + "potlock": "potlock.near" } diff --git a/aliases.testnet.json b/aliases.testnet.json index ef50d07f..d09075f1 100644 --- a/aliases.testnet.json +++ b/aliases.testnet.json @@ -5,5 +5,6 @@ "socialdb": "v1.social08.testnet", "gateway_url": "https://test.nearbuilders.org", "new": "builddao.testnet", - "old": "buildhub.testnet" + "old": "buildhub.testnet", + "potlock": "potlock.testnet" } diff --git a/apps/new/widget/components/project/Card.jsx b/apps/new/widget/components/project/Card.jsx index a8565647..9946140e 100644 --- a/apps/new/widget/components/project/Card.jsx +++ b/apps/new/widget/components/project/Card.jsx @@ -116,6 +116,7 @@ const EditButton = ({ item }) => { id: item.path, }, })} + onClick={(e) => e.stopPropagation()} type="icon" className={"rounded-3"} variant="primary" diff --git a/apps/new/widget/page/projects/MainViewContainer.jsx b/apps/new/widget/page/projects/MainViewContainer.jsx index 5f802ca2..16046119 100644 --- a/apps/new/widget/page/projects/MainViewContainer.jsx +++ b/apps/new/widget/page/projects/MainViewContainer.jsx @@ -93,7 +93,10 @@ const ProjectCardWrapper = ({ children, project }) => { return (
setShowQuickView(project)} + onClick={(e) => { + e.stopPropagation(); + setShowQuickView(project); + }} > {children}
diff --git a/apps/new/widget/page/projects/PotlockImport.jsx b/apps/new/widget/page/projects/PotlockImport.jsx index 5809eb59..fc9b5726 100644 --- a/apps/new/widget/page/projects/PotlockImport.jsx +++ b/apps/new/widget/page/projects/PotlockImport.jsx @@ -2,7 +2,7 @@ const { Button } = VM.require("${alias_old}/widget/components") || { Button: () => <>, }; const { getTagsFromSocialProfileData, getTeamMembersFromSocialProfileData } = - VM.require("potlock.near/widget/utils") || { + VM.require("${alias_potlock}/widget/utils") || { getTagsFromSocialProfileData: () => [], getTeamMembersFromSocialProfileData: () => [], }; @@ -10,7 +10,7 @@ const { getTagsFromSocialProfileData, getTeamMembersFromSocialProfileData } = const bootstrapTheme = props.bootstrapTheme || "dark"; let ListsSDK = - VM.require("potlock.near/widget/SDK.lists") || + VM.require("${alias_potlock}/widget/SDK.lists") || (() => ({ getRegistrations: () => {}, })); diff --git a/apps/new/widget/page/projects/PotlockProjectCard.jsx b/apps/new/widget/page/projects/PotlockProjectCard.jsx index 93cc098a..267556f2 100644 --- a/apps/new/widget/page/projects/PotlockProjectCard.jsx +++ b/apps/new/widget/page/projects/PotlockProjectCard.jsx @@ -1,6 +1,6 @@ const { potId, potDetail, payoutDetails, projects } = props; const { nearToUsd, ipfsUrlFromCid, yoctosToNear, yoctosToUsdWithFallback } = - VM.require("potlock.near/widget/utils") || { + VM.require("${alias_potlock}/widget/utils") || { ipfsUrlFromCid: () => "", yoctosToNear: () => "", yoctosToUsdWithFallback: () => "", @@ -8,30 +8,30 @@ const { nearToUsd, ipfsUrlFromCid, yoctosToNear, yoctosToUsdWithFallback } = }; const { _address } = VM.require( - `potlock.near/widget/Components.DonorsUtils`, + "${alias_potlock}/widget/Components.DonorsUtils", ) || { _address: (address) => address, }; const { ownerId, NADA_BOT_URL, SUPPORTED_FTS } = VM.require( - "potlock.near/widget/constants", + "${alias_potlock}/widget/constants", ) || { ownerId: "", NADA_BOT_URL: "", SUPPORTED_FTS: {}, }; const { getTagsFromSocialProfileData } = VM.require( - "potlock.near/widget/utils", + "${alias_potlock}/widget/utils", ) || { getTagsFromSocialProfileData: () => [], }; -const PotSDK = VM.require("potlock.near/widget/SDK.pot") || { +const PotSDK = VM.require("${alias_potlock}/widget/SDK.pot") || { getDonationsForProject: () => {}, }; let DonateSDK = - VM.require("potlock.near/widget/SDK.donate") || + VM.require("${alias_potlock}/widget/SDK.donate") || (() => ({ getDonationsForRecipient: () => {}, })); @@ -363,7 +363,10 @@ const profileImageStyle = { const tags = getTagsFromSocialProfileData(profile); return ( -
props.setShowCreateModalProjectId(projectId)}> +
props.setShowCreateModalProjectId(projectId)} + > diff --git a/apps/old/widget/components/Button.jsx b/apps/old/widget/components/Button.jsx index 10ddb78e..8e82be49 100644 --- a/apps/old/widget/components/Button.jsx +++ b/apps/old/widget/components/Button.jsx @@ -103,6 +103,7 @@ function Button({ className={linkClassName} style={{ textDecoration: "none" }} target={target} + onClick={(e) => e.stopPropagation()} > e.stopPropagation()} > { - test.beforeEach(async ({ page }) => { - await page.goto(`/${ROOT_SRC}?page=projects&tab=editor`); - }); - - test.describe("User is not logged in", () => { - test.use({ - storageState: "playwright-tests/storage-states/wallet-not-connected.json", + test.describe("Editor", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=projects&tab=editor`); }); - test("editor page should prompt user to log in", async ({ page }) => { - const requireLogin = await page.getByText( - "Please log in in order to see create or edit a project.", - ); + test.describe("User is not logged in", () => { + test.use({ + storageState: + "playwright-tests/storage-states/wallet-not-connected.json", + }); - await expect(requireLogin).toBeVisible(); - }); - }); + test("editor page should prompt user to log in", async ({ page }) => { + const requireLogin = await page.getByText( + "Please log in in order to see create or edit a project.", + ); - test.describe("User is logged in", () => { - test.use({ - storageState: "playwright-tests/storage-states/wallet-connected.json", + await expect(requireLogin).toBeVisible(); + }); }); - test.beforeEach(async ({ page }) => { - // Intercept IPFS requests - await page.route("**/add", async (route) => { - const modifiedResponse = { - status: 200, - contentType: "application/json", - body: JSON.stringify({ cid: "simple_cid" }), - }; + test.describe("User is logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); - // Fulfill the route with the modified response - await route.fulfill(modifiedResponse); + test.beforeEach(async ({ page }) => { + // Intercept IPFS requests + await page.route("**/add", async (route) => { + const modifiedResponse = { + status: 200, + contentType: "application/json", + body: JSON.stringify({ cid: "simple_cid" }), + }; + + // Fulfill the route with the modified response + await route.fulfill(modifiedResponse); + }); }); - }); - test("should not allow next when empty required fields", async ({ - page, - }) => { - const nextButton = await page.getByRole("button", { name: "Next" }); - await expect(nextButton).toBeDisabled(); + test("should not allow next when empty required fields", async ({ + page, + }) => { + const nextButton = await page.getByRole("button", { name: "Next" }); + await expect(nextButton).toBeDisabled(); - const projectAccountAddress = await page.getByPlaceholder( - "Enter Project Account Address", - ); + const projectAccountAddress = await page.getByPlaceholder( + "Enter Project Account Address", + ); - const title = await page.getByPlaceholder("Enter Project Title"); - const description = await page - .frameLocator("iframe") - .locator('textarea[name="textarea"]'); + const title = await page.getByPlaceholder("Enter Project Title"); + const description = await page + .frameLocator("iframe") + .locator('textarea[name="textarea"]'); - // Fill required fields - await projectAccountAddress.fill("anyproject.near"); - await title.fill("Sample project"); + // Fill required fields + await projectAccountAddress.fill("anyproject.near"); + await title.fill("Sample project"); - await description.click(); - await description.fill("This is a sample project"); + await description.click(); + await description.fill("This is a sample project"); - await expect(nextButton).toBeEnabled(); + await expect(nextButton).toBeEnabled(); - // Clear title - await title.clear(); - await expect(nextButton).toBeDisabled(); + // Clear title + await title.clear(); + await expect(nextButton).toBeDisabled(); - await title.fill("Sample project"); - await expect(nextButton).toBeEnabled(); + await title.fill("Sample project"); + await expect(nextButton).toBeEnabled(); - await description.click(); - await description.clear(); - await expect(nextButton).toBeDisabled(); - }); + await description.click(); + await description.clear(); + await expect(nextButton).toBeDisabled(); + }); - test("should not allow invalid project account address", async ({ - page, - }) => { - // Project Account Address - await page - .getByPlaceholder("Enter Project Account Address") - .fill("anyproject"); + test("should not allow invalid project account address", async ({ + page, + }) => { + // Project Account Address + await page + .getByPlaceholder("Enter Project Account Address") + .fill("anyproject"); + + const errorMsg = await page.getByText( + "Invalid Near Address, please enter a valid near address", + ); + await expect(errorMsg).toBeVisible(); + }); - const errorMsg = await page.getByText( - "Invalid Near Address, please enter a valid near address", - ); - await expect(errorMsg).toBeVisible(); - }); + test("cancel should navigate to main projects page", async ({ page }) => { + await page.getByRole("button", { name: "Cancel" }).click(); + expect(page.url()).toContain("?page=projects"); + }); - test("cancel should navigate to main projects page", async ({ page }) => { - await page.getByRole("button", { name: "Cancel" }).click(); - expect(page.url()).toContain("?page=projects"); - }); + test("should complete flow and save data correctly with images populated", async ({ + page, + }) => { + const expectedProjectData = { + // TODO: We will want to get rid of this + title: "Sample project", + description: "This is a sample project", + profileImage: { + ipfs_cid: "simple_cid", + }, + backgroundImage: { + ipfs_cid: "simple_cid", + }, + tags: { + test: "", + }, + linktree: { + twitter: "SampleTwitter", + github: "SampleGithub", + telegram: "SampleTelegram", + website: "https://www.samplewebsite.com", + }, + // End remove + contributors: ["anybody.near", "nobody.near"], + tabs: ["overview", "tasks", "activity"], + projectAccountId: "anyproject.near", + teamSize: "1-10", + location: "anywhere", + }; - test("should complete flow and save data correctly with images populated", async ({ - page, - }) => { - const expectedProjectData = { - // TODO: We will want to get rid of this - title: "Sample project", - description: "This is a sample project", - profileImage: { - ipfs_cid: "simple_cid", - }, - backgroundImage: { - ipfs_cid: "simple_cid", - }, - tags: { - test: "", - }, - linktree: { - twitter: "SampleTwitter", - github: "SampleGithub", - telegram: "SampleTelegram", - website: "https://www.samplewebsite.com", - }, - // End remove - contributors: ["anybody.near", "nobody.near"], - tabs: ["overview", "tasks", "activity"], - projectAccountId: "anyproject.near", - teamSize: "1-10", - location: "anywhere", - }; - - const expectedTransactionData = { - "anybody.near": { - project: { - "sample-project": { - "": JSON.stringify(expectedProjectData), - metadata: { - name: "Sample project", - description: "This is a sample project", - image: { - ipfs_cid: "simple_cid", - }, - backgroundImage: { - ipfs_cid: "simple_cid", - }, - tags: { - test: "", - }, - linktree: { - github: "https://github.com/SampleGithub", - telegram: "https://t.me/SampleTelegram", - twitter: "https://twitter.com/SampleTwitter", - website: "https://www.samplewebsite.com", + const expectedTransactionData = { + "anybody.near": { + project: { + "sample-project": { + "": JSON.stringify(expectedProjectData), + metadata: { + name: "Sample project", + description: "This is a sample project", + image: { + ipfs_cid: "simple_cid", + }, + backgroundImage: { + ipfs_cid: "simple_cid", + }, + tags: { + test: "", + }, + linktree: { + github: "https://github.com/SampleGithub", + telegram: "https://t.me/SampleTelegram", + twitter: "https://twitter.com/SampleTwitter", + website: "https://www.samplewebsite.com", + }, }, }, }, - }, - "builddao.testnet": { - project: { - "anybody.near_project_sample-project": "", + "builddao.testnet": { + project: { + "anybody.near_project_sample-project": "", + }, }, }, - }, - }; - - // Page one // - - // Project Account Address - await page - .getByPlaceholder("Enter Project Account Address") - .fill("anyproject.near"); - - // Title - await page.getByPlaceholder("Enter Project Title").fill("Sample project"); - - // Description - await page - .frameLocator("iframe") - .locator('textarea[name="textarea"]') - .click(); - await page - .frameLocator("iframe") - .locator('textarea[name="textarea"]') - .fill("This is a sample project"); - - await page.getByPlaceholder("Enter location").fill("anywhere"); // Location - - await page.getByRole("combobox").selectOption("1-10"); - - await page.getByLabel("Twitter").fill("SampleTwitter"); - await page.getByLabel("Github").fill("SampleGithub"); - await page.getByLabel("Telegram").fill("SampleTelegram"); - await page.getByLabel("Website").fill("https://www.samplewebsite.com"); - - // Next page - await page.getByRole("button", { name: "Next" }).click(); - - // Page two // - - // Contributors - await page.getByRole("combobox").nth(0).click(); - await page.getByRole("combobox").nth(0).fill("nobody.near"); - await page.getByLabel("nobody.near").click(); - - // Avatar - const avatarInput = await page.locator("input[type=file]").nth(0); - await avatarInput.setInputFiles( - path.join(__dirname, "./assets/black.png"), - ); - - // Background - const backgroundInput = await page.locator("input[type=file]").nth(1); - await backgroundInput.setInputFiles( - path.join(__dirname, "./assets/black.png"), - ); - - await page.getByLabel("Updates Feed").uncheck(); - await page.getByLabel("Feedback Feed").uncheck(); + }; - await page.getByRole("combobox").nth(1).click(); - await page.getByRole("combobox").nth(1).fill("test"); - await page.getByLabel("test").click(); + // Page one // + + // Project Account Address + await page + .getByPlaceholder("Enter Project Account Address") + .fill("anyproject.near"); + + // Title + await page + .getByPlaceholder("Enter Project Title") + .fill("Sample project"); + + // Description + await page + .frameLocator("iframe") + .locator('textarea[name="textarea"]') + .click(); + await page + .frameLocator("iframe") + .locator('textarea[name="textarea"]') + .fill("This is a sample project"); + + await page.getByPlaceholder("Enter location").fill("anywhere"); // Location + + await page.getByRole("combobox").selectOption("1-10"); + + await page.getByLabel("Twitter").fill("SampleTwitter"); + await page.getByLabel("Github").fill("SampleGithub"); + await page.getByLabel("Telegram").fill("SampleTelegram"); + await page.getByLabel("Website").fill("https://www.samplewebsite.com"); + + // Next page + await page.getByRole("button", { name: "Next" }).click(); + + // Page two // + + // Contributors + await page.getByRole("combobox").nth(0).click(); + await page.getByRole("combobox").nth(0).fill("nobody.near"); + await page.getByLabel("nobody.near").click(); + + // Avatar + const avatarInput = await page.locator("input[type=file]").nth(0); + await avatarInput.setInputFiles( + path.join(__dirname, "./assets/black.png"), + ); + + // Background + const backgroundInput = await page.locator("input[type=file]").nth(1); + await backgroundInput.setInputFiles( + path.join(__dirname, "./assets/black.png"), + ); + + await page.getByLabel("Updates Feed").uncheck(); + await page.getByLabel("Feedback Feed").uncheck(); + + await page.getByRole("combobox").nth(1).click(); + await page.getByRole("combobox").nth(1).fill("test"); + await page.getByLabel("test").click(); + + await page.getByRole("button", { name: "Create" }).click(); + await page.getByRole("dialog").getByLabel("Close").click(); + + // click button that triggers transaction + await page.getByRole("button", { name: "Create" }).nth(0).click(); + const transactionObj = JSON.parse( + await page.locator("div.modal-body code").innerText(), + ); + // do something with transactionObj + expect(transactionObj).toMatchObject(expectedTransactionData); + }); + }); + }); - await page.getByRole("button", { name: "Create" }).click(); - await page.getByRole("dialog").getByLabel("Close").click(); + test.describe("Import project from Potlock", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=projects&tab=potlockImport`); + }); + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); - // click button that triggers transaction - await page.getByRole("button", { name: "Create" }).nth(0).click(); - const transactionObj = JSON.parse( - await page.locator("div.modal-body code").innerText(), + test("should have warning text on testnet", async ({ page }) => { + const warningText = page.getByText( + "Network issue: Couldn't fetch any projects, please try again later", ); - // do something with transactionObj - expect(transactionObj).toMatchObject(expectedTransactionData); + expect(warningText).toBeHidden(); }); }); }); diff --git a/playwright-tests/tests/projects.spec.js b/playwright-tests/tests/projects.spec.js index f2d09978..24ccbfad 100644 --- a/playwright-tests/tests/projects.spec.js +++ b/playwright-tests/tests/projects.spec.js @@ -57,6 +57,49 @@ test.describe("?page=projects", () => { expect(page.url()).toContain("?page=project&id="); }); + test("should filter projects by team size and tags", async ({ page }) => { + // wait for data to load + const projectGridCard = await page + .getByTestId("project-grid-card") + .nth(1); + await expect(projectGridCard).toBeVisible({ timeout: 10000 }); + + const filterBtn = await page.getByRole("button", { + name: "Filter", + }); + await expect(filterBtn).toBeVisible(); + await filterBtn.click(); + await page.getByRole("combobox").nth(0).selectOption("1-10"); + await page.getByPlaceholder("Start Typing").fill("test"); + await page.getByLabel("test").click(); + await page.getByRole("button", { name: "Filter", exact: true }).click(); + const filteredProjectCounts = await page + .getByText("test", { exact: true }) + .count(); + expect(filteredProjectCounts).toBeGreaterThan(0); + }); + + test("should search projects by title", async ({ page }) => { + // wait for data to load + const projectGridCard = await page + .getByTestId("project-grid-card") + .nth(1); + await expect(projectGridCard).toBeVisible({ timeout: 10000 }); + + const searchInput = await page.getByPlaceholder( + "Search by project ID or name", + ); + await expect(searchInput).toBeVisible(); + const title = "Testing project on Build DAO"; + await searchInput.fill(title); + // only one projects should be found + const filteredProject = await page.getByTestId("project-grid-card"); + await expect(filteredProject).toBeVisible({ timeout: 10000 }); + await expect(page.getByRole("heading", { name: title })).toBeVisible({ + timeout: 10000, + }); + }); + test.describe("User is not logged in", () => { test.use({ storageState: @@ -148,27 +191,17 @@ test.describe("?page=projects", () => { expect(page.url()).toContain("?page=projects&tab=editor"); }); - test("should be able to edit a project'", async ({ page }) => { + test("should be able to edit a project", async ({ page }) => { // wait for data to be fetched await page.waitForTimeout(5000); const expectedTransactionData = { "meghagoel.testnet": { project: { "testing-project-on-builddao": { - "": '{"title":"New project title","description":"New Project description","profileImage":{"ipfs_cid":"bafkreifk42ibqsg5sfky5tlhkfty6rkup5leqite5koenhesnuwq55kufi"},"backgroundImage":{"ipfs_cid":"bafkreidbfu7uxtr4is7wxileg3mrbajve6cgkfmrqemc6pxsr6nnczz7ly"},"tags":{"test":""},"linktree":{"twitter":"https://test.nearbuilders.org/","github":"https://test.nearbuilders.org/","telegram":"https://test.nearbuilders.org/","website":"https://test.nearbuilders.org/"},"contributors":["megha19.testnet"],"tabs":["overview","activity","tasks"],"projectAccountId":"meghagoel.testnet","teamSize":"1-10","location":"New Location"}', + "": '{"title":"New project title","description":"New Project description","profileImage":{"ipfs_cid":"bafkreifk42ibqsg5sfky5tlhkfty6rkup5leqite5koenhesnuwq55kufi"},"backgroundImage":{"ipfs_cid":"bafkreidbfu7uxtr4is7wxileg3mrbajve6cgkfmrqemc6pxsr6nnczz7ly"},"tags":{"test":""},"linktree":{"twitter":"https://test.nearbuilders.org/","github":"https://test.nearbuilders.org/","telegram":"https://test.nearbuilders.org/","website":"https://test.nearbuilders.org/"},"contributors":["meghagoel.testnet"],"tabs":["overview","activity","tasks","updatesfeed","feedbackfeed"],"projectAccountId":"meghagoel.testnet","teamSize":"1-10","location":"New Location"}', metadata: { name: "New project title", description: "New Project description", - - tags: { - test: "", - }, - linktree: { - twitter: - "https://twitter.com/https://test.nearbuilders.org/", - github: "https://github.com/https://test.nearbuilders.org/", - telegram: "https://t.me/https://test.nearbuilders.org/", - }, }, }, }, @@ -181,7 +214,9 @@ test.describe("?page=projects", () => { const descriptionInput = await page .frameLocator("iframe") .locator('textarea[name="textarea"]'); - await expect(descriptionInput).toHaveText("This is the description"); + await expect(descriptionInput).toHaveText("This is the description", { + timeout: 20000, + }); await descriptionInput.click(); await descriptionInput.fill("New Project description"); const locationInput = page.getByPlaceholder("Enter location"); @@ -222,4 +257,89 @@ test.describe("?page=projects", () => { }); }); }); + + test.describe("Watchlist", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=projects&tab=watchList`); + }); + + test.describe("User is not logged in", () => { + test.use({ + storageState: + "playwright-tests/storage-states/wallet-not-connected.json", + }); + + test("should see login screen", async ({ page }) => { + const requireLogin = await page.getByText( + "Please log in in order to see watchlist projects!", + ); + await expect(requireLogin).toBeVisible(); + }); + }); + + test.describe("User is logged in with bookmarked project", () => { + test.use({ + storageState: + "playwright-tests/storage-states/wallet-connected-project-owner.json", + }); + test("should see their bookmarked projects", async ({ page }) => { + const projectTitle = await page.getByText( + "Testing project on Build DAO", + ); + await expect(projectTitle).toBeVisible({ timeout: 10000 }); + }); + }); + + test.describe("User without bookmarked projects is logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); + test("should see empty page", async ({ page }) => { + const noProjectFound = await page.getByText("No Projects Found"); + await expect(noProjectFound).toBeVisible(); + }); + }); + }); + + test.describe("Projects Involved", () => { + test.beforeEach(async ({ page }) => { + await page.goto(`/${ROOT_SRC}?page=projects&tab=involvedProjects`); + }); + + test.describe("User is not logged in", () => { + test.use({ + storageState: + "playwright-tests/storage-states/wallet-not-connected.json", + }); + test("should see login screen", async ({ page }) => { + const requireLogin = await page.getByText( + "Please log in in order to see involved projects!", + ); + await expect(requireLogin).toBeVisible(); + }); + }); + + test.describe("User involved in projects is logged in", () => { + test.use({ + storageState: + "playwright-tests/storage-states/wallet-connected-project-owner.json", + }); + test("should see their involved project", async ({ page }) => { + const projectTitle = await page.getByText( + "Testing project on Build DAO", + ); + await expect(projectTitle).toBeVisible({ timeout: 10000 }); + }); + }); + + test.describe("User not involved in projects is logged in", () => { + test.use({ + storageState: "playwright-tests/storage-states/wallet-connected.json", + }); + test("should see empty screen", async ({ page }) => { + const noProjectFound = await page.getByText("No Projects Found"); + await expect(noProjectFound).toBeVisible(); + }); + }); + }); }); From b2404a448f9441dd44b270dd37edad992ead1f5b Mon Sep 17 00:00:00 2001 From: Jiku Godwill Nsanwi <65053264+Jikugodwill@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:18:53 +0100 Subject: [PATCH 08/23] Added styles to handle fullscreen on near.social and properly display on near.org as well (#441) * Added styles to handle fullscreen on near.social and properly display on near.org as well * fix tests * Added fix for everthing gateway as well * fmt --------- Co-authored-by: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> --- apps/new/widget/Index.jsx | 24 +++++++++++++++++++--- apps/new/widget/page/project/QuickView.jsx | 8 ++++++++ playwright-tests/tests/projects.spec.js | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/apps/new/widget/Index.jsx b/apps/new/widget/Index.jsx index a03e7e8d..9f7f66b2 100644 --- a/apps/new/widget/Index.jsx +++ b/apps/new/widget/Index.jsx @@ -6,6 +6,22 @@ const { Footer } = VM.require("${config_account}/widget/components.Footer") || { Footer: () => <>, }; +const data = fetch(`https://httpbin.org/headers`); +const gatewayURL = data?.body?.headers?.Origin ?? ""; + +const Container = + gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev") + ? styled.div` + width: 100%; + ` + : styled.div` + position: fixed; + inset: 73px 0px 0px; + width: 100%; + overflow-y: scroll; + height: 100%; + `; + const config = { theme: {}, layout: { @@ -111,7 +127,9 @@ const config = { }; return ( - - - + + + + + ); diff --git a/apps/new/widget/page/project/QuickView.jsx b/apps/new/widget/page/project/QuickView.jsx index ac4574d4..8bb034e7 100644 --- a/apps/new/widget/page/project/QuickView.jsx +++ b/apps/new/widget/page/project/QuickView.jsx @@ -6,6 +6,12 @@ const { href } = VM.require("${alias_old}/widget/lib.url") || { href: () => {}, }; +const data = fetch(`https://httpbin.org/headers`); +const gatewayURL = data?.body?.headers?.Origin ?? ""; + +const isNearDiscovery = + gatewayURL.includes("near.org") || gatewayURL.includes("everything.dev"); + const showCanvas = props.showCanvas; const onClose = props.onClose; const project = props.project; @@ -22,6 +28,7 @@ const profile = { const Container = styled.div` .offcanvas.offcanvas-end { width: 60% !important; + top: 73px; } .close { @@ -86,6 +93,7 @@ return ( tabIndex="-1" data-bs-scroll="false" data-bs-backdrop="true" + style={{ top: isNearDiscovery ? "" : "73px" }} >
diff --git a/playwright-tests/tests/projects.spec.js b/playwright-tests/tests/projects.spec.js index 24ccbfad..4a54a8ed 100644 --- a/playwright-tests/tests/projects.spec.js +++ b/playwright-tests/tests/projects.spec.js @@ -186,7 +186,7 @@ test.describe("?page=projects", () => { test.beforeEach(async ({ page }) => { const editBtn = page.getByTestId("edit-btn"); - await expect(editBtn).toBeVisible(); + await expect(editBtn).toBeVisible({ timeout: 10000 }); await editBtn.click(); expect(page.url()).toContain("?page=projects&tab=editor"); }); From 1dec86d8ac5b61babd6e7af22c82ac57ac61b8c4 Mon Sep 17 00:00:00 2001 From: Megha <100185149+Megha-Dev-19@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:53:15 +0530 Subject: [PATCH 09/23] added tests for project view (#444) --- .../widget/components/project/ProfileCard.jsx | 98 +++++++ apps/new/widget/page/project/TaskEditor.jsx | 2 + apps/new/widget/page/project/tabs/Task.jsx | 4 +- .../widget/components/project/page/Task.jsx | 2 +- playwright-tests/tests/project.spec.js | 255 ++++++++++++++++++ 5 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 apps/new/widget/components/project/ProfileCard.jsx create mode 100644 playwright-tests/tests/project.spec.js diff --git a/apps/new/widget/components/project/ProfileCard.jsx b/apps/new/widget/components/project/ProfileCard.jsx new file mode 100644 index 00000000..52216fe5 --- /dev/null +++ b/apps/new/widget/components/project/ProfileCard.jsx @@ -0,0 +1,98 @@ +const MutedText = styled.span` + color: #818181; + + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 20px; /* 125% */ +`; + +const AccountName = styled.span` + color: #818181; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 20px; + + max-width: 30ch; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +`; + +const ProfileCard = (props) => { + const accountId = props.accountId ?? context.accountId; + const link = props.link ?? true; + // const hideAccountId = props.hideAccountId; + // const hideName = props.hideName; + const hideImage = props.hideImage; + const iconOnly = props.iconOnly; + const openLinkInNewTab = props.openLinkInNewTab ?? false; + + const profile = props.profile ?? Social.getr(`${accountId}/profile`); + + const name = profile.name ?? accountId; + const title = props.title ?? `${name} @${accountId}`; + const tooltip = + props.tooltip && (props.tooltip === true ? title : props.tooltip); + + let inner = ( +
+ {!hideImage && ( + + )} + {!iconOnly && ( +
+ {name} + @{accountId} +
+ )} +
+ ); + + inner = link ? ( + + {inner} + + ) : ( + {inner} + ); + + if (props.tooltip === true) { + return ( + + ); + } + if (tooltip) { + inner = ( + {tooltip}}> + {inner} + + ); + } + return
{inner}
; +}; + +return ProfileCard(props); diff --git a/apps/new/widget/page/project/TaskEditor.jsx b/apps/new/widget/page/project/TaskEditor.jsx index 6593c84b..375d0638 100644 --- a/apps/new/widget/page/project/TaskEditor.jsx +++ b/apps/new/widget/page/project/TaskEditor.jsx @@ -13,6 +13,7 @@ const task = props.task; const onEditTask = props.onEditTask; const onAddTask = props.onAddTask; const project = props.project; +const isEditTask = props.isEditTask; const [taskDetail, setTaskDetail] = useState(task); @@ -136,6 +137,7 @@ return ( list: [...(taskDetail.list ?? []), { ...listItem }], }) } + data-testid="add-task-item" >
diff --git a/apps/new/widget/page/project/tabs/Task.jsx b/apps/new/widget/page/project/tabs/Task.jsx index e8ebbc07..e1b45884 100644 --- a/apps/new/widget/page/project/tabs/Task.jsx +++ b/apps/new/widget/page/project/tabs/Task.jsx @@ -369,6 +369,7 @@ const DropdownMenu = ({ columnTitle, item, index, changeStatusOptions }) => { onBlur={() => handleDropdownToggle(columnTitle, index, false)} >