diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx index 5a971802a..45acef278 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx @@ -55,10 +55,8 @@ import { OutOfEntitlementError } from "~/v3/services/triggerTask.server"; import { TestTaskData } from "~/v3/testTask"; //TODO: -// Test page to default to using the most recent payload. -// 1. Pass the footer into both standard and scheduled forms just like the ReplayRunDialog so it's consistent. -// 2. Get rid of the extra form in the ReplayRunDialog. -// 3. If the editablePayload is false on ReplayRunDialog, show a callout error explaining that the payload is not editable. +// 1. Get rid of the extra form in the ReplayRunDialog. +// 2. If the editablePayload is false on ReplayRunDialog, show a callout error explaining that the payload is not editable. export const loader = async ({ request, params }: LoaderFunctionArgs) => { const userId = await requireUserId(request); @@ -162,14 +160,20 @@ export const action: ActionFunction = async ({ request, params }) => { export default function Page() { const result = useTypedLoaderData(); - + const environment = useEnvironment(); if (!result.foundTask) { return
; } switch (result.task.triggerSource) { case "STANDARD": { - return ; + return ( + } + /> + ); } case "SCHEDULED": { return ( @@ -177,6 +181,7 @@ export default function Page() { task={result.task.task} runs={result.task.runs} possibleTimezones={result.task.possibleTimezones} + footer={} /> ); } @@ -344,24 +349,7 @@ export function StandardTaskForm({ task, runs, footer, className }: StandardTask /> - {footer ?? ( -
-
- - This test will run in - - -
- -
- )} + {footer} ); } @@ -371,11 +359,13 @@ export function ScheduledTaskForm({ runs, possibleTimezones, footer, + className, }: { task: TestTask["task"]; runs: ScheduledRun[]; possibleTimezones: string[]; footer?: React.ReactNode; + className?: string; }) { const environment = useEnvironment(); const lastSubmission = useActionData(); @@ -436,7 +426,7 @@ export function ScheduledTaskForm({ {...conform.input(environmentId, { type: "hidden" })} value={environment.id} /> - +
@@ -548,24 +538,7 @@ export function ScheduledTaskForm({ /> - {footer ?? ( -
-
- - This test will run in - - -
- -
- )} + {footer} ); } @@ -628,3 +601,24 @@ function RecentPayloads({
); } + +function TestTaskFormFooter({ environment }: { environment: any }) { + return ( +
+
+ + This test will run in + + +
+ +
+ ); +}