Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure links to dh.page #566

2 changes: 1 addition & 1 deletion playwright-tests/tests/addons.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.describe("Wallet is connected", () => {

test.describe("AddonsConfigurator", () => {
const baseUrl =
"/devgovgigs.near/widget/app?page=community.configuration&handle=devhub-test";
"/devhub.near/widget/dh.community.configuration?handle=devhub-test";
// const dropdownSelector =
// 'input[data-component="near/widget/DIG.InputSelect"]';
// const addButtonSelector = "button.btn-success:has(i.bi.bi-plus)";
Expand Down
10 changes: 5 additions & 5 deletions playwright-tests/tests/admin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe("Wallet is connected", () => {
test("should be able to manage featured communities from home page settings tab", async ({
page,
}) => {
await page.goto("/devhub.near/widget/app?page=admin");
await page.goto("/devhub.near/widget/dh.admin");

const buttonSelector = `button[data-testid="preview-homepage"]`;
// Wait for the first post history button to be visible
Expand Down Expand Up @@ -42,7 +42,7 @@ test.describe("Wallet is connected", () => {
});

test("should be able to manage moderators", async ({ page }) => {
await page.goto("/devhub.near/widget/app?page=admin");
await page.goto("/devhub.near/widget/dh.admin");
const buttonSelector = `button[data-testid="preview-homepage"]`;
// Wait for the first post button to be visible
await page.waitForSelector(buttonSelector, {
Expand Down Expand Up @@ -72,7 +72,7 @@ test.describe("Wallet is connected", () => {
});

test("should be able to manage restricted labels", async ({ page }) => {
await page.goto("/devhub.near/widget/app?page=admin");
await page.goto("/devhub.near/widget/dh.admin");
const buttonSelector = `button[data-testid="preview-homepage"]`;
// Wait for the first post button to be visible
await page.waitForSelector(buttonSelector, {
Expand Down Expand Up @@ -171,7 +171,7 @@ test.describe("Wallet is connected", () => {
test("shouldn't be able to add a none existing community handle without a warning", async ({
page,
}) => {
await page.goto("/devhub.near/widget/app?page=admin");
await page.goto("/devhub.near/widget/dh.admin");
const buttonSelector = `button[data-testid="preview-homepage"]`;
// Wait for the first post button to be visible
await page.waitForSelector(buttonSelector, {
Expand Down Expand Up @@ -199,7 +199,7 @@ test.describe("Wallet is not connect", () => {
test("should show banner that the user doesn't have access", async ({
page,
}) => {
await page.goto("/devhub.near/widget/app?page=admin");
await page.goto("/devhub.near/widget/dh.admin");
const buttonSelector = "h2.alert.alert-danger";
// Wait for the first post history button to be visible

Expand Down
6 changes: 3 additions & 3 deletions playwright-tests/tests/communities.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test.describe("Wallet is connected", () => {
test("should show spawner when user clicks create community", async ({
page,
}) => {
await page.goto("/devgovgigs.near/widget/app?page=communities");
await page.goto("/devhub.near/widget/dh.communities");

const createCommunityButtonSelector = 'button:has-text("Create Community")';

Expand All @@ -17,7 +17,7 @@ test.describe("Wallet is connected", () => {
});
await page.click(createCommunityButtonSelector);

const communitySpawnerSelector = 'div:has-text("Community information")';
const communitySpawnerSelector = 'div:has-text("Description")';
await page.waitForSelector(communitySpawnerSelector, { state: "visible" });
});
});
Expand All @@ -28,7 +28,7 @@ test.describe("Wallet is not connected", () => {
});

test("spawner and button should not be visible", async ({ page }) => {
await page.goto("/devgovgigs.near/widget/app?page=communities");
await page.goto("/devhub.near/widget/dh.communities");

const createCommunityButtonSelector = 'button:has-text("Create Community")';

Expand Down
18 changes: 6 additions & 12 deletions playwright-tests/tests/community.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test, expect } from "@playwright/test";

test("should load a community page if handle exists", async ({ page }) => {
await page.goto("/devhub.near/widget/app?page=community&handle=devhub-test");
await page.goto("/devhub.near/widget/dh.community?handle=devhub-test");

// Using the <Link> that wraps the tabs to identify a community page loaded
const communityTabSelector = `a[href^="/devhub.near/widget/app?page=community&handle=devhub-test&tab="]`;
const communityTabSelector = `a[href^="/devhub.near/widget/dh.community?handle=devhub-test&tab="]`;

// Wait for the tab to be visible
await page.waitForSelector(communityTabSelector, {
Expand All @@ -19,9 +19,7 @@ test("should load a community page if handle exists", async ({ page }) => {
});

test("should load an error page if handle does not exist", async ({ page }) => {
await page.goto(
"/devgovgigs.near/widget/app?page=community&handle=devhub-faketest"
);
await page.goto("/devhub.near/widget/dh.community?handle=devhub-faketest");

// Using the <Link> that wraps the card to identify a community
const communityNotFoundSelector =
Expand All @@ -41,9 +39,7 @@ test.describe("Wallet is connected", () => {
test("should allow connected user to post from community page", async ({
page,
}) => {
await page.goto(
"/devhub.near/widget/app?page=community&handle=devhub-test"
);
await page.goto("/devhub.near/widget/dh.community?handle=devhub-test");

const postButtonSelector = 'a:has-text("Post")';

Expand All @@ -59,7 +55,7 @@ test.describe("Wallet is connected", () => {

// Verify that the URL is the expected one.
expect(page.url()).toBe(
"http://localhost:8080/devhub.near/widget/app?page=create&labels=devhub-test"
"http://localhost:8080/devhub.near/widget/dh.create?labels=devhub-test"
);

// Wait for the Typeahead field to render.
Expand Down Expand Up @@ -88,9 +84,7 @@ test.describe("Wallet is not connected", () => {
test("should not allow unconnected user to post from community page", async ({
page,
}) => {
await page.goto(
"/devgovgigs.near/widget/app?page=community&handle=devhub-test"
);
await page.goto("/devhub.near/widget/dh.community?handle=devhub-test");

const createCommunityButtonSelector = 'button:has-text("Post")';

Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/tests/create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { setInputAndAssert, selectAndAssert } from "../testUtils";
test("should be able to submit a solution with USDC as currency", async ({
page,
}) => {
await page.goto("/devgovgigs.near/widget/app?page=create");
await page.goto("/devhub.near/widget/dh.create");

await page.click('button:has-text("Solution")');

Expand Down
6 changes: 3 additions & 3 deletions playwright-tests/tests/feed.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test("LEGACY: should show post history for posts in the feed", async ({
});

test("should show post history for posts in the feed", async ({ page }) => {
await page.goto("/devgovgigs.near/widget/app?page=feed");
await page.goto("/devhub.near/widget/dh.feed");

const firstPostHistoryButtonSelector = 'a.card-link[title="Post History"]';
// Wait for the first post history button to be visible
Expand All @@ -47,7 +47,7 @@ test("should show post history for posts in the feed", async ({ page }) => {

test("should hide posts with devhub-test tag", async ({ page }) => {
// go to feeds page
await page.goto("/devhub.near/widget/app?page=feed");
await page.goto("/devhub.near/widget/dh.feed");

// look for tag input
const tagInputSelector = 'input[placeholder="Search by tag"]';
Expand Down Expand Up @@ -76,7 +76,7 @@ test.describe("Wallet is connected", () => {

test("should hide posts editor when hit cancel", async ({ page }) => {
// go to feed with logged in user account
await page.goto("/devhub.near/widget/app?page=feed&author=efiz.near");
await page.goto("/devhub.near/widget/dh.feed?author=efiz.near");

// find first post with edit button
const firstPostWithEditButton = 'a.card-link[title="Edit post"]';
Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/tests/search.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from "@playwright/test";

test("should show post history for posts in the feed", async ({ page }) => {
await page.goto("/devgovgigs.near/widget/app?page=feed");
await page.goto("/devhub.near/widget/dh.feed");

// Fill the search by content by to
const searchInputSelector = 'input.form-control[type="search"]';
Expand Down
3 changes: 1 addition & 2 deletions src/DevGov/Notification/Item/Left.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ return props.type ? (
<a
className="fw-bold text-muted"
href={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_DEVHUB}/widget/dh.post",
params: {
page: "post",
id: props.post,
},
})}
Expand Down
3 changes: 1 addition & 2 deletions src/DevGov/Notification/Item/Right.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ return props.post === undefined ? (
<a
className="btn btn-outline-dark"
href={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_DEVHUB}/widget/dh.post",
params: {
page: "post",
id: props.post,
},
})}
Expand Down
4 changes: 2 additions & 2 deletions src/devhub/components/island/connect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Cards = communities.map((com) => {
return {
title: com.name,
description: com.description,
href: "/${REPL_DEVHUB}/widget/app?page=community&handle=" + com.handle,
href: "/${REPL_DEVHUB}/widget/dh.community?handle=" + com.handle,
};
});

Expand Down Expand Up @@ -309,7 +309,7 @@ const Content = (
))}
</MobileCards>
<CTAContainer>
<CTA href="/${REPL_DEVHUB}/widget/app?page=communities">
<CTA href="/${REPL_DEVHUB}/widget/dh.communities">
Explore all communities →
</CTA>
</CTAContainer>
Expand Down
7 changes: 2 additions & 5 deletions src/devhub/components/island/hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,7 @@ return (
</Lead>
<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: {
page: "about",
},
widgetSrc: "${REPL_DEVHUB}/widget/dh.about",
})}
>
<CTA href="#">Read more →</CTA>
Expand All @@ -199,7 +196,7 @@ return (
<Lead>Join a vibrant community of innovators shaping the open web.</Lead>
<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
widgetSrc: "${REPL_DEVHUB}/widget/dh.about",
params: {
page: "about",
},
Expand Down
13 changes: 6 additions & 7 deletions src/devhub/components/island/participate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ const Links = [
links: [
{
title: "Ideate on DevHub",
href: "/devhub.near/widget/app?page=blog&id=2029",
href: "/devhub.near/widget/dh.blog?id=2029",
count: 1,
},
{
title: "Post a Proposal",
href: "/devhub.near/widget/app?page=blog&id=2035",
href: "/devhub.near/widget/dh.blog?id=2035",
count: 2,
},
{
title: "Host an Event",
href: "/devhub.near/widget/app?page=community&handle=hacks&tab=Wiki%202",
href: "/devhub.near/widget/dh.community?handle=hacks&tab=Wiki%202",
count: 3,
},
],
Expand All @@ -61,12 +61,12 @@ const Links = [
},
{
title: "Join the Fellowship",
href: "/devhub.near/widget/app?page=community&handle=fellowship&tab=Wiki%201",
href: "/devhub.near/widget/dh.community?handle=fellowship&tab=Wiki%201",
count: 5,
},
{
title: "Join NEAR Campus",
href: "/devhub.near/widget/app?page=community&handle=near-campus",
href: "/devhub.near/widget/dh.community?handle=near-campus",
count: 6,
},
],
Expand Down Expand Up @@ -183,8 +183,7 @@ const Content = (

<Link
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "contribute" },
widgetSrc: "${REPL_DEVHUB}/widget/dh.contribute",
})}
style={{ textDecoration: "none" }}
>
Expand Down
4 changes: 2 additions & 2 deletions src/devhub/components/island/support.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Items = [
</>
),
cta: {
href: "/devhub.near/widget/app?page=community&handle=education&tab=Wiki%202",
href: "/devhub.near/widget/dh.community?handle=education&tab=Wiki%202",
title: "Book a meeting ↗",
},
},
Expand All @@ -32,7 +32,7 @@ const Items = [
description:
"Explore funding opportunities from DevHub to fuel your vision",
cta: {
href: "/devhub.near/widget/app?page=community&handle=developer-dao&tab=Funding",
href: "/devhub.near/widget/dh.community?handle=developer-dao&tab=Funding",
title: "Learn more ↗",
},
},
Expand Down
6 changes: 2 additions & 4 deletions src/devhub/components/molecule/NavbarDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ return (
<Link
style={{ textDecoration: "none" }}
to={linkHref({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: href },
widgetSrc: `${REPL_DEVHUB}/widget/dh.${href}`,
})}
>
{title}
Expand Down Expand Up @@ -113,8 +112,7 @@ return (
<Link
style={{ textDecoration: "none" }}
to={linkHref({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: link.href },
widgetSrc: `${REPL_DEVHUB}/widget/dh.${link.href}`,
})}
>
{link.title}
Expand Down
11 changes: 5 additions & 6 deletions src/devhub/components/organism/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const Logo = () => {
<Wrapper>
<Link
to={linkHref({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "home" },
widgetSrc: "${REPL_DEVHUB}/widget/dh.home",
})}
>
<svg
Expand Down Expand Up @@ -68,8 +67,8 @@ const ProfileIcon = () => {
return (
<Link
to={linkHref({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "profile", accountId: context.accountId },
widgetSrc: "${REPL_DEVHUB}/widget/dh.profile",
params: { accountId: context.accountId },
})}
>
<Widget
Expand Down Expand Up @@ -259,7 +258,7 @@ return (
<MobileLink
key={`mobile-link-${idx}`}
className={link.href === props.page && "active"}
href={`/${REPL_DEVHUB}/widget/app?page=${link.href}`}
href={`/${REPL_DEVHUB}/widget/dh.${link.href}`}
>
{link.title}
</MobileLink>
Expand All @@ -279,7 +278,7 @@ return (
<MobileLink
key={`nested-link-${idx}`}
className={link.href === props.page && "active"}
href={`/${REPL_DEVHUB}/widget/app?page=${it.href}`}
href={`/${REPL_DEVHUB}/widget/dh.${it.href}`}
>
/{it.title}
</MobileLink>
Expand Down
4 changes: 2 additions & 2 deletions src/devhub/entity/addon/blog/Viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function BlogCard(postId) {
<Link
style={{ textDecoration: "none" }}
to={href({
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "blog", id: postId },
widgetSrc: "${REPL_DEVHUB}/widget/dh.blog",
params: { id: postId },
})}
>
<CardContainer>
Expand Down
4 changes: 2 additions & 2 deletions src/devhub/entity/addon/github/Viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ return (
communityHandle: handle, // rather than fetching again via the handle
link: href({
// do we need a link?
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "community", handle },
widgetSrc: "${REPL_DEVHUB}/widget/dh.community",
params: { handle },
}),
permissions,
}}
Expand Down
4 changes: 2 additions & 2 deletions src/devhub/entity/addon/kanban/Viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const CommunityBoardPage = ({ handle, permissions }) => {
communityHandle: handle, // rather than fetching again via the handle
link: href({
// do we need a link?
widgetSrc: "${REPL_DEVHUB}/widget/app",
params: { page: "community", handle },
widgetSrc: "${REPL_DEVHUB}/widget/dh.community",
params: { handle },
}),
permissions,
}}
Expand Down
Loading