-
Notifications
You must be signed in to change notification settings - Fork 104
fix: problem letters allowed in widget number #3478
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
base: develop
Are you sure you want to change the base?
fix: problem letters allowed in widget number #3478
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3478 +/- ##
===========================================
- Coverage 84.25% 84.23% -0.02%
===========================================
Files 132 132
Lines 10301 10301
===========================================
- Hits 8679 8677 -2
- Misses 1622 1624 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4c5ff4c
to
a1a8bce
Compare
required : 'Ce champ est obligatoire.', | ||
minlength : 'Le texte doit contenir au moins {{requiredLength}} caractères (actuellement {{actualLength}}).', | ||
maxlength : 'Le texte doit contenir au plus {{requiredLength}} caractères (actuellement {{actualLength}}).', | ||
pattern : 'Valeur non valide.', | ||
min : 'La valeur doit être ≥ {{min}} (actuellement {{actual}}).', | ||
max : 'La valeur doit être ≤ {{max}} (actuellement {{actual}}).', | ||
|
||
//validateurs custom | ||
[ValidationErrorsId.ARRAY_MIN_LENGTH_ERROR]: 'Il faut au moins {{arrayLength}} éléments.', | ||
[ValidationErrorsId.IS_OBJECT_ERROR] : 'Format d’objet invalide.', | ||
[ValidationErrorsId.MIN_GREATER_THAN_MAX] : 'Le minimum doit être ≤ le maximum.', | ||
[ValidationErrorsId.NOT_NUMBER_ERROR] : 'Le champ doit être un nombre valide.', | ||
[ValidationErrorsId.COMMA_NOT_ALLOWED] : 'Le champ de type nombre ne doit pas contenir de virgule. Utilisez le point pour la décimale.', | ||
file : 'Le fichier est trop volumineux.', | ||
medias : 'Format de médias invalide.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doublons ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes en l'occurence toutes les erreurs sont référencées dans les fichiers de traductions. J'avais mis un objet de messages d'erreurs par défaut au cas où la traduction n'était pas bien remplie . Donc yes ça peut être enlevé
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A savoir que j'ai testé sur min ,max , format de nombre , utilisation de "," dans les nombres décimaux . J'ai pas reproduis les erreurs sur les autres validateurs .
A l'origine la PR proposait juste de "fix" les problèmes de remplissage des input de type "number" avec des lettres (sur firefox c'est autorisé , tandis que sur chrome il interdit l'ajout de lettre dans ces input de type number) . Mais vu que je voulais proposer un développement qui pouvait être réutilisé et générique , j'ai intégré les autres validations qui sont ajoutées dans le composant dynamicform )
- add another widget using type text with validators as number - create a generic component to display validation error messages - use this generic component in the dynamic form component - add a service to manage the messages - add messages in the i18n files - add accessor get for the form control Reviewed-by: andriacap
- Refact number and txt_number for adding validators - Add control on comma in number input / txt_number widget Reviewed-by: andriacap
- Don't allow letters in input txt_number widget (10a not allowed whereas it was before) Reviewed-by: acapai
Reviewed-by: acapai
a1fbbf2
to
c7ac108
Compare
Closes : #3480
Reviewed-by: andriacap