From 2c5ff64d42c7ede431ebbcc226cd0ccbd0952667 Mon Sep 17 00:00:00 2001 From: bgamard Date: Wed, 25 Mar 2020 19:02:50 +0100 Subject: [PATCH] Closes #387: validation username and group name in UI --- docs-web/src/main/webapp/src/app/docs/app.js | 3 +++ docs-web/src/main/webapp/src/locale/en.json | 3 ++- docs-web/src/main/webapp/src/locale/fr.json | 3 ++- .../src/main/webapp/src/partial/docs/settings.group.edit.html | 4 ++-- .../src/main/webapp/src/partial/docs/settings.user.edit.html | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs-web/src/main/webapp/src/app/docs/app.js b/docs-web/src/main/webapp/src/app/docs/app.js index 6e771fbf..c8569960 100644 --- a/docs-web/src/main/webapp/src/app/docs/app.js +++ b/docs-web/src/main/webapp/src/app/docs/app.js @@ -436,6 +436,9 @@ angular.module('docs', } else { // Or else determine the language based on the user's browser $translateProvider.determinePreferredLanguage(); + if (!$translateProvider.use()) { + $translateProvider.use('en'); + } } // Configuring Timago diff --git a/docs-web/src/main/webapp/src/locale/en.json b/docs-web/src/main/webapp/src/locale/en.json index 590fef80..ce04b367 100644 --- a/docs-web/src/main/webapp/src/locale/en.json +++ b/docs-web/src/main/webapp/src/locale/en.json @@ -562,7 +562,8 @@ "email": "Must be a valid e-mail", "password_confirm": "Password and password confirmation must match", "number": "Number required", - "no_space": "Spaces and colons are not allowed" + "no_space": "Spaces and colons are not allowed", + "alphanumeric": "Only letters and numbers are allowed" }, "action_type": { "ADD_TAG": "Add a tag", diff --git a/docs-web/src/main/webapp/src/locale/fr.json b/docs-web/src/main/webapp/src/locale/fr.json index 3aa7f78d..09ad12a0 100644 --- a/docs-web/src/main/webapp/src/locale/fr.json +++ b/docs-web/src/main/webapp/src/locale/fr.json @@ -551,7 +551,8 @@ "email": "Doit être une adresse e-mail valide", "password_confirm": "Le mot de passe et sa confirmation doivent être identiques", "number": "Nombre requis", - "no_space": "Les espaces ne sont pas autorisés" + "no_space": "Les espaces ne sont pas autorisés", + "alphanumeric": "Seuls les lettres et les chiffres sont autorisés" }, "action_type": { "ADD_TAG": "Ajouter un tag", diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html b/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html index 6e0938cc..96247fd7 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.group.edit.html @@ -9,7 +9,7 @@
@@ -17,7 +17,7 @@ {{ 'validation.required' | translate }} {{ 'validation.too_short' | translate }} {{ 'validation.too_long' | translate }} - {{ 'validation.no_space' | translate }} + {{ 'validation.alphanumeric' | translate }} diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html index 9491a50c..6a227001 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html @@ -9,6 +9,7 @@
@@ -16,6 +17,7 @@ {{ 'validation.required' | translate }} {{ 'validation.too_short' | translate }} {{ 'validation.too_long' | translate }} + {{ 'validation.alphanumeric' | translate }}