-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feature/cqi 149: password validator for user form creation #104
Conversation
src/components/UserMasterPanel.js
Outdated
@@ -309,6 +328,9 @@ const UserMasterPanel = (props) => { | |||
</InputAdornment> | |||
} | |||
/> | |||
<Typography color={passwordScore >= 2 ? "primary" : "error"} className={classes.passwordFeedback}> |
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.
I suggest you to create a variable which will explicitly say what do you check here. So instead of color={passwordScore >= 2 ? "primary" : "error"}
I would declare a variable: const IS_PASSWORD_SECURED = passwordScore >= 2;
and then use it like that: color={IS_PASSWORD_SECURED ? "primary" : "error"}
. It will be more readable.
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.
I left some comments. Please take a look on Sonar analysis, there is one code smell.
Quality Gate passedIssues Measures |
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.
LGTM @lruzicki . I'll merge it once BE will be merged. Let me know about it.
@olewandowski1 BE is merged, you can merge FE. |
Ticket:
https://openimis.atlassian.net/browse/CQI-149
Changes:
How was it tested?
Examples of use:
Weak password - password policy errors
Password policy met but the password is still weak
Medium password, user can save the form, but it recommends him strengthening password (score 2 from library)
Strong password (score 3 from library)
Very strong password (score 4 from library)