From 9431c4549f66430ab13a27c6af78c44758eac4ea Mon Sep 17 00:00:00 2001 From: Bryan Date: Thu, 17 Feb 2022 09:44:02 -0800 Subject: [PATCH] fix: Redirect to workspaces page after creation (#309) This is just a quick fix so that the redirection is correct after creating a workspace - so that we make it to our minimal 'workspaces' page. Mainly so we have a path for testing / onboarding more people. Unfortunately the NextJS pages are a bit tricky to test - we don't have infra for it because of the special pathing requirements - we can potentially bring in a library like [next-page-tester](https://github.com/next-page-tester/next-page-tester) and create a separate test directory like `pages_test` - but since we may pick up the RFC to move away from Next, it doesn't seem like a useful effort. With this, creating a project lands on our minimal workspaces page, and the links on the Projects page correctly navigate to the minimal workspaces page. --- site/pages/projects/[organization]/[project]/create.tsx | 2 +- site/pages/projects/[organization]/[project]/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/site/pages/projects/[organization]/[project]/create.tsx b/site/pages/projects/[organization]/[project]/create.tsx index 07e829426a..f93876bfd9 100644 --- a/site/pages/projects/[organization]/[project]/create.tsx +++ b/site/pages/projects/[organization]/[project]/create.tsx @@ -32,7 +32,7 @@ const CreateWorkspacePage: React.FC = () => { const onSubmit = async (req: API.CreateWorkspaceRequest) => { const workspace = await API.Workspace.create(req) - await router.push(`/workspaces/${workspace.id}`) + await router.push(`/workspaces/me/${workspace.name}`) return workspace } diff --git a/site/pages/projects/[organization]/[project]/index.tsx b/site/pages/projects/[organization]/[project]/index.tsx index c8ea27f584..3edd8a1cf6 100644 --- a/site/pages/projects/[organization]/[project]/index.tsx +++ b/site/pages/projects/[organization]/[project]/index.tsx @@ -61,8 +61,8 @@ const ProjectPage: React.FC = () => { { key: "name", name: "Name", - renderer: (nameField: string, data: Workspace) => { - return {nameField} + renderer: (nameField: string) => { + return {nameField} }, }, ]