-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: upgrades to ember@3.24. #41
base: main
Are you sure you want to change the base?
Conversation
8e76bad
to
887b4d1
Compare
887b4d1
to
680121e
Compare
@@ -21,7 +21,7 @@ | |||
@value={{this.strengthValue}} | |||
@warn={{this.strengthWarning}} | |||
/> | |||
<div class='flex-80'>Password Strength: {{this.strengthLevel}}</div> | |||
<div class='flex-80'>{{this.strengthLabel}} {{this.strengthLevel}}</div> |
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.
turns out we were never setting/displaying this, even though it was an expected argument.
this.customValidations = this.args.customValidations || A([]); | ||
this.errors = this.args.errors || A([]); | ||
this.minStrength = this.args.minStrength || 3; | ||
this.onChange = this.args.onChange || null; | ||
this.passwordErrorMessage = | ||
this.args.passwordErrorMessage || 'Please enter a stronger password.'; | ||
this.strengthLabel = this.args.strengthLabel || 'Password strength: '; | ||
this.strengthLevels = | ||
this.args.strengthLevels || | ||
A(['Very Poor', 'Poor', 'Fair', 'Good', 'Excellent']); |
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 decided it was best to set the expected defaults for these on component creation.
It does mean that these specific arguments cannot be mutated after component creation but it feels like these would tend to be hardcoded. For example, it would be odd to dynamically change the password strength level after component creation...
Can change later if we are so inclined, or the community can make an good argument for it. ✌️
Simplifies the parsing of defaults as otherwise they all need to be computed properties which ends up with a whole lot of getters wrappers:
get passwordErrorMessage() {
return this.args.passwordErrorMessage || 'Please enter a stronger password.';
}
|
||
inputErrors: computed('errors.[]', 'minStrength', 'passwordErrorMessage', 'passwordStrength.score', 'value', function() { | ||
get inputErrors() { |
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.
computed properties are much cleaner now huh..
converts component to glimmer.