refactor: form binding validation (#38832)

Make "form-fetch-action" highlight the invalid field as "error"
This commit is contained in:
wxiaoguang
2026-08-10 09:25:31 +08:00
committed by GitHub
parent b5aa8c4ff0
commit 9c915e4e1a
27 changed files with 411 additions and 323 deletions
+18 -19
View File
@@ -523,9 +523,6 @@
"form.RepoName": "Repository name",
"form.Email": "Email address",
"form.Password": "Password",
"form.Retype": "Confirm Password",
"form.SSHTitle": "SSH key name",
"form.HttpsUrl": "HTTPS URL",
"form.PayloadUrl": "Payload URL",
"form.TeamName": "Team name",
"form.AuthName": "Authorization name",
@@ -538,22 +535,24 @@
"form.Content": "Content",
"form.SSPISeparatorReplacement": "Separator",
"form.SSPIDefaultLanguage": "Default Language",
"form.require_error": " cannot be empty.",
"form.alpha_dash_error": " should contain only alphanumeric, dash ('-') and underscore ('_') characters.",
"form.alpha_dash_dot_error": " should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters.",
"form.git_ref_name_error": " must be a well-formed Git reference name.",
"form.size_error": " must be size %s.",
"form.min_size_error": " must contain at least %s characters.",
"form.max_size_error": " must contain at most %s characters.",
"form.email_error": " is not a valid email address.",
"form.url_error": "\"%s\" is not a valid URL.",
"form.include_error": " must contain substring \"%s\".",
"form.glob_pattern_error": " glob pattern is invalid: %s.",
"form.regex_pattern_error": " regex pattern is invalid: %s.",
"form.username_error": " can only contain alphanumeric characters ('0-9','a-z','A-Z'), dash ('-'), underscore ('_') and dot ('.'). It cannot begin or end with non-alphanumeric characters, and consecutive non-alphanumeric characters are also forbidden.",
"form.invalid_slug_error": " is invalid.",
"form.invalid_group_team_map_error": " mapping is invalid: %s",
"form.unknown_error": "Unknown error:",
"form.require_error": "%s cannot be empty.",
"form.alpha_dash_error": "%s should contain only alphanumeric, dash ('-') and underscore ('_') characters.",
"form.alpha_dash_dot_error": "%s should contain only alphanumeric, dash ('-'), underscore ('_') and dot ('.') characters.",
"form.git_ref_name_error": "%s must be a well-formed Git reference name.",
"form.size_error": "%[1]s must be size %[2]s.",
"form.min_size_error": "%[1]s must contain at least %[2]s characters.",
"form.max_size_error": "%[1]s must contain at most %[2]s characters.",
"form.range_error": "%[1]s must be a number from %[2]s to %[3]s.",
"form.email_error": "%s is not a valid email address.",
"form.url_error": "%s is not a valid URL.",
"form.in_error": "%[1]s must be one of the following: %[2]s.",
"form.include_error": "%[1]s must contain substring \"%[2]s\".",
"form.glob_pattern_error": "%[1]s glob pattern is invalid: %[2]s.",
"form.regex_pattern_error": "%[1]s regex pattern is invalid: %[2]s.",
"form.username_error": "%s can only contain alphanumeric characters ('0-9','a-z','A-Z'), dash ('-'), underscore ('_') and dot ('.'). It cannot begin or end with non-alphanumeric characters, and consecutive non-alphanumeric characters are also forbidden.",
"form.invalid_slug_error": "%s is invalid.",
"form.invalid_group_team_map_error": "%[1]s mapping is invalid: %[2]s",
"form.field_invalid_message": "%[1]s is invalid: %[2]s",
"form.captcha_incorrect": "The CAPTCHA code is incorrect.",
"form.password_not_match": "The passwords do not match.",
"form.lang_select_error": "Select a language from the list.",