RA-1553: Added client side verification for password input#49
RA-1553: Added client side verification for password input#49anuar2k wants to merge 2 commits intoopenmrs:masterfrom
Conversation
|
I agree about improving the UX. |
|
@djazayeri This new code isn't really about displaying the error message after when user tries to change his password (pushes a button to save it), but rather about verifying the input on client side, dynamically using The message displayed after a trial is different from the exception messages thrown from It's simply does this:
Unfortunately I don't see how we could prevent code duplication here, because the logic is a bit different between what server and client does. Thanks for the attention. PS: Sorry for sounding very repetetive but I've tried to explain it in a bit different way. |
|
@djazayeri I have refactored the code (moved |
|
@anuar2k are you still available to add some tests for the PasswordValidation class? |
Description of what I changed
Although the issue I've reported wasn't in no way reviewed, I believe it is valid. I've come up with a possible solution, which seems to fix the problem.
I have added the functionality to the pages which verificates the entered passwords if they are valid. Code (regex) which verificates passwords is generated dynamically (together with a message), based on the state of appropriate GlobalProperties. Currently, the only check done on the client size is minimum length verification, so if our password passes client side check and fails on the server side, an error is displayed with "Validation errors found" message, which wasn't really helpful when I was new to the system. I've wasted a lot of time trying to figure out what's wrong; why I couldn't change the password, so imagine non-tech-savvy clerks trying to do so.
Note: Although it seems that a long warning message breaks the layout on Add New Account page, the same problem exists if only the password length warning is displayed. This problem was described with another ticket, therefore shouldn't be addressed in this PR.
Issue I worked on
see https://issues.openmrs.org/browse/RA-1553