Skip to content

Commit

Permalink
chore: Bump extra long text input limit to 750 characters (#3299)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Jun 19, 2024
1 parent ce69e5a commit b5493f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/TextInput/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const TextInputComponent: React.FC<Props> = (props) => {
{ id: "default", title: "Default" },
{ id: "short", title: "Short (max 120 characters)" },
{ id: "long", title: "Long (max 250 characters)" },
{ id: "extraLong", title: "Extra long (max 500 characters)" },
{ id: "extraLong", title: "Extra long (max 750 characters)" },
{ id: "email", title: "Email" },
{ id: "phone", title: "Phone" },
].map((type) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const EmptyFormLongText: StoryObj = {
export const EmptyFormExtraLongText: StoryObj = {
args: {
title: "Describe your project",
description: "Be as descriptive as you can. You have 500 characters.",
description: "Be as descriptive as you can. You have 750 characters.",
type: TextInputType.ExtraLong,
},
};
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/@planx/components/TextInput/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const userDataSchema = ({ type }: TextInput): SchemaOf<UserData> =>
return "Your answer must be 250 characters or fewer.";
}
if (type === TextInputType.ExtraLong) {
return "Your answer must be 500 characters or fewer.";
return "Your answer must be 750 characters or fewer.";
}
if (type === TextInputType.Email) {
return "Enter an email address in the correct format, like [email protected]";
Expand All @@ -52,7 +52,7 @@ export const userDataSchema = ({ type }: TextInput): SchemaOf<UserData> =>
return Boolean(value && value.length <= 250);
}
if (type === TextInputType.ExtraLong) {
return Boolean(value && value.length <= 500);
return Boolean(value && value.length <= 750);
}
if (type === TextInputType.Email) {
return Boolean(value && emailRegex.test(value));
Expand Down

0 comments on commit b5493f1

Please sign in to comment.