-
Notifications
You must be signed in to change notification settings - Fork 172
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
UX: The username suggestion is invalid #73
Comments
also, "[...] dots and dashes and numbers" shuold be "[...] dots, dashes and numbers" |
I would like to take this one. |
The PR didn't fix the issue. The placeholder problem is still present. |
I think the problem is not only about the tooltip or the placeholder: 1st issue: The place holder "Jane Doe" is an invalid username. Consider using a valid one like: Frontend: if (
!username.match(/^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$/)) {
setUsernameError(`user can only contain lowercase letters, dots, dashes and numbers`)
return false
} Backend: const validUsernameRegex = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
var invalidUsernameError = `username must be DNS-1123 compliant, it must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'gino.mycompany', regex used for validation is ` + validUsernameRegex
func isValidUsername(username string) (valid bool) {
re := regexp.MustCompile(validUsernameRegex)
return re.MatchString(username)
} We must align these patterns |
When creating a new user in Permission Manager, the username field suggests as an example
Jane Doe
, but if you write that you get an error message saying that the username is not valid:The text was updated successfully, but these errors were encountered: