Skip to content

Commit

Permalink
Merge #3171
Browse files Browse the repository at this point in the history
3171: fix(user): add clarity to user fields r=jniles a=jniles

This commit adds clarifying text to the fields on the user creation page.

Closes #3119

Co-authored-by: Jonathan Niles <[email protected]>
  • Loading branch information
bors[bot] and jniles committed Sep 11, 2018
2 parents 5fea1ca + dd8b7c6 commit e070e12
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
10 changes: 6 additions & 4 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"BACK": "Back",
"CANCEL": "Cancel",
"CANCEL_EDIT": "Cancel Edit",
"CASHBOX_MANAGEMENT": "Cashboxes Management",
"CASHBOX_MANAGEMENT": "Cashbox Management",
"CLEAR": "Clear",
"CLOSE": "Close",
"CONFIGURE": "Configure",
Expand Down Expand Up @@ -139,6 +139,7 @@
"DELETE_RECORD_SUCCESS": "Successfully deleted the record.",
"DELETE_SUCCESS": "Successfully deleted a record",
"DISABLED_CURRENCY": "This currency is unusable since there is no account set for it. Use the Cashbox Management module to set an account for this currency and cashbox.",
"DISPLAY_NAME": "The user's full name, this is displayed on any formal documents or receipts processed by the system.",
"EDITED" : "Edited",
"EMPLOYEE_NOT_FOUND" : "Employee Not Found",
"ENTITY_NOT_FOUND": "Entity (Debtor/Creditor) Not Found",
Expand All @@ -159,7 +160,6 @@
"IS_TAX" : "Is it a Tax",
"ITEMS_FULL": "There are no additional inventory items that be assigned to this invoice.",
"LOADING": "Loading",
"MANY_TRYS": "Many tries",
"MAX_LOT_REACHED": "Max Lot reached",
"NOTE": "Note",
"NOT_CONFIGURED": "The accounts for this currency have not been configured yet.",
Expand Down Expand Up @@ -193,6 +193,7 @@
"TRANSACTION_REVER_SUCCESS": "This transaction was reversed with success",
"UNAUTHORIZED": "Unauthorized",
"UNPOSTED_TRANSACTION": "Non-posted transaction(s) not shown",
"USERNAME" : "This is the user's identifier for the system, it should be short and memorable and will be used every time they log in.",
"UPDATE_SUCCESS": "Updated successfully",
"UPLOAD_PICTURE_FAILED": "The selected file is not an picture",
"USER_CASHBOX": "These are the cashboxes that you have permission for manage",
Expand Down Expand Up @@ -225,7 +226,7 @@
"ANNUAL_ECART" : "Annual Difference",
"ANNUAL_IMPOT" : "Annual Impot",
"ANNUAL_TRANCH_FROM" : "Annual Tranch From",
"ANNUAL_TRANCH_TO" : "Annual Tranch To",
"ANNUAL_TRANCH_TO" : "Annual Tranch To",
"APPLY_INVOICING_FEES" : "Apply invoicing fee",
"APPLY_DISCOUNTS": "Apply discounts",
"APPLY_SUBSIDIES": "Apply subsidies",
Expand Down Expand Up @@ -325,6 +326,7 @@
"DISTRIBUTABLE": "Distributable",
"DISABLED": "Disabled",
"DIAGNOSIS": "Diagnosis",
"DISPLAY_NAME" : "Display Name",
"DOB": "Date of Birth",
"DOCUMENT": "Document",
"DUE": "Payment Due",
Expand Down Expand Up @@ -783,7 +785,7 @@
"NUMBER": "Must be a number",
"PASSWORD_MATCH": "The passwords do not match!",
"REQUIRED": "This field cannot be empty.",
"REQUIRED_EMAIL": "required Email",
"REQUIRED_EMAIL": "The email field is required.",
"UNIQUE": "This field must be unique. This value is already taken."
},
"WARNINGS": {
Expand Down
4 changes: 3 additions & 1 deletion client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"DELETE_RECORD_SUCCESS": "Suppression de la transaction avec succès.",
"DELETE_SUCCESS": "Suppression avec succès",
"DISABLED_CURRENCY": "Cette monnaie est inutilisable car il n'y a pas de compte fixée pour elle. Utilisez le module Box Cash Management pour définir un compte pour cette monnaie et caisse.",
"DISPLAY_NAME" : "Le nom complet de l'utilisateur, il est affiché sur tous les documents formels ou reçus traités par le système.",
"ENTITY_NOT_FOUND": "Entité (Débiteur/Créditeur) Non Trouvé",
"EMAIL_SUCCESS": "Email envoyé avec succès.",
"EXPORT_SUCCESS": "Exportation avec succes",
Expand All @@ -159,7 +160,6 @@
"IS_PERCENT" : "Cette rubrique s'exprime en Pourcentage",
"IS_TAX" : "Est ce une taxe",
"LOADING": "Chargement en cours",
"MANY_TRYS": "Plusieurs tentatives",
"MAX_LOT_REACHED": "Lot maximal atteint",
"NOTE": "Note",
"NOT_CONFIGURED": "Les comptes ne sont pas configurés.",
Expand Down Expand Up @@ -197,6 +197,7 @@
"UPLOAD_PICTURE_FAILED": "Le fichier selectionné n'est pas une image",
"USER_CASHBOX": "Voici les caisses dont vous avez la permission de gérer",
"USER_DEPOT": "Voici les dépôts dont vous avez la permission de gérer",
"USERNAME" : "Ceci est l'identifiant de l'utilisateur pour le système, il doit être court et mémorable et sera utilisé à chaque connexion.",
"VIEW_BEGINNING_BALANCE": "Aperçue de la balance d'ouverture",
"VIEW_CLOSING_BALANCE": "Aperçue de la balance de cloture"
},
Expand Down Expand Up @@ -326,6 +327,7 @@
"DELAY": "Délai de livraison",
"DISTRIBUTABLE": "Distribuable",
"DISABLED": "Désactivée",
"DISPLAY_NAME" : "Nom",
"DIAGNOSIS": "Diagnostic",
"DOB": "Date de Naissance",
"DOCUMENT": "Document",
Expand Down
6 changes: 3 additions & 3 deletions client/src/modules/templates/messages.tmpl.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- displays "There was a problem validating this field. Please check your internet connection." -->
<p ng-message="exception" translate> FORM.VALIDATION.EXCEPTION </p>

<!-- displays "This field must be unique. This value is already taken. -->
<p ng-message="unique" translate> FORM.VALIDATION.UNIQUE </p>

<!-- displays "This field cannot be empty." -->
<p ng-message="required" translate> FORM.VALIDATION.REQUIRED </p>

<!-- displays "This value must be a whole number (integer)." -->
<p ng-message="integer" translate> FORM.VALIDATION.INTEGER </p>

<!-- displays "This field must be unique. This value is already taken. -->
<p ng-message="unique" translate> FORM.VALIDATION.UNIQUE </p>

<!-- displays "This value is too small for this field." -->
<p ng-message="min" translate> FORM.VALIDATION.MIN </p>

Expand Down
31 changes: 17 additions & 14 deletions client/src/modules/users/user.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,38 @@

<div class="modal-body" style="overflow-y: scroll; max-height:600px; ">

<div class="form-group has-feedback" ng-class="{ 'has-error' : (UserForm.$submitted || UserForm.display_name.$error.unique) && UserForm.display_name.$invalid }">
<label class="control-label" translate>FORM.LABELS.USERNAME</label>
<div class="form-group" ng-class="{ 'has-error' : UserForm.$submitted && UserForm.display_name.$invalid }">
<label class="control-label" translate>FORM.LABELS.DISPLAY_NAME</label>
<input
name="display_name"
bh-unique="/users/"
ng-model="UserModalCtrl.user.display_name"
ng-maxlength="UserModalCtrl.maxLength"
class="form-control"
autocomplete="off"
required>

<span ng-show="UserForm.display_name.$error.unique" translate class="help-block">
ERRORS.ER_DUP_KEY
</span>

<i ng-show="UserForm.display_name.$error.unique" class="text-danger glyphicon glyphicon-remove form-control-feedback" id="unique-error-icon"></i>
<i ng-show="UserForm.display_name.$pending.unique" class="glyphicon glyphicon-hourglass form-control-feedback"></i>

<div class="help-block" ng-messages="UserForm.display_name.$error" ng-show="UserForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>

<div class="help-block">
<p translate>FORM.INFO.DISPLAY_NAME</p>
</div>
</div>

<div class="form-group" ng-class="{ 'has-error' : UserForm.$submitted && UserForm.username.$invalid }">
<label class="control-label" translate>FORM.LABELS.LOGIN</label>
<input name="username" ng-maxlength="UserModalCtrl.userName" autocomplete="off" ng-model="UserModalCtrl.user.username" class="form-control" required>
<div class="help-block" ng-messages="UserForm.username.$error" ng-show="UserForm.$submitted">
<div class="form-group has-feedback" ng-class="{ 'has-error' : (UserForm.$submitted|| UserForm.username.$error.unique) && UserForm.username.$invalid }">
<label class="control-label" translate>FORM.LABELS.USERNAME</label>
<input name="username" ng-maxlength="UserModalCtrl.userName" autocomplete="off" ng-model="UserModalCtrl.user.username" class="form-control" bh-unique="/users/" required>

<i ng-show="UserForm.username.$error.unique" class="text-danger glyphicon glyphicon-remove form-control-feedback" id="unique-error-icon"></i>
<i ng-show="UserForm.username.$pending.unique" class="glyphicon glyphicon-hourglass form-control-feedback"></i>

<div class="help-block" ng-messages="UserForm.username.$error" ng-show="UserForm.username.$dirty">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
<div class="help-block">
<p translate>FORM.INFO.USERNAME</p>
</div>
</div>

<div class="form-group" ng-class="{ 'has-error' : UserForm.$submitted && UserForm.email.$invalid }">
Expand Down

0 comments on commit e070e12

Please sign in to comment.