fix(web): keep project create in shell, not onboarding
Projekte + shared the new-space post-create path and always sent users to /onboarding. Route project variant to /app with the new space selected; keep /onboarding for global New space when a first bot is still needed. Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
parent
bb51852c7d
commit
57c968dc8b
@ -8,12 +8,25 @@ test("Projekte + opens new project dialog instead of group form", async ({ page
|
|||||||
await page.goto("/app");
|
await page.goto("/app");
|
||||||
await page.waitForURL(/\/app\/[^/]+$/);
|
await page.waitForURL(/\/app\/[^/]+$/);
|
||||||
|
|
||||||
|
const sidebar = page.locator("aside").first();
|
||||||
const projekte = page.locator(".sidebar-projekte");
|
const projekte = page.locator(".sidebar-projekte");
|
||||||
await projekte.getByRole("button", { name: "Create a project" }).click();
|
await projekte.getByRole("button", { name: "Create a project" }).click();
|
||||||
await expect(page.getByRole("dialog", { name: "New project" })).toBeVisible();
|
await expect(page.getByRole("dialog", { name: "New project" })).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: "Create project", exact: true })).toBeVisible();
|
await expect(page.getByRole("button", { name: "Create project", exact: true })).toBeVisible();
|
||||||
await expect(page.getByTestId("side-panel")).not.toHaveAttribute("data-panel", "create-group");
|
await expect(page.getByTestId("side-panel")).not.toHaveAttribute("data-panel", "create-group");
|
||||||
await expect(page.getByText("New group", { exact: true })).toHaveCount(0);
|
await expect(page.getByText("New group", { exact: true })).toHaveCount(0);
|
||||||
|
|
||||||
|
const dialog = page.getByRole("dialog", { name: "New project" });
|
||||||
|
await dialog.getByLabel("Name").fill("Customer project");
|
||||||
|
await dialog.getByRole("button", { name: "Create project", exact: true }).click();
|
||||||
|
await expect(page).not.toHaveURL(/\/onboarding/);
|
||||||
|
await page.waitForURL(/\/app/);
|
||||||
|
await expect(sidebar.getByText("Customer project", { exact: true })).toBeVisible({
|
||||||
|
timeout: 15_000,
|
||||||
|
});
|
||||||
|
await expect(
|
||||||
|
page.locator("main").getByRole("button", { name: "Create new Bot", exact: true }),
|
||||||
|
).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("spaces stay invisible by default and chat creation requires approval", async ({
|
test("spaces stay invisible by default and chat creation requires approval", async ({
|
||||||
|
|||||||
@ -4793,12 +4793,14 @@ export function ShellPage() {
|
|||||||
onCancel={() => setNewSpaceOpen(false)}
|
onCancel={() => setNewSpaceOpen(false)}
|
||||||
onConfirm={async (name) => {
|
onConfirm={async (name) => {
|
||||||
const space = await rpc.spaces.create({ name });
|
const space = await rpc.spaces.create({ name });
|
||||||
|
setNewSpaceOpen(false);
|
||||||
if (!selectSpace(space.id)) {
|
if (!selectSpace(space.id)) {
|
||||||
setNewSpaceOpen(false);
|
|
||||||
await refreshBots();
|
await refreshBots();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.location.assign("/onboarding");
|
window.location.assign(
|
||||||
|
newSpaceDialogVariant === "project" ? "/app" : "/onboarding",
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user