Initial cosmetic reformatting of signup_team_complete.jsx file
Этот коммит содержится в:
@@ -4,12 +4,16 @@
|
|||||||
var utils = require('../utils/utils.jsx');
|
var utils = require('../utils/utils.jsx');
|
||||||
var ConfigStore = require('../stores/config_store.jsx');
|
var ConfigStore = require('../stores/config_store.jsx');
|
||||||
var client = require('../utils/client.jsx');
|
var client = require('../utils/client.jsx');
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
|
||||||
var BrowserStore = require('../stores/browser_store.jsx');
|
var BrowserStore = require('../stores/browser_store.jsx');
|
||||||
var constants = require('../utils/constants.jsx');
|
var constants = require('../utils/constants.jsx');
|
||||||
|
|
||||||
WelcomePage = React.createClass({
|
WelcomePage = React.createClass({
|
||||||
submitNext: function (e) {
|
displayName: 'WelcomePage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitNext: function(e) {
|
||||||
if (!BrowserStore.isLocalStorageSupported()) {
|
if (!BrowserStore.isLocalStorageSupported()) {
|
||||||
this.setState({storageError: 'This service requires local storage to be enabled. Please enable it or exit private browsing.'});
|
this.setState({storageError: 'This service requires local storage to be enabled. Please enable it or exit private browsing.'});
|
||||||
return;
|
return;
|
||||||
@@ -18,11 +22,11 @@ WelcomePage = React.createClass({
|
|||||||
this.props.state.wizard = 'team_display_name';
|
this.props.state.wizard = 'team_display_name';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
handleDiffEmail: function (e) {
|
handleDiffEmail: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({useDiff: true});
|
this.setState({useDiff: true});
|
||||||
},
|
},
|
||||||
handleDiffSubmit: function (e) {
|
handleDiffSubmit: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var state = {useDiff: true, serverError: ''};
|
var state = {useDiff: true, serverError: ''};
|
||||||
@@ -36,21 +40,20 @@ WelcomePage = React.createClass({
|
|||||||
state.emailError = 'This service requires local storage to be enabled. Please enable it or exit private browsing.';
|
state.emailError = 'This service requires local storage to be enabled. Please enable it or exit private browsing.';
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
state.emailError = '';
|
|
||||||
}
|
}
|
||||||
|
state.emailError = '';
|
||||||
|
|
||||||
client.signupTeam(email,
|
client.signupTeam(email,
|
||||||
function(data) {
|
function success(data) {
|
||||||
if (data['follow_link']) {
|
if (data.follow_link) {
|
||||||
window.location.href = data['follow_link'];
|
window.location.href = data.follow_link;
|
||||||
} else {
|
} else {
|
||||||
this.props.state.wizard = 'finished';
|
this.props.state.wizard = 'finished';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
window.location.href = '/signup_team_confirm/?email=' + encodeURIComponent(team.email);
|
window.location.href = '/signup_team_confirm/?email=' + encodeURIComponent(email);
|
||||||
}
|
}
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
function(err) {
|
function error(err) {
|
||||||
this.state.serverError = err.message;
|
this.state.serverError = err.message;
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
@@ -134,7 +137,7 @@ WelcomePage = React.createClass({
|
|||||||
{emailError}
|
{emailError}
|
||||||
</div>
|
</div>
|
||||||
{serverError}
|
{serverError}
|
||||||
<button className='btn btn-md btn-primary' type='button' onClick={this.handleDiffSubmit} type='submit'>Use this instead</button>
|
<button className='btn btn-md btn-primary' type='button' onClick={this.handleDiffSubmit}>Use this instead</button>
|
||||||
</div>
|
</div>
|
||||||
<a href='#' onClick={this.handleDiffEmail} className={differentEmailLinkClass}>Use a different email</a>
|
<a href='#' onClick={this.handleDiffEmail} className={differentEmailLinkClass}>Use a different email</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,23 +146,28 @@ WelcomePage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
TeamDisplayNamePage = React.createClass({
|
TeamDisplayNamePage = React.createClass({
|
||||||
submitBack: function (e) {
|
displayName: 'TeamDisplayNamePage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'welcome';
|
this.props.state.wizard = 'welcome';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitNext: function (e) {
|
submitNext: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var display_name = this.refs.name.getDOMNode().value.trim();
|
var displayName = this.refs.name.getDOMNode().value.trim();
|
||||||
if (!display_name) {
|
if (!displayName) {
|
||||||
this.setState({nameError: 'This field is required'});
|
this.setState({nameError: 'This field is required'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.state.wizard = 'team_url';
|
this.props.state.wizard = 'team_url';
|
||||||
this.props.state.team.display_name = display_name;
|
this.props.state.team.display_name = displayName;
|
||||||
this.props.state.team.name = utils.cleanUpUrlable(display_name);
|
this.props.state.team.name = utils.cleanUpUrlable(displayName);
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
@@ -167,7 +175,6 @@ TeamDisplayNamePage = React.createClass({
|
|||||||
},
|
},
|
||||||
handleFocus: function(e) {
|
handleFocus: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
e.currentTarget.select();
|
e.currentTarget.select();
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
@@ -206,12 +213,17 @@ TeamDisplayNamePage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
TeamURLPage = React.createClass({
|
TeamURLPage = React.createClass({
|
||||||
submitBack: function (e) {
|
displayName: 'TeamURLPage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'team_display_name';
|
this.props.state.wizard = 'team_display_name';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitNext: function (e) {
|
submitNext: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var name = this.refs.name.getDOMNode().value.trim();
|
var name = this.refs.name.getDOMNode().value.trim();
|
||||||
@@ -239,7 +251,7 @@ TeamURLPage = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.findTeamByName(name,
|
client.findTeamByName(name,
|
||||||
function(data) {
|
function success(data) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
if (config.AllowSignupDomainsWizard) {
|
if (config.AllowSignupDomainsWizard) {
|
||||||
this.props.state.wizard = 'allowed_domains';
|
this.props.state.wizard = 'allowed_domains';
|
||||||
@@ -255,7 +267,7 @@ TeamURLPage = React.createClass({
|
|||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
}
|
}
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
function(err) {
|
function error(err) {
|
||||||
this.state.nameError = err.message;
|
this.state.nameError = err.message;
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
@@ -270,7 +282,7 @@ TeamURLPage = React.createClass({
|
|||||||
e.currentTarget.select();
|
e.currentTarget.select();
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
$('body').tooltip( {selector: '[data-toggle=tooltip]', trigger: 'hover click'} );
|
$('body').tooltip({selector: '[data-toggle=tooltip]', trigger: 'hover click'});
|
||||||
|
|
||||||
client.track('signup', 'signup_team_03_url');
|
client.track('signup', 'signup_team_03_url');
|
||||||
|
|
||||||
@@ -314,12 +326,17 @@ TeamURLPage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
AllowedDomainsPage = React.createClass({
|
AllowedDomainsPage = React.createClass({
|
||||||
submitBack: function (e) {
|
displayName: 'AllowedDomainsPage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'team_url';
|
this.props.state.wizard = 'team_url';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitNext: function (e) {
|
submitNext: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (this.refs.open_network.getDOMNode().checked) {
|
if (this.refs.open_network.getDOMNode().checked) {
|
||||||
@@ -403,6 +420,10 @@ AllowedDomainsPage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
EmailItem = React.createClass({
|
EmailItem = React.createClass({
|
||||||
|
displayName: 'EmailItem',
|
||||||
|
propTypes: {
|
||||||
|
focus: React.PropTypes.bool
|
||||||
|
},
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
@@ -424,17 +445,16 @@ EmailItem = React.createClass({
|
|||||||
this.state.emailError = 'Please use a different email than the one used at signup';
|
this.state.emailError = 'Please use a different email than the one used at signup';
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
this.state.emailError = '';
|
|
||||||
this.setState(this.state);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
this.state.emailError = '';
|
||||||
|
this.setState(this.state);
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var emailError = null;
|
var emailError = null;
|
||||||
var emailDivClass = 'form-group';
|
var emailDivClass = 'form-group';
|
||||||
if (this.state.emailError) {
|
if (this.state.emailError) {
|
||||||
emailError = <label className='control-label'>{ this.state.emailError }</label>;
|
emailError = <label className='control-label'>{this.state.emailError}</label>;
|
||||||
emailDivClass += ' has-error';
|
emailDivClass += ' has-error';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,7 +468,12 @@ EmailItem = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
SendInivtesPage = React.createClass({
|
SendInivtesPage = React.createClass({
|
||||||
submitBack: function (e) {
|
displayName: 'SendInivtesPage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (config.AllowSignupDomainsWizard) {
|
if (config.AllowSignupDomainsWizard) {
|
||||||
@@ -459,7 +484,7 @@ SendInivtesPage = React.createClass({
|
|||||||
|
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitNext: function (e) {
|
submitNext: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var valid = true;
|
var valid = true;
|
||||||
@@ -485,7 +510,7 @@ SendInivtesPage = React.createClass({
|
|||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitAddInvite: function (e) {
|
submitAddInvite: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'send_invites';
|
this.props.state.wizard = 'send_invites';
|
||||||
if (!this.props.state.invites) {
|
if (!this.props.state.invites) {
|
||||||
@@ -494,7 +519,7 @@ SendInivtesPage = React.createClass({
|
|||||||
this.props.state.invites.push('');
|
this.props.state.invites.push('');
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitSkip: function (e) {
|
submitSkip: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'username';
|
this.props.state.wizard = 'username';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
@@ -533,7 +558,7 @@ SendInivtesPage = React.createClass({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
content = (
|
content = (
|
||||||
<div className='form-group color--light'>Email is currently disabled for your team, and emails cannot be sent. Contact your system administrator to enable email and email invitations.</div>
|
<div className='form-group color--light'>{'Email is currently disabled for your ' + strings.Team + ', and emails cannot be sent. Contact your system administrator to enable email and email invitations.'}</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,6 +582,11 @@ SendInivtesPage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
UsernamePage = React.createClass({
|
UsernamePage = React.createClass({
|
||||||
|
displayName: 'UsernamePage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
submitBack: function(e) {
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'send_invites';
|
this.props.state.wizard = 'send_invites';
|
||||||
@@ -622,12 +652,17 @@ UsernamePage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
PasswordPage = React.createClass({
|
PasswordPage = React.createClass({
|
||||||
submitBack: function (e) {
|
displayName: 'PasswordPage',
|
||||||
|
propTypes: {
|
||||||
|
state: React.PropTypes.object,
|
||||||
|
updateParent: React.PropTypes.func
|
||||||
|
},
|
||||||
|
submitBack: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'username';
|
this.props.state.wizard = 'username';
|
||||||
this.props.updateParent(this.props.state);
|
this.props.updateParent(this.props.state);
|
||||||
},
|
},
|
||||||
submitNext: function (e) {
|
submitNext: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var password = this.refs.password.getDOMNode().value.trim();
|
var password = this.refs.password.getDOMNode().value.trim();
|
||||||
@@ -642,10 +677,11 @@ PasswordPage = React.createClass({
|
|||||||
teamSignup.user.password = password;
|
teamSignup.user.password = password;
|
||||||
teamSignup.user.allow_marketing = true;
|
teamSignup.user.allow_marketing = true;
|
||||||
delete teamSignup.wizard;
|
delete teamSignup.wizard;
|
||||||
var ctl = this;
|
|
||||||
|
// var ctl = this;
|
||||||
|
|
||||||
client.createTeamFromSignup(teamSignup,
|
client.createTeamFromSignup(teamSignup,
|
||||||
function(data) {
|
function success() {
|
||||||
client.track('signup', 'signup_team_08_complete');
|
client.track('signup', 'signup_team_08_complete');
|
||||||
|
|
||||||
var props = this.props;
|
var props = this.props;
|
||||||
@@ -668,7 +704,7 @@ PasswordPage = React.createClass({
|
|||||||
// }.bind(ctl)
|
// }.bind(ctl)
|
||||||
// );
|
// );
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
function(err) {
|
function error(err) {
|
||||||
this.setState({serverError: err.message});
|
this.setState({serverError: err.message});
|
||||||
$('#sign-up-button').button('reset');
|
$('#sign-up-button').button('reset');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
@@ -727,6 +763,12 @@ PasswordPage = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
displayName: 'SignupTeamComplete',
|
||||||
|
propTypes: {
|
||||||
|
hash: React.PropTypes.string,
|
||||||
|
email: React.PropTypes.string,
|
||||||
|
data: React.PropTypes.string
|
||||||
|
},
|
||||||
updateParent: function(state, skipSet) {
|
updateParent: function(state, skipSet) {
|
||||||
BrowserStore.setGlobalItem(this.props.hash, state);
|
BrowserStore.setGlobalItem(this.props.hash, state);
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user