Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump extra long text input limit to 750 characters #3299

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading