Skip to content

Commit f670559

Browse files
authored
fix: change validation error for workspace name (#16643)
Fixes: #14824
1 parent b07b33e commit f670559

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

site/src/utils/formUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const Language = {
1212
nameRequired: (name: string): string => {
1313
return name ? `Please enter a ${name.toLowerCase()}.` : "Required";
1414
},
15-
nameInvalidChars: (name: string): string => {
16-
return `${name} must start with a-Z or 0-9 and can contain a-Z, 0-9 or -`;
15+
nameInvalidChars: (): string => {
16+
return "Special characters (e.g.: !, @, #) are not supported";
1717
},
1818
nameTooLong: (name: string, len: number): string => {
1919
return `${name} cannot be longer than ${len} characters`;
@@ -119,7 +119,7 @@ const displayNameRE = /^[^\s](.*[^\s])?$/;
119119
export const nameValidator = (name: string): Yup.StringSchema =>
120120
Yup.string()
121121
.required(Language.nameRequired(name))
122-
.matches(usernameRE, Language.nameInvalidChars(name))
122+
.matches(usernameRE, Language.nameInvalidChars())
123123
.max(maxLenName, Language.nameTooLong(name, maxLenName));
124124

125125
export const displayNameValidator = (displayName: string): Yup.StringSchema =>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy