diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx index 9c29ea0d1..b1b30fd79 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx @@ -1,9 +1,8 @@ -import { PlusIcon, PlusSmallIcon } from "@heroicons/react/20/solid"; +import { ClockIcon, LockOpenIcon, PlusIcon, RectangleGroupIcon } from "@heroicons/react/20/solid"; import { BookOpenIcon } from "@heroicons/react/24/solid"; import { Outlet, useLocation, useParams } from "@remix-run/react"; import { LoaderFunctionArgs } from "@remix-run/server-runtime"; import { typedjson, useTypedLoaderData } from "remix-typedjson"; -import { BlankstateInstructions } from "~/components/BlankstateInstructions"; import { Feedback } from "~/components/Feedback"; import { AdminDebugTooltip } from "~/components/admin/debugTooltip"; import { InlineCode } from "~/components/code/InlineCode"; @@ -19,6 +18,8 @@ import { DialogHeader, DialogTrigger, } from "~/components/primitives/Dialog"; +import { Header3 } from "~/components/primitives/Headers"; +import { InfoPanel } from "~/components/primitives/InfoPanel"; import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader"; import { PaginationControls } from "~/components/primitives/Pagination"; import { Paragraph } from "~/components/primitives/Paragraph"; @@ -52,9 +53,11 @@ import { requireUserId } from "~/services/session.server"; import { ProjectParamSchema, docsPath, + v3BillingPath, v3NewSchedulePath, v3SchedulePath, } from "~/utils/pathBuilder"; +import { useCurrentPlan } from "../_app.orgs.$organizationSlug/route"; export const loader = async ({ request, params }: LoaderFunctionArgs) => { const userId = await requireUserId(request); @@ -96,6 +99,14 @@ export default function Page() { const project = useProject(); const pathName = usePathName(); + const plan = useCurrentPlan(); + const requiresUpgrade = + plan?.v3Subscription?.plan && + limits.used > plan.v3Subscription.plan.limits.schedules.number && + !plan.v3Subscription.plan.limits.schedules.canExceed; + const canUpgrade = + plan?.v3Subscription?.plan && !plan.v3Subscription.plan.limits.schedules.canExceed; + const { scheduleParam } = useParams(); const isShowingNewPane = pathName.endsWith("/new"); const isShowingSchedule = !!scheduleParam; @@ -180,22 +191,54 @@ export default function Page() { -
- - = limits.limit ? "text-warning" : ""}> - You've used {limits.used}/{limits.limit} of your schedules. - {" "} - - Request more - - } - defaultValue="help" - /> - . - - +
+ {requiresUpgrade ? ( + + + You've used all {limits.limit} of your available schedules. Upgrade your + plan to enable more. + + + ) : ( +
+
+ {requiresUpgrade ? ( + + You've used {limits.used}/{limits.limit} of your schedules. + + ) : ( + + You've used all {limits.limit} of your available schedules. + + )} + + {canUpgrade ? ( + + Upgrade + + ) : ( + Request more} + defaultValue="help" + /> + )} +
+
+
+
+
+ )} +
)} @@ -216,21 +259,20 @@ export default function Page() { function CreateScheduledTaskInstructions() { return ( - - - - You have no scheduled tasks in your project. Before you can schedule a task you need to a{" "} - schedules.task. + + + + You have no scheduled tasks in your project. Before you can schedule a task you need to + create a schedules.task. - - Create scheduled task docs - - + ); } @@ -241,9 +283,14 @@ function AttachYourFirstScheduleInstructions() { const location = useLocation(); return ( - - - + + + Scheduled tasks will only run automatically if you connect a schedule to them, you can do this in the dashboard or using the SDK. @@ -251,10 +298,10 @@ function AttachYourFirstScheduleInstructions() { - Create in the dashboard + Use the dashboard
- + ); }