From 593ad0222eab98e39b76bdf2834144b2960d6719 Mon Sep 17 00:00:00 2001 From: Krzysztof Czerwinski Date: Sat, 21 Dec 2024 15:20:43 +0100 Subject: [PATCH] Change `/store*` url to `/marketplace*` --- autogpt_platform/frontend/src/app/layout.tsx | 8 ++++---- .../frontend/src/app/login/actions.ts | 2 +- .../(user)/dashboard/page.tsx | 0 .../(user)/integrations/page.tsx | 0 .../app/{store => marketplace}/(user)/layout.tsx | 10 +++++----- .../(user)/profile/page.tsx | 0 .../(user)/settings/page.tsx | 0 .../agent/[creator]/[slug]/page.tsx | 4 ++-- .../creator/[creator]/page.tsx | 2 +- .../src/app/{store => marketplace}/page.tsx | 0 .../app/{store => marketplace}/search/page.tsx | 0 autogpt_platform/frontend/src/app/page.tsx | 2 +- .../frontend/src/components/agptui/AgentInfo.tsx | 2 +- .../src/components/agptui/NavbarLink.tsx | 2 +- .../frontend/src/components/agptui/SearchBar.tsx | 2 +- .../frontend/src/components/agptui/Sidebar.tsx | 16 ++++++++-------- .../agptui/composite/AgentsSection.tsx | 2 +- .../agptui/composite/FeaturedCreators.tsx | 2 +- .../agptui/composite/FeaturedSection.tsx | 2 +- .../components/agptui/composite/HeroSection.tsx | 2 +- .../agptui/composite/PublishAgentPopout.tsx | 2 +- .../src/components/nav/NavBarButtons.tsx | 2 +- .../src/lib/autogpt-server-api/client.ts | 2 +- .../frontend/src/lib/supabase/middleware.ts | 8 ++++---- autogpt_platform/frontend/src/tests/auth.spec.ts | 8 ++++---- .../frontend/src/tests/profile.spec.ts | 2 +- 26 files changed, 41 insertions(+), 41 deletions(-) rename autogpt_platform/frontend/src/app/{store => marketplace}/(user)/dashboard/page.tsx (100%) rename autogpt_platform/frontend/src/app/{store => marketplace}/(user)/integrations/page.tsx (100%) rename autogpt_platform/frontend/src/app/{store => marketplace}/(user)/layout.tsx (57%) rename autogpt_platform/frontend/src/app/{store => marketplace}/(user)/profile/page.tsx (100%) rename autogpt_platform/frontend/src/app/{store => marketplace}/(user)/settings/page.tsx (100%) rename autogpt_platform/frontend/src/app/{store => marketplace}/agent/[creator]/[slug]/page.tsx (96%) rename autogpt_platform/frontend/src/app/{store => marketplace}/creator/[creator]/page.tsx (98%) rename autogpt_platform/frontend/src/app/{store => marketplace}/page.tsx (100%) rename autogpt_platform/frontend/src/app/{store => marketplace}/search/page.tsx (100%) diff --git a/autogpt_platform/frontend/src/app/layout.tsx b/autogpt_platform/frontend/src/app/layout.tsx index 944e2301d395..744f5c905d5d 100644 --- a/autogpt_platform/frontend/src/app/layout.tsx +++ b/autogpt_platform/frontend/src/app/layout.tsx @@ -38,7 +38,7 @@ export default async function RootLayout({ links={[ { name: "Marketplace", - href: "/store", + href: "/marketplace", }, { name: "Library", @@ -55,7 +55,7 @@ export default async function RootLayout({ { icon: IconType.Edit, text: "Edit profile", - href: "/store/profile", + href: "/marketplace/profile", }, ], }, @@ -64,7 +64,7 @@ export default async function RootLayout({ { icon: IconType.LayoutDashboard, text: "Creator Dashboard", - href: "/store/dashboard", + href: "/marketplace/dashboard", }, { icon: IconType.UploadCloud, @@ -77,7 +77,7 @@ export default async function RootLayout({ { icon: IconType.Settings, text: "Settings", - href: "/store/settings", + href: "/marketplace/settings", }, ], }, diff --git a/autogpt_platform/frontend/src/app/login/actions.ts b/autogpt_platform/frontend/src/app/login/actions.ts index 7c3fb8125e27..021e74621c0b 100644 --- a/autogpt_platform/frontend/src/app/login/actions.ts +++ b/autogpt_platform/frontend/src/app/login/actions.ts @@ -99,7 +99,7 @@ export async function signup(values: z.infer) { } console.log("Signed up"); revalidatePath("/", "layout"); - redirect("/store/profile"); + redirect("/marketplace/profile"); }, ); } diff --git a/autogpt_platform/frontend/src/app/store/(user)/dashboard/page.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/dashboard/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/(user)/dashboard/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/(user)/dashboard/page.tsx diff --git a/autogpt_platform/frontend/src/app/store/(user)/integrations/page.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/integrations/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/(user)/integrations/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/(user)/integrations/page.tsx diff --git a/autogpt_platform/frontend/src/app/store/(user)/layout.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/layout.tsx similarity index 57% rename from autogpt_platform/frontend/src/app/store/(user)/layout.tsx rename to autogpt_platform/frontend/src/app/marketplace/(user)/layout.tsx index 0f90e5bd3b4a..bb67dc584b75 100644 --- a/autogpt_platform/frontend/src/app/store/(user)/layout.tsx +++ b/autogpt_platform/frontend/src/app/marketplace/(user)/layout.tsx @@ -5,11 +5,11 @@ export default function Layout({ children }: { children: React.ReactNode }) { const sidebarLinkGroups = [ { links: [ - { text: "Creator Dashboard", href: "/store/dashboard" }, - { text: "Agent dashboard", href: "/store/agent-dashboard" }, - { text: "Integrations", href: "/store/integrations" }, - { text: "Profile", href: "/store/profile" }, - { text: "Settings", href: "/store/settings" }, + { text: "Creator Dashboard", href: "/marketplace/dashboard" }, + { text: "Agent dashboard", href: "/marketplace/agent-dashboard" }, + { text: "Integrations", href: "/marketplace/integrations" }, + { text: "Profile", href: "/marketplace/profile" }, + { text: "Settings", href: "/marketplace/settings" }, ], }, ]; diff --git a/autogpt_platform/frontend/src/app/store/(user)/profile/page.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/profile/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/(user)/profile/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/(user)/profile/page.tsx diff --git a/autogpt_platform/frontend/src/app/store/(user)/settings/page.tsx b/autogpt_platform/frontend/src/app/marketplace/(user)/settings/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/(user)/settings/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/(user)/settings/page.tsx diff --git a/autogpt_platform/frontend/src/app/store/agent/[creator]/[slug]/page.tsx b/autogpt_platform/frontend/src/app/marketplace/agent/[creator]/[slug]/page.tsx similarity index 96% rename from autogpt_platform/frontend/src/app/store/agent/[creator]/[slug]/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/agent/[creator]/[slug]/page.tsx index 7db11eaf9abc..f7f3c39a89ff 100644 --- a/autogpt_platform/frontend/src/app/store/agent/[creator]/[slug]/page.tsx +++ b/autogpt_platform/frontend/src/app/marketplace/agent/[creator]/[slug]/page.tsx @@ -44,10 +44,10 @@ export default async function Page({ }); const breadcrumbs = [ - { name: "Store", link: "/store" }, + { name: "Store", link: "/marketplace" }, { name: agent.creator, - link: `/store/creator/${encodeURIComponent(agent.creator)}`, + link: `/marketplace/creator/${encodeURIComponent(agent.creator)}`, }, { name: agent.agent_name, link: "#" }, ]; diff --git a/autogpt_platform/frontend/src/app/store/creator/[creator]/page.tsx b/autogpt_platform/frontend/src/app/marketplace/creator/[creator]/page.tsx similarity index 98% rename from autogpt_platform/frontend/src/app/store/creator/[creator]/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/creator/[creator]/page.tsx index 7474aef2e7a3..904f02b93f40 100644 --- a/autogpt_platform/frontend/src/app/store/creator/[creator]/page.tsx +++ b/autogpt_platform/frontend/src/app/marketplace/creator/[creator]/page.tsx @@ -47,7 +47,7 @@ export default async function Page({
diff --git a/autogpt_platform/frontend/src/app/store/page.tsx b/autogpt_platform/frontend/src/app/marketplace/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/page.tsx diff --git a/autogpt_platform/frontend/src/app/store/search/page.tsx b/autogpt_platform/frontend/src/app/marketplace/search/page.tsx similarity index 100% rename from autogpt_platform/frontend/src/app/store/search/page.tsx rename to autogpt_platform/frontend/src/app/marketplace/search/page.tsx diff --git a/autogpt_platform/frontend/src/app/page.tsx b/autogpt_platform/frontend/src/app/page.tsx index b59d651f0b42..5a079f262994 100644 --- a/autogpt_platform/frontend/src/app/page.tsx +++ b/autogpt_platform/frontend/src/app/page.tsx @@ -3,5 +3,5 @@ import { redirect } from "next/navigation"; export default function Page() { - redirect("/store"); + redirect("/marketplace"); } diff --git a/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx b/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx index fe12e75b4979..10b2a3d3b7b5 100644 --- a/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx +++ b/autogpt_platform/frontend/src/components/agptui/AgentInfo.tsx @@ -58,7 +58,7 @@ export const AgentInfo: React.FC = ({ by {creator} diff --git a/autogpt_platform/frontend/src/components/agptui/NavbarLink.tsx b/autogpt_platform/frontend/src/components/agptui/NavbarLink.tsx index 8d4094b40c8f..5bfe77d86dd8 100644 --- a/autogpt_platform/frontend/src/components/agptui/NavbarLink.tsx +++ b/autogpt_platform/frontend/src/components/agptui/NavbarLink.tsx @@ -28,7 +28,7 @@ export const NavbarLink = ({ name, href }: NavbarLinkProps) => { : "" } flex items-center justify-start gap-3`} > - {href === "/store" && ( + {href === "/marketplace" && ( diff --git a/autogpt_platform/frontend/src/components/agptui/SearchBar.tsx b/autogpt_platform/frontend/src/components/agptui/SearchBar.tsx index 95e3a3fe87a6..7f23d87f0777 100644 --- a/autogpt_platform/frontend/src/components/agptui/SearchBar.tsx +++ b/autogpt_platform/frontend/src/components/agptui/SearchBar.tsx @@ -36,7 +36,7 @@ export const SearchBar: React.FC = ({ if (searchQuery.trim()) { // Encode the search term and navigate to the desired path const encodedTerm = encodeURIComponent(searchQuery); - router.push(`/store/search?searchTerm=${encodedTerm}`); + router.push(`/marketplace/search?searchTerm=${encodedTerm}`); } }; diff --git a/autogpt_platform/frontend/src/components/agptui/Sidebar.tsx b/autogpt_platform/frontend/src/components/agptui/Sidebar.tsx index 5cad3fddccce..302c3daeabf6 100644 --- a/autogpt_platform/frontend/src/components/agptui/Sidebar.tsx +++ b/autogpt_platform/frontend/src/components/agptui/Sidebar.tsx @@ -41,7 +41,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -50,7 +50,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -59,7 +59,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -68,7 +68,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => { @@ -85,7 +85,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -94,7 +94,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -103,7 +103,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => {
@@ -112,7 +112,7 @@ export const Sidebar: React.FC = ({ linkGroups }) => { diff --git a/autogpt_platform/frontend/src/components/agptui/composite/AgentsSection.tsx b/autogpt_platform/frontend/src/components/agptui/composite/AgentsSection.tsx index 7132dd0b7c1b..4f89abad4802 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/AgentsSection.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/AgentsSection.tsx @@ -39,7 +39,7 @@ export const AgentsSection: React.FC = ({ const handleCardClick = (creator: string, slug: string) => { router.push( - `/store/agent/${encodeURIComponent(creator)}/${encodeURIComponent(slug)}`, + `/marketplace/agent/${encodeURIComponent(creator)}/${encodeURIComponent(slug)}`, ); }; diff --git a/autogpt_platform/frontend/src/components/agptui/composite/FeaturedCreators.tsx b/autogpt_platform/frontend/src/components/agptui/composite/FeaturedCreators.tsx index bb3ccbec699d..bca4c1fc859f 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/FeaturedCreators.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/FeaturedCreators.tsx @@ -24,7 +24,7 @@ export const FeaturedCreators: React.FC = ({ const router = useRouter(); const handleCardClick = (creator: string) => { - router.push(`/store/creator/${encodeURIComponent(creator)}`); + router.push(`/marketplace/creator/${encodeURIComponent(creator)}`); }; // Only show first 4 creators diff --git a/autogpt_platform/frontend/src/components/agptui/composite/FeaturedSection.tsx b/autogpt_platform/frontend/src/components/agptui/composite/FeaturedSection.tsx index b9bd3b4fe633..a36e527446c0 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/FeaturedSection.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/FeaturedSection.tsx @@ -41,7 +41,7 @@ export const FeaturedSection: React.FC = ({ const handleCardClick = (creator: string, slug: string) => { router.push( - `/store/agent/${encodeURIComponent(creator)}/${encodeURIComponent(slug)}`, + `/marketplace/agent/${encodeURIComponent(creator)}/${encodeURIComponent(slug)}`, ); }; diff --git a/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx b/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx index e7b19e1ca7ec..61d025c35158 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/HeroSection.tsx @@ -10,7 +10,7 @@ export const HeroSection: React.FC = () => { function onFilterChange(selectedFilters: string[]) { const encodedTerm = encodeURIComponent(selectedFilters.join(", ")); - router.push(`/store/search?searchTerm=${encodedTerm}`); + router.push(`/marketplace/search?searchTerm=${encodedTerm}`); } return ( diff --git a/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx b/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx index f2b3c9b79c73..56cdac79e9ce 100644 --- a/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx +++ b/autogpt_platform/frontend/src/components/agptui/composite/PublishAgentPopout.tsx @@ -260,7 +260,7 @@ export const PublishAgentPopout: React.FC = ({ onClose={handleClose} onDone={handleClose} onViewProgress={() => { - router.push("/store/dashboard"); + router.push("/marketplace/dashboard"); handleClose(); }} /> diff --git a/autogpt_platform/frontend/src/components/nav/NavBarButtons.tsx b/autogpt_platform/frontend/src/components/nav/NavBarButtons.tsx index 5e81f17bd0a4..7852fb941e0b 100644 --- a/autogpt_platform/frontend/src/components/nav/NavBarButtons.tsx +++ b/autogpt_platform/frontend/src/components/nav/NavBarButtons.tsx @@ -24,7 +24,7 @@ export function NavBarButtons({ className }: { className?: string }) { icon: , }, { - href: "/store", + href: "/marketplace", text: "Marketplace", icon: , }, diff --git a/autogpt_platform/frontend/src/lib/autogpt-server-api/client.ts b/autogpt_platform/frontend/src/lib/autogpt-server-api/client.ts index fcfbaa7014d6..2f2b26e945b5 100644 --- a/autogpt_platform/frontend/src/lib/autogpt-server-api/client.ts +++ b/autogpt_platform/frontend/src/lib/autogpt-server-api/client.ts @@ -311,7 +311,7 @@ export default class BackendAPI { "/store/submissions/generate_image?agent_id=" + agent_id, ); } - c; + deleteStoreSubmission(submission_id: string): Promise { return this._request("DELETE", `/store/submissions/${submission_id}`); } diff --git a/autogpt_platform/frontend/src/lib/supabase/middleware.ts b/autogpt_platform/frontend/src/lib/supabase/middleware.ts index e6b4308a2bd4..363d9da1afd1 100644 --- a/autogpt_platform/frontend/src/lib/supabase/middleware.ts +++ b/autogpt_platform/frontend/src/lib/supabase/middleware.ts @@ -5,9 +5,9 @@ import { NextResponse, type NextRequest } from "next/server"; const PROTECTED_PAGES = [ "/monitor", "/build", - "/store/profile", - "/store/settings", - "/store/dashboard", + "/marketplace/profile", + "/marketplace/settings", + "/marketplace/dashboard", ]; const ADMIN_PAGES = ["/admin"]; @@ -87,7 +87,7 @@ export async function updateSession(request: NextRequest) { ADMIN_PAGES.some((page) => request.nextUrl.pathname.startsWith(`${page}`)) ) { // no user, potentially respond by redirecting the user to the login page - url.pathname = `/store`; + url.pathname = `/marketplace`; return NextResponse.redirect(url); } diff --git a/autogpt_platform/frontend/src/tests/auth.spec.ts b/autogpt_platform/frontend/src/tests/auth.spec.ts index 8c7ac4ab7780..a658dbdb4138 100644 --- a/autogpt_platform/frontend/src/tests/auth.spec.ts +++ b/autogpt_platform/frontend/src/tests/auth.spec.ts @@ -5,7 +5,7 @@ test.describe("Authentication", () => { test("user can login successfully", async ({ page, loginPage, testUser }) => { await page.goto("/login"); await loginPage.login(testUser.email, testUser.password); - await test.expect(page).toHaveURL("/store"); + await test.expect(page).toHaveURL("/marketplace"); await test .expect(page.getByTestId("profile-popout-menu-trigger")) .toBeVisible(); @@ -19,7 +19,7 @@ test.describe("Authentication", () => { await page.goto("/login"); await loginPage.login(testUser.email, testUser.password); - await test.expect(page).toHaveURL("/store"); + await test.expect(page).toHaveURL("/marketplace"); // Click on the profile menu trigger to open popout await page.getByTestId("profile-popout-menu-trigger").click(); @@ -43,7 +43,7 @@ test.describe("Authentication", () => { }) => { await page.goto("/login"); await loginPage.login(testUser.email, testUser.password); - await test.expect(page).toHaveURL("/store"); + await test.expect(page).toHaveURL("/marketplace"); // Click on the profile menu trigger to open popout await page.getByTestId("profile-popout-menu-trigger").click(); @@ -52,7 +52,7 @@ test.describe("Authentication", () => { await test.expect(page).toHaveURL("/login"); await loginPage.login(testUser.email, testUser.password); - await test.expect(page).toHaveURL("/store"); + await test.expect(page).toHaveURL("/marketplace"); await test .expect(page.getByTestId("profile-popout-menu-trigger")) .toBeVisible(); diff --git a/autogpt_platform/frontend/src/tests/profile.spec.ts b/autogpt_platform/frontend/src/tests/profile.spec.ts index 03787e2748fb..22048b0caa2c 100644 --- a/autogpt_platform/frontend/src/tests/profile.spec.ts +++ b/autogpt_platform/frontend/src/tests/profile.spec.ts @@ -10,7 +10,7 @@ test.describe("Profile", () => { // Start each test with login using worker auth await page.goto("/login"); await loginPage.login(testUser.email, testUser.password); - await test.expect(page).toHaveURL("/store"); + await test.expect(page).toHaveURL("/marketplace"); }); test("user can view their profile information", async ({