An open-source, faster Devin alternative
TypeScript
web: send organizations without projects to their computer
Slack U06GFN8DJ7Pab1fe77f6c58
diff --git a/web/src/managed-agents/Computer.test.tsx b/web/src/managed-agents/Computer.test.tsxindex f8556850..4ac2632c 100644--- a/web/src/managed-agents/Computer.test.tsx+++ b/web/src/managed-agents/Computer.test.tsx@@ -166,4 +166,11 @@ describe('Computer page', () => {expect(container.textContent).toContain('Unlink')})+ it('sends an organization without projects to its computer', async () => {+ projectsApi.getManagedProjects.mockResolvedValue([])+ computerApi.getComputer.mockResolvedValue(provisioning)++ render('/')+ await settle(() => location() === '/computer', 'redirect to /computer')+ })})diff --git a/web/src/managed-agents/Home.test.tsx b/web/src/managed-agents/Home.test.tsxindex 191f4551..cbb4aae1 100644--- a/web/src/managed-agents/Home.test.tsx+++ b/web/src/managed-agents/Home.test.tsx@@ -20,12 +20,13 @@ function renderProjects(projects: unknown[], archived: unknown[] = []) {}describe('projects home onboarding', () => {- it('shows CLI onboarding when the account has no projects', () => {+ it('does not show CLI onboarding on the home screen without projects', () => {+ // An organization without projects is sent to its computer (see+ // Computer.test.tsx); CLI onboarding stays at /new.const markup = renderProjects([])- expect(markup).toContain(INSTALL_CLI_COMMAND)+ expect(markup).not.toContain(INSTALL_CLI_COMMAND)expect(markup).not.toContain('Create project')- expect(markup).not.toContain('Start from a template')})it('sends New project to the same CLI onboarding route', () => {diff --git a/web/src/managed-agents/Home.tsx b/web/src/managed-agents/Home.tsxindex bb888d2e..e6584b02 100644--- a/web/src/managed-agents/Home.tsx+++ b/web/src/managed-agents/Home.tsx@@ -1,6 +1,6 @@import { useState } from 'react'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'-import { Link } from 'react-router-dom'+import { Link, Navigate } from 'react-router-dom'import {Archive,ChevronRight,@@ -20,7 +20,6 @@ import {getManagedProjects,restoreManagedProject,} from './api'-import ProjectOnboarding from './ProjectOnboarding'export default function ProjectsHome() {const queryClient = useQueryClient()@@ -83,8 +82,10 @@ export default function ProjectsHome() {)}+ // An organization's first screen is its computer (017, work 052). Project+ // creation stays CLI-first at /new, which the computer page links to.if (items.length === 0 && archivedItems.length === 0) {- return <ProjectOnboarding />+ return <Navigate to="/computer" replace />}return (