From 9ed1c812e190bd1ec748fd58c284960d6999ea7e Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 13 Sep 2016 12:59:04 -0300 Subject: PLT-4131 Dynamic update the Password requirements error message sample (#4017) --- webapp/components/admin_console/password_settings.jsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/webapp/components/admin_console/password_settings.jsx b/webapp/components/admin_console/password_settings.jsx index ad805b38c..6fa1dc9c4 100644 --- a/webapp/components/admin_console/password_settings.jsx +++ b/webapp/components/admin_console/password_settings.jsx @@ -23,6 +23,7 @@ export default class PasswordSettings extends AdminSettings { this.getSampleErrorMsg = this.getSampleErrorMsg.bind(this); this.handlePasswordLengthChange = this.handlePasswordLengthChange.bind(this); + this.handleCheckboxChange = this.handleCheckboxChange.bind(this); this.state = Object.assign(this.state, { passwordMinimumLength: props.config.PasswordSettings.MinimumLength, @@ -136,6 +137,11 @@ export default class PasswordSettings extends AdminSettings { this.handleChange(id, value); } + handleCheckboxChange(id, value) { + this.sampleErrorMsg = this.getSampleErrorMsg(this.state.passwordMinimumLength); + this.handleChange(id, value); + } + renderTitle() { return (

@@ -212,7 +218,7 @@ export default class PasswordSettings extends AdminSettings { ref='lowercase' defaultChecked={this.state.passwordLowercase} name='admin.password.lowercase' - onChange={this.handleChange} + onChange={this.handleCheckboxChange} />