Skip to content

Commit 35b9b34

Browse files
committed
Removed old v2 paths
1 parent 4266b78 commit 35b9b34

File tree

8 files changed

+52
-432
lines changed

8 files changed

+52
-432
lines changed

apps/webapp/app/components/ErrorDisplay.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { LinkButton } from "./primitives/Buttons";
66
import { Header1 } from "./primitives/Headers";
77
import { Paragraph } from "./primitives/Paragraph";
88
import Spline from "@splinetool/react-spline";
9+
import { ReactNode } from "react";
910

1011
type ErrorDisplayOptions = {
1112
button?: {
@@ -38,7 +39,7 @@ export function RouteErrorDisplay(options?: ErrorDisplayOptions) {
3839

3940
type DisplayOptionsProps = {
4041
title: string;
41-
message?: string;
42+
message?: ReactNode;
4243
} & ErrorDisplayOptions;
4344

4445
export function ErrorDisplay({ title, message, button }: DisplayOptionsProps) {

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

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ClockIcon,
88
Cog8ToothIcon,
99
CreditCardIcon,
10-
CursorArrowRaysIcon,
1110
FolderIcon,
1211
IdentificationIcon,
1312
KeyIcon,
@@ -20,6 +19,7 @@ import {
2019
import { UserGroupIcon, UserPlusIcon } from "@heroicons/react/24/solid";
2120
import { useNavigation } from "@remix-run/react";
2221
import { Fragment, ReactNode, useEffect, useRef, useState } from "react";
22+
import { RunsIcon } from "~/assets/icons/RunsIcon";
2323
import { TaskIcon } from "~/assets/icons/TaskIcon";
2424
import { useFeatures } from "~/hooks/useFeatures";
2525
import { type MatchedOrganization } from "~/hooks/useOrganizations";
@@ -34,20 +34,10 @@ import {
3434
logoutPath,
3535
newOrganizationPath,
3636
newProjectPath,
37-
organizationBillingPath,
38-
organizationIntegrationsPath,
3937
organizationPath,
4038
organizationSettingsPath,
4139
organizationTeamPath,
4240
personalAccessTokensPath,
43-
projectEnvironmentsPath,
44-
projectEventsPath,
45-
projectHttpEndpointsPath,
46-
projectPath,
47-
projectRunsPath,
48-
projectSettingsPath,
49-
projectSetupPath,
50-
projectTriggersPath,
5141
v3ApiKeysPath,
5242
v3BatchesPath,
5343
v3BillingPath,
@@ -65,10 +55,7 @@ import {
6555
import { ImpersonationBanner } from "../ImpersonationBanner";
6656
import { LogoIcon } from "../LogoIcon";
6757
import { UserProfilePhoto } from "../UserProfilePhoto";
68-
import { Badge } from "../primitives/Badge";
69-
import { LinkButton } from "../primitives/Buttons";
70-
import { Header2 } from "../primitives/Headers";
71-
import { Paragraph } from "../primitives/Paragraph";
58+
import { FreePlanUsage } from "../billing/FreePlanUsage";
7259
import {
7360
Popover,
7461
PopoverArrowTrigger,
@@ -77,12 +64,9 @@ import {
7764
PopoverMenuItem,
7865
PopoverSectionHeader,
7966
} from "../primitives/Popover";
80-
import { TextLink } from "../primitives/TextLink";
8167
import { HelpAndFeedback } from "./HelpAndFeedbackPopover";
8268
import { SideMenuHeader } from "./SideMenuHeader";
8369
import { SideMenuItem } from "./SideMenuItem";
84-
import { FreePlanUsage } from "../billing/FreePlanUsage";
85-
import { RunsIcon } from "~/assets/icons/RunsIcon";
8670

8771
type SideMenuUser = Pick<User, "email" | "admin"> & { isImpersonating: boolean };
8872
type SideMenuProject = Pick<MatchedProject, "id" | "name" | "slug" | "version">;
@@ -250,7 +234,7 @@ function ProjectSelector({
250234
return (
251235
<PopoverMenuItem
252236
key={p.id}
253-
to={projectPath(organization, p)}
237+
to={v3ProjectPath(organization, p)}
254238
title={
255239
<div className="flex w-full items-center justify-between text-text-bright">
256240
<span className="grow truncate text-left">{p.name}</span>

apps/webapp/app/routes/_app._index/route.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { prisma } from "~/db.server";
33
import { getUsersInvites } from "~/models/member.server";
44
import { SelectBestProjectPresenter } from "~/presenters/SelectBestProjectPresenter.server";
55
import { requireUser } from "~/services/session.server";
6-
import { invitesPath, newOrganizationPath, newProjectPath, projectPath } from "~/utils/pathBuilder";
6+
import {
7+
invitesPath,
8+
newOrganizationPath,
9+
newProjectPath,
10+
v3ProjectPath,
11+
} from "~/utils/pathBuilder";
712

813
//this loader chooses the best project to redirect you to, ideally based on the cookie
914
export const loader = async ({ request }: LoaderFunctionArgs) => {
@@ -19,7 +24,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
1924
try {
2025
const { project, organization } = await presenter.call({ userId: user.id, request });
2126
//redirect them to the most appropriate project
22-
return redirect(projectPath(organization, project));
27+
return redirect(v3ProjectPath(organization, project));
2328
} catch (e) {
2429
const organization = await prisma.organization.findFirst({
2530
where: {

apps/webapp/app/routes/_app.orgs.$organizationSlug._index/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Header3 } from "~/components/primitives/Headers";
77
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
88
import { Paragraph } from "~/components/primitives/Paragraph";
99
import { useOrganization } from "~/hooks/useOrganizations";
10-
import { newProjectPath, projectPath } from "~/utils/pathBuilder";
10+
import { newProjectPath, v3ProjectPath } from "~/utils/pathBuilder";
1111

1212
export const meta: MetaFunction = () => {
1313
return [
@@ -45,7 +45,7 @@ export default function Page() {
4545
<li key={project.id}>
4646
<Link
4747
className="border-grid-bright-dimmed flex gap-4 rounded-md border p-4 transition hover:bg-charcoal-900 "
48-
to={projectPath(organization, project)}
48+
to={v3ProjectPath(organization, project)}
4949
>
5050
<FolderIcon className="h-10 w-10 flex-none text-indigo-600" />
5151
<div className="flex flex-col">

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam/route.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Outlet } from "@remix-run/react";
2-
import { LoaderFunctionArgs } from "@remix-run/server-runtime";
3-
import { redirect } from "remix-typedjson";
4-
import { RouteErrorDisplay } from "~/components/ErrorDisplay";
2+
import { json, LoaderFunctionArgs } from "@remix-run/server-runtime";
3+
import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
4+
import { ErrorDisplay, RouteErrorDisplay } from "~/components/ErrorDisplay";
5+
import { TextLink } from "~/components/primitives/TextLink";
56
import { prisma } from "~/db.server";
67
import { useOrganization } from "~/hooks/useOrganizations";
78
import { useProject } from "~/hooks/useProject";
89
import { Handle } from "~/utils/handle";
9-
import { ProjectParamSchema, projectPath, v3ProjectPath } from "~/utils/pathBuilder";
10+
import { ProjectParamSchema, v3ProjectPath } from "~/utils/pathBuilder";
1011

1112
export const loader = async ({ params }: LoaderFunctionArgs) => {
1213
const { organizationSlug, projectParam } = ProjectParamSchema.parse(params);
@@ -20,11 +21,9 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
2021
throw new Response("Project not found", { status: 404, statusText: "Project not found" });
2122
}
2223

23-
if (project.version === "V2") {
24-
return redirect(projectPath({ slug: organizationSlug }, { slug: projectParam }));
25-
}
26-
27-
return null;
24+
return typedjson({
25+
version: project.version,
26+
});
2827
};
2928

3029
export const handle: Handle = {
@@ -37,6 +36,25 @@ export const handle: Handle = {
3736
};
3837

3938
export default function Project() {
39+
const { version } = useTypedLoaderData<typeof loader>();
40+
41+
if (version === "V2") {
42+
return (
43+
<ErrorDisplay
44+
title="Version 2 projects are no longer available"
45+
message={
46+
<>
47+
This project is v2, which was deprecated on Jan 31 2025 after{" "}
48+
<TextLink to="https://trigger.dev/blog/v2-end-of-life-announcement">
49+
our announcement in August 2024
50+
</TextLink>
51+
.
52+
</>
53+
}
54+
/>
55+
);
56+
}
57+
4058
return (
4159
<>
4260
<Outlet />

apps/webapp/app/routes/_app.orgs.$organizationSlug_.projects.new/route.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { conform, useForm } from "@conform-to/react";
22
import { parse } from "@conform-to/zod";
3+
import { FolderIcon } from "@heroicons/react/20/solid";
34
import type { ActionFunction, LoaderFunctionArgs } from "@remix-run/node";
45
import { json } from "@remix-run/node";
56
import { Form, useActionData, useNavigation } from "@remix-run/react";
@@ -27,7 +28,7 @@ import { requireUserId } from "~/services/session.server";
2728
import {
2829
OrganizationParamsSchema,
2930
organizationPath,
30-
projectPath,
31+
v3ProjectPath,
3132
selectPlanPath,
3233
} from "~/utils/pathBuilder";
3334

@@ -110,7 +111,7 @@ export const action: ActionFunction = async ({ request, params }) => {
110111
});
111112

112113
return redirectWithSuccessMessage(
113-
projectPath(project.organization, project),
114+
v3ProjectPath(project.organization, project),
114115
request,
115116
`${submission.value.projectName} created`
116117
);
@@ -143,7 +144,7 @@ export default function Page() {
143144
<MainCenteredContainer>
144145
<div>
145146
<FormTitle
146-
LeadingIcon="folder"
147+
LeadingIcon={<FolderIcon className="size-7 text-indigo-500" />}
147148
title="Create a new project"
148149
description={`This will create a new project in your "${organization.title}" organization.`}
149150
/>

apps/webapp/app/routes/resources.$organizationSlug.subscription.v3.portal.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { prisma } from "~/db.server";
44
import { redirectWithErrorMessage } from "~/models/message.server";
55
import { customerPortalUrl } from "~/services/platform.v3.server";
66
import { requireUserId } from "~/services/session.server";
7-
import { OrganizationParamsSchema, usagePath } from "~/utils/pathBuilder";
7+
import { OrganizationParamsSchema, v3BillingPath } from "~/utils/pathBuilder";
88

99
export async function loader({ request, params }: ActionFunctionArgs) {
1010
const userId = await requireUserId(request);
@@ -26,7 +26,7 @@ export async function loader({ request, params }: ActionFunctionArgs) {
2626

2727
if (!org) {
2828
return redirectWithErrorMessage(
29-
usagePath({ slug: organizationSlug }),
29+
v3BillingPath({ slug: organizationSlug }),
3030
request,
3131
"Something went wrong. Please try again later."
3232
);
@@ -35,7 +35,7 @@ export async function loader({ request, params }: ActionFunctionArgs) {
3535
const result = await customerPortalUrl(org.id, organizationSlug);
3636
if (!result || !result.success || !result.customerPortalUrl) {
3737
return redirectWithErrorMessage(
38-
usagePath({ slug: organizationSlug }),
38+
v3BillingPath({ slug: organizationSlug }),
3939
request,
4040
"Something went wrong. Please try again later."
4141
);

0 commit comments

Comments
 (0)