Skip to content

Commit 4a81e82

Browse files
committed
Validate template label length
1 parent 3646f8c commit 4a81e82

File tree

2 files changed

+7
-3
lines changed
  • apps/webapp/app

2 files changed

+7
-3
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.tasks.$taskParam/route.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,8 +1614,12 @@ function CreateTemplateModal({
16141614
</Paragraph>
16151615
<Fieldset className="max-w-full gap-y-3">
16161616
<InputGroup className="max-w-full">
1617-
<Label>Template label</Label>
1618-
<Input {...conform.input(label)} placeholder="Enter a name for this template" />
1617+
<Label htmlFor={label.id}>Template label</Label>
1618+
<Input
1619+
{...conform.input(label)}
1620+
placeholder="Enter a name for this template"
1621+
maxLength={42}
1622+
/>
16191623
<FormError id={label.errorId}>{label.error}</FormError>
16201624
</InputGroup>
16211625
<FormError>{form.error}</FormError>

apps/webapp/app/v3/taskRunTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TestTaskData } from "./testTask";
33

44
export const RunTemplateData = TestTaskData.and(
55
z.object({
6-
label: z.string(),
6+
label: z.string().max(42, "Labels can be at most 42 characters long"),
77
})
88
);
99

0 commit comments

Comments
 (0)