Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { type MatchedOrganization } from "~/hooks/useOrganizations";
import { cn } from "~/utils/cn";
import {
organizationPath,
organizationProjectsPath,
organizationRolesPath,
organizationRuntimeUpdatesPath,
organizationSettingsPath,
organizationSlackIntegrationPath,
organizationSsoPath,
Expand Down Expand Up @@ -136,8 +136,8 @@ export function OrganizationSettingsSideMenu({
icon={FolderOpenIcon}
activeIconColor="text-text-bright"
inactiveIconColor="text-text-dimmed"
to={organizationRuntimeUpdatesPath(organization)}
data-action="runtime-updates"
to={organizationProjectsPath(organization)}
data-action="projects"
badge={
hasProjectRuntimeUpdate ? (
<>
Expand Down
10 changes: 5 additions & 5 deletions apps/webapp/app/routes/[_].$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
invitesPath,
newOrganizationPath,
newProjectPath,
organizationRuntimeUpdatesPath,
organizationProjectsPath,
v3EnvironmentPath,
} from "~/utils/pathBuilder";

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

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

if (organization) {
if (organizationPage === "runtime-updates") {
return redirect(`${organizationRuntimeUpdatesPath(organization)}${search}`);
if (organizationPage === "projects") {
return redirect(`${organizationProjectsPath(organization)}${search}`);
}

return redirect(newProjectPath(organization));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type ProjectRuntimeRow = {
} | null;
};

export function RuntimeUpdatesPage({
export function ProjectsPage({
organizationSlug,
needsUpdate,
otherProjects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { dashboardLoader } from "~/services/routeBuilders/dashboardBuilder";
import { getUserId } from "~/services/session.server";
import { pageMeta } from "~/utils/pageTitle";
import { OrganizationParamsSchema } from "~/utils/pathBuilder";
import { type ProjectRuntimeRow, RuntimeUpdatesPage } from "./RuntimeUpdatesPage";
import { type ProjectRuntimeRow, ProjectsPage } from "./ProjectsPage";

export const meta = pageMeta("Projects");

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

return (
<RuntimeUpdatesPage
<ProjectsPage
organizationSlug={organizationSlug}
needsUpdate={needsUpdate}
otherProjects={otherProjects}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { redirect, type LoaderFunctionArgs } from "@remix-run/server-runtime";
import { OrganizationParamsSchema, organizationProjectsPath } from "~/utils/pathBuilder";

// The Projects settings page used to live at `/settings/runtime-updates`. Keep the old URL working
// for links that were already shared.
export const loader = async ({ params, request }: LoaderFunctionArgs) => {
const { organizationSlug } = OrganizationParamsSchema.parse(params);
const { search } = new URL(request.url);
return redirect(`${organizationProjectsPath({ slug: organizationSlug })}${search}`);
};
Comment thread
carderne marked this conversation as resolved.
14 changes: 10 additions & 4 deletions apps/webapp/app/utils/deeplinkPages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ describe("resolveDeeplinkPage", () => {
});

it("resolves organization-level pages separately from environment pages", () => {
expect(ORG_PAGE_TARGETS.get("runtime-updates")).toEqual({
landing: "runtime-updates",
prefix: "runtime-updates",
expect(ORG_PAGE_TARGETS.get("projects")).toEqual({
landing: "projects",
prefix: "projects",
});
expect(resolveOrganizationDeeplinkPage("runtime-updates")).toBe("runtime-updates");
expect(resolveOrganizationDeeplinkPage("projects")).toBe("projects");
expect(resolveDeeplinkPage("projects")).toBeUndefined();
});

it("does not carry a runtime-updates alias", () => {
expect(ORG_PAGE_TARGETS.has("runtime-updates")).toBe(false);
expect(resolveOrganizationDeeplinkPage("runtime-updates")).toBeUndefined();
expect(resolveDeeplinkPage("runtime-updates")).toBeUndefined();
});

Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/utils/deeplinkPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ENV_PAGE_TARGETS: ReadonlyMap<string, DeeplinkTarget> = new Map([
]);

export const ORG_PAGE_TARGETS: ReadonlyMap<string, DeeplinkTarget> = new Map([
["runtime-updates", page("runtime-updates")],
["projects", page("projects")],
]);
Comment thread
claude[bot] marked this conversation as resolved.

export const DEEPLINK_PATH_PREFIX = "/_";
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/app/utils/pathBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export function organizationSettingsPath(organization: OrgForPath) {
return `${organizationPath(organization)}/settings`;
}

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

function organizationIntegrationsPath(organization: OrgForPath) {
Expand Down