Skip to content

Commit 19eae51

Browse files
authored
fix: rename the Projects org settings URL to /settings/projects (#4739)
1 parent 4392e79 commit 19eae51

8 files changed

Lines changed: 34 additions & 18 deletions

File tree

apps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { type MatchedOrganization } from "~/hooks/useOrganizations";
1616
import { cn } from "~/utils/cn";
1717
import {
1818
organizationPath,
19+
organizationProjectsPath,
1920
organizationRolesPath,
20-
organizationRuntimeUpdatesPath,
2121
organizationSettingsPath,
2222
organizationSlackIntegrationPath,
2323
organizationSsoPath,
@@ -136,8 +136,8 @@ export function OrganizationSettingsSideMenu({
136136
icon={FolderOpenIcon}
137137
activeIconColor="text-text-bright"
138138
inactiveIconColor="text-text-dimmed"
139-
to={organizationRuntimeUpdatesPath(organization)}
140-
data-action="runtime-updates"
139+
to={organizationProjectsPath(organization)}
140+
data-action="projects"
141141
badge={
142142
hasProjectRuntimeUpdate ? (
143143
<>

apps/webapp/app/routes/[_].$.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
invitesPath,
1313
newOrganizationPath,
1414
newProjectPath,
15-
organizationRuntimeUpdatesPath,
15+
organizationProjectsPath,
1616
v3EnvironmentPath,
1717
} from "~/utils/pathBuilder";
1818

@@ -33,8 +33,8 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
3333
const presenter = new SelectBestEnvironmentPresenter();
3434
try {
3535
const { project, organization, environment } = await presenter.call({ user });
36-
if (organizationPage === "runtime-updates") {
37-
return redirect(`${organizationRuntimeUpdatesPath(organization)}${search}`);
36+
if (organizationPage === "projects") {
37+
return redirect(`${organizationProjectsPath(organization)}${search}`);
3838
}
3939

4040
const environmentPath = v3EnvironmentPath(organization, project, environment);
@@ -57,8 +57,8 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
5757
});
5858

5959
if (organization) {
60-
if (organizationPage === "runtime-updates") {
61-
return redirect(`${organizationRuntimeUpdatesPath(organization)}${search}`);
60+
if (organizationPage === "projects") {
61+
return redirect(`${organizationProjectsPath(organization)}${search}`);
6262
}
6363

6464
return redirect(newProjectPath(organization));

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.runtime-updates/RuntimeUpdatesPage.tsx renamed to apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.projects/ProjectsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type ProjectRuntimeRow = {
4242
} | null;
4343
};
4444

45-
export function RuntimeUpdatesPage({
45+
export function ProjectsPage({
4646
organizationSlug,
4747
needsUpdate,
4848
otherProjects,

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.runtime-updates/route.tsx renamed to apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.projects/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { dashboardLoader } from "~/services/routeBuilders/dashboardBuilder";
66
import { getUserId } from "~/services/session.server";
77
import { pageMeta } from "~/utils/pageTitle";
88
import { OrganizationParamsSchema } from "~/utils/pathBuilder";
9-
import { type ProjectRuntimeRow, RuntimeUpdatesPage } from "./RuntimeUpdatesPage";
9+
import { type ProjectRuntimeRow, ProjectsPage } from "./ProjectsPage";
1010

1111
export const meta = pageMeta("Projects");
1212

@@ -73,7 +73,7 @@ export default function Page() {
7373
const { organizationSlug, needsUpdate, otherProjects } = useTypedLoaderData<typeof loader>();
7474

7575
return (
76-
<RuntimeUpdatesPage
76+
<ProjectsPage
7777
organizationSlug={organizationSlug}
7878
needsUpdate={needsUpdate}
7979
otherProjects={otherProjects}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { redirect, type LoaderFunctionArgs } from "@remix-run/server-runtime";
2+
import { OrganizationParamsSchema, organizationProjectsPath } from "~/utils/pathBuilder";
3+
4+
// The Projects settings page used to live at `/settings/runtime-updates`. Keep the old URL working
5+
// for links that were already shared.
6+
export const loader = async ({ params, request }: LoaderFunctionArgs) => {
7+
const { organizationSlug } = OrganizationParamsSchema.parse(params);
8+
const { search } = new URL(request.url);
9+
return redirect(`${organizationProjectsPath({ slug: organizationSlug })}${search}`);
10+
};

apps/webapp/app/utils/deeplinkPages.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,17 @@ describe("resolveDeeplinkPage", () => {
164164
});
165165

166166
it("resolves organization-level pages separately from environment pages", () => {
167-
expect(ORG_PAGE_TARGETS.get("runtime-updates")).toEqual({
168-
landing: "runtime-updates",
169-
prefix: "runtime-updates",
167+
expect(ORG_PAGE_TARGETS.get("projects")).toEqual({
168+
landing: "projects",
169+
prefix: "projects",
170170
});
171-
expect(resolveOrganizationDeeplinkPage("runtime-updates")).toBe("runtime-updates");
171+
expect(resolveOrganizationDeeplinkPage("projects")).toBe("projects");
172+
expect(resolveDeeplinkPage("projects")).toBeUndefined();
173+
});
174+
175+
it("does not carry a runtime-updates alias", () => {
176+
expect(ORG_PAGE_TARGETS.has("runtime-updates")).toBe(false);
177+
expect(resolveOrganizationDeeplinkPage("runtime-updates")).toBeUndefined();
172178
expect(resolveDeeplinkPage("runtime-updates")).toBeUndefined();
173179
});
174180

apps/webapp/app/utils/deeplinkPages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const ENV_PAGE_TARGETS: ReadonlyMap<string, DeeplinkTarget> = new Map([
3939
]);
4040

4141
export const ORG_PAGE_TARGETS: ReadonlyMap<string, DeeplinkTarget> = new Map([
42-
["runtime-updates", page("runtime-updates")],
42+
["projects", page("projects")],
4343
]);
4444

4545
export const DEEPLINK_PATH_PREFIX = "/_";

apps/webapp/app/utils/pathBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export function organizationSettingsPath(organization: OrgForPath) {
170170
return `${organizationPath(organization)}/settings`;
171171
}
172172

173-
export function organizationRuntimeUpdatesPath(organization: OrgForPath) {
174-
return `${organizationSettingsPath(organization)}/runtime-updates`;
173+
export function organizationProjectsPath(organization: OrgForPath) {
174+
return `${organizationSettingsPath(organization)}/projects`;
175175
}
176176

177177
function organizationIntegrationsPath(organization: OrgForPath) {

0 commit comments

Comments
 (0)