diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index 2ddd80d10f..937bbd9d28 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -463,22 +463,22 @@ var SecurityTab = React.createClass({ e.preventDefault(); var user = this.props.user; - var currentPassword = this.state.current_password; - var newPassword = this.state.new_password; - var confirmPassword = this.state.confirm_password; + var currentPassword = this.state.currentPassword; + var newPassword = this.state.newPassword; + var confirmPassword = this.state.confirmPassword; if (currentPassword === '') { - this.setState({password_error: 'Please enter your current password', server_error: ''}); + this.setState({passwordError: 'Please enter your current password', serverError: ''}); return; } if (newPassword.length < 5) { - this.setState({password_error: 'New passwords must be at least 5 characters', server_error: ''}); + this.setState({passwordError: 'New passwords must be at least 5 characters', serverError: ''}); return; } if (newPassword !== confirmPassword) { - this.setState({password_error: 'The new passwords you entered do not match', server_error: ''}); + this.setState({passwordError: 'The new passwords you entered do not match', serverError: ''}); return; } @@ -488,43 +488,43 @@ var SecurityTab = React.createClass({ data.new_password = newPassword; client.updatePassword(data, - function(data) { - this.props.updateSection(""); + function() { + this.props.updateSection(''); AsyncClient.getMe(); - this.setState({current_password: '', new_password: '', confirm_password: ''}); + this.setState({currentPassword: '', newPassword: '', confirmPassword: ''}); }.bind(this), function(err) { var state = this.getInitialState(); if (err.message) { - state.server_error = err.message; + state.serverError = err.message; } else { - state.server_error = err; + state.serverError = err; } - state.password_error = ''; + state.passwordError = ''; this.setState(state); }.bind(this) ); }, updateCurrentPassword: function(e) { - this.setState({ current_password: e.target.value }); + this.setState({currentPassword: e.target.value}); }, updateNewPassword: function(e) { - this.setState({ new_password: e.target.value }); + this.setState({newPassword: e.target.value}); }, updateConfirmPassword: function(e) { - this.setState({ confirm_password: e.target.value }); + this.setState({confirmPassword: e.target.value}); }, handleHistoryOpen: function() { - $("#user_settings1").modal('hide'); + $('#user_settings1').modal('hide'); }, handleDevicesOpen: function() { - $("#user_settings1").modal('hide'); + $('#user_settings1').modal('hide'); }, handleClose: function() { - $(this.getDOMNode()).find(".form-control").each(function() { - this.value = ""; + $(this.getDOMNode()).find('.form-control').each(function() { + this.value = ''; }); - this.setState({current_password: '', new_password: '', confirm_password: '', server_error: null, password_error: null}); + this.setState({currentPassword: '', newPassword: '', confirmPassword: '', serverError: null, passwordError: null}); this.props.updateTab('general'); }, componentDidMount: function() { @@ -535,40 +535,41 @@ var SecurityTab = React.createClass({ this.props.updateSection(''); }, getInitialState: function() { - return { current_password: '', new_password: '', confirm_password: '' }; + return {currentPassword: '', newPassword: '', confirmPassword: ''}; }, render: function() { - var server_error = this.state.server_error ? this.state.server_error : null; - var password_error = this.state.password_error ? this.state.password_error : null; + var serverError = this.state.serverError ? this.state.serverError : null; + var passwordError = this.state.passwordError ? this.state.passwordError : null; + var updateSectionStatus; var passwordSection; var self = this; if (this.props.activeSection === 'password') { var inputs = []; var submit = null; - if (this.props.user.auth_service === "") { + if (this.props.user.auth_service === '') { inputs.push( -