From eb80b966418a69a1e0373f5198c816d77db8329c Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 31 Aug 2015 10:17:28 -0400 Subject: Reformatted team_signup_password_page.jsx to meet style guide requirements. --- web/react/components/team_signup_password_page.jsx | 79 +++++++++++++++------- 1 file changed, 56 insertions(+), 23 deletions(-) (limited to 'web/react') diff --git a/web/react/components/team_signup_password_page.jsx b/web/react/components/team_signup_password_page.jsx index 6b21915f6..f94a3a749 100644 --- a/web/react/components/team_signup_password_page.jsx +++ b/web/react/components/team_signup_password_page.jsx @@ -1,21 +1,25 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. -var utils = require('../utils/utils.jsx'); var client = require('../utils/client.jsx'); +var BrowserStore = require('../stores/browser_store.jsx'); +var UserStore = require('../stores/user_store.jsx'); -module.exports = React.createClass({ - displayName: 'TeamSignupPasswordPage', - propTypes: { - state: React.PropTypes.object, - updateParent: React.PropTypes.func - }, - submitBack: function(e) { +export default class TeamSignupPasswordPage extends React.Component { + constructor(props) { + super(props); + + this.submitBack = this.submitBack.bind(this); + this.submitNext = this.submitNext.bind(this); + + this.state = {}; + } + submitBack(e) { e.preventDefault(); this.props.state.wizard = 'username'; this.props.updateParent(this.props.state); - }, - submitNext: function(e) { + } + submitNext(e) { e.preventDefault(); var password = this.refs.password.getDOMNode().value.trim(); @@ -37,9 +41,8 @@ module.exports = React.createClass({ var props = this.props; - client.loginByEmail(teamSignup.team.name, teamSignup.team.email, teamSignup.user.password, - function(data) { + function loginSuccess() { UserStore.setLastEmail(teamSignup.team.email); UserStore.setCurrentUser(teamSignup.user); if (this.props.hash > 0) { @@ -52,7 +55,7 @@ module.exports = React.createClass({ window.location.href = '/'; }.bind(this), - function(err) { + function loginFail(err) { if (err.message === 'Login failed because email address has not been verified') { window.location.href = '/verify_email?email=' + encodeURIComponent(teamSignup.team.email) + '&teamname=' + encodeURIComponent(teamSignup.team.name); } else { @@ -67,11 +70,8 @@ module.exports = React.createClass({ $('#finish-button').button('reset'); }.bind(this) ); - }, - getInitialState: function() { - return {}; - }, - render: function() { + } + render() { client.track('signup', 'signup_team_07_password'); var passwordError = null; @@ -89,7 +89,10 @@ module.exports = React.createClass({ return (
- +

Your password

Select a password that you'll use to login with your email address:
@@ -99,7 +102,14 @@ module.exports = React.createClass({
Choose your password
- +
Passwords must contain 5 to 50 characters. Your password will be strongest if it contains a mix of symbols, numbers, and upper and lowercase characters.
@@ -108,14 +118,37 @@ module.exports = React.createClass({
- +

By proceeding to create your account and use {config.SiteName}, you agree to our Terms of Service and Privacy Policy. If you do not agree, you cannot use {config.SiteName}.

- Back to previous step + + Back to previous step +
); } -}); +} + +TeamSignupPasswordPage.defaultProps = { + state: {}, + hash: '' +}; +TeamSignupPasswordPage.propTypes = { + state: React.PropTypes.object, + hash: React.PropTypes.string, + updateParent: React.PropTypes.func +}; -- cgit v1.2.3-1-g7c22