Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9431c45

Browse files
authored
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.
1 parent dd36317 commit 9431c45

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

site/pages/projects/[organization]/[project]/create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const CreateWorkspacePage: React.FC = () => {
3232

3333
const onSubmit = async (req: API.CreateWorkspaceRequest) => {
3434
const workspace = await API.Workspace.create(req)
35-
await router.push(`/workspaces/${workspace.id}`)
35+
await router.push(`/workspaces/me/${workspace.name}`)
3636
return workspace
3737
}
3838

site/pages/projects/[organization]/[project]/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const ProjectPage: React.FC = () => {
6161
{
6262
key: "name",
6363
name: "Name",
64-
renderer: (nameField: string, data: Workspace) => {
65-
return <Link href={`/projects/${organization}/${project}/${data.id}`}>{nameField}</Link>
64+
renderer: (nameField: string) => {
65+
return <Link href={`/workspaces/me/${nameField}`}>{nameField}</Link>
6666
},
6767
},
6868
]

0 commit comments

Comments
 (0)