Show callout if the payload isn’t editable

This commit is contained in:
James Ritchie
2025-05-06 14:05:42 +01:00
parent eda5d16489
commit 370ec10122
2 changed files with 8 additions and 2 deletions
@@ -17,6 +17,7 @@ import {
} from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route";
import { type loader } from "~/routes/resources.taskruns.$runParam.replay";
import type { RuntimeEnvironment } from "~/models/runtimeEnvironment.server";
import { Callout } from "~/components/primitives/Callout";
type ReplayRunDialogProps = {
runFriendlyId: string;
@@ -143,7 +144,13 @@ function ReplayForm(
) : null}
</div>
</>
) : null}
) : (
<div className="grid h-full place-items-center">
<Callout variant="error" className="mt-4 w-fit">
<Paragraph>This payload is not editable.</Paragraph>
</Callout>
</div>
)}
<input type="hidden" name="failedRedirect" value={props.failedRedirect} />
</Form>
);
@@ -56,7 +56,6 @@ import { TestTaskData } from "~/v3/testTask";
//TODO:
// 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);