Frontend validations for regex

This commit is contained in:
roschaefer 2019-09-20 20:24:04 +02:00
parent 4fbabc879f
commit e8f47cb004
3 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ export default function UniqueSlugForm({ translate, apollo, currentUser }) {
return {
formSchema: {
slug: [
{type: "string", required: true, pattern: /^[a-z0-9_-]+$/, message: translate('settings.validation.slug.regex') },
{
asyncValidator(rule, value, callback) {
debounce(() => {

View File

@ -159,6 +159,7 @@
},
"validation": {
"slug": {
"regex": "Es sind nur Kleinbuchstaben, Zahlen, Unterstriche oder Bindestriche erlaubt.",
"alreadyTaken": "Dieser Benutzername ist schon vergeben."
}
},

View File

@ -160,6 +160,7 @@
},
"validation": {
"slug": {
"regex": "Allowed characters are only lowercase letters, numbers, underscores and hyphens.",
"alreadyTaken": "This user name is already taken."
}
},