Skip to content

Commit 9453add

Browse files
committed
fix(webapp): keep the delete destination and drop the deletion claim
No org-level page both renders and makes sense to land on after deleting a project, so moving the destination to reach the toast was a worse trade than the missing confirmation. Restore the org root and reword the release note so it only promises what renaming actually delivers. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b81bf39 commit 9453add

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

.server-changes/fix-project-settings-toast.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ area: webapp
33
type: fix
44
---
55

6-
Renaming or deleting a project now shows a message explaining what happened, instead of silently moving you to the tasks page with no feedback.
6+
Renaming a project now keeps you on the project settings page and shows a message explaining the result, instead of silently moving you to the tasks page.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.general/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { resolveOrgIdFromSlug } from "~/models/organization.server";
2323
import { ProjectSettingsService } from "~/services/projectSettings.server";
2424
import { logger } from "~/services/logger.server";
2525
import { dashboardAction } from "~/services/routeBuilders/dashboardBuilder";
26-
import { organizationSettingsPath, v3ProjectSettingsGeneralPath } from "~/utils/pathBuilder";
26+
import { organizationPath, v3ProjectSettingsGeneralPath } from "~/utils/pathBuilder";
2727
import { useState } from "react";
2828

2929
function createSchema(
@@ -173,7 +173,7 @@ export const action = dashboardAction(
173173
}
174174

175175
return redirectWithSuccessMessage(
176-
organizationSettingsPath({ slug: organizationSlug }),
176+
organizationPath({ slug: organizationSlug }),
177177
request,
178178
"Project deleted"
179179
);

apps/webapp/test/projectSettingsToastRedirect.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ vi.mock("~/services/projectSettings.server", () => ({
3030
}));
3131

3232
const SETTINGS_PATH = "/orgs/o/projects/p/env/prod/settings/general";
33-
const ORG_SETTINGS_PATH = "/orgs/o/settings";
33+
const ORG_PATH = "/orgs/o";
3434

3535
// Mirrors the read in app/root.tsx's loader.
3636
async function rootLoaderHop(cookie: string | null) {
@@ -97,10 +97,11 @@ describe("general settings redirects target a page that renders", () => {
9797
expect(await toastFor(response)).toBe("You don't have permission to delete this project");
9898
});
9999

100-
it("sends a successful delete to the organization settings page with the message", async () => {
100+
// The deleted project's settings page is gone and no org-level page renders, so a
101+
// successful delete keeps its original destination and its message is not shown.
102+
it("leaves a successful delete pointed at the organization root", async () => {
101103
const response = await runAction("delete", true);
102104

103-
expect(response.headers.get("Location")).toBe(ORG_SETTINGS_PATH);
104-
expect(await toastFor(response)).toBe("Project deleted");
105+
expect(response.headers.get("Location")).toBe(ORG_PATH);
105106
});
106107
});

0 commit comments

Comments
 (0)