From 84c82e8d7a1a7e4ec8808b86ff5bea78138d1886 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 18 Aug 2015 09:15:16 -0700 Subject: Renamed new component files for easier identification --- .../team_signup_allowed_domains_page.jsx | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 web/react/components/team_signup_allowed_domains_page.jsx (limited to 'web/react/components/team_signup_allowed_domains_page.jsx') diff --git a/web/react/components/team_signup_allowed_domains_page.jsx b/web/react/components/team_signup_allowed_domains_page.jsx new file mode 100644 index 000000000..90c7ff668 --- /dev/null +++ b/web/react/components/team_signup_allowed_domains_page.jsx @@ -0,0 +1,98 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var client = require('../utils/client.jsx'); + +module.exports = React.createClass({ + displayName: 'TeamSignupAllowedDomainsPage', + propTypes: { + state: React.PropTypes.object, + updateParent: React.PropTypes.func + }, + submitBack: function(e) { + e.preventDefault(); + this.props.state.wizard = 'team_url'; + this.props.updateParent(this.props.state); + }, + submitNext: function(e) { + e.preventDefault(); + + if (this.refs.open_network.getDOMNode().checked) { + this.props.state.wizard = 'send_invites'; + this.props.state.team.type = 'O'; + this.props.updateParent(this.props.state); + return; + } + + if (this.refs.allow.getDOMNode().checked) { + var name = this.refs.name.getDOMNode().value.trim(); + var domainRegex = /^\w+\.\w+$/; + if (!name) { + this.setState({nameError: 'This field is required'}); + return; + } + + if (!name.trim().match(domainRegex)) { + this.setState({nameError: 'The domain doesn\'t appear valid'}); + return; + } + + this.props.state.wizard = 'send_invites'; + this.props.state.team.allowed_domains = name; + this.props.state.team.type = 'I'; + this.props.updateParent(this.props.state); + } else { + this.props.state.wizard = 'send_invites'; + this.props.state.team.type = 'I'; + this.props.updateParent(this.props.state); + } + }, + getInitialState: function() { + return {}; + }, + render: function() { + client.track('signup', 'signup_team_04_allow_domains'); + + var nameError = null; + var nameDivClass = 'form-group'; + if (this.state.nameError) { + nameError = ; + nameDivClass += ' has-error'; + } + + return ( +
+
+ +

Email Domain

+

+

+ +
+

+

{'Check this box to allow your ' + strings.Team + ' members to sign up using their ' + strings.Company + ' email addresses if you share the same domain--otherwise, you need to invite everyone yourself.'}

+

{'Your ' + strings.Team + '\'s domain for emails'}

+
+
+
+
+ @ + +
+
+
+ {nameError} +
+

To allow signups from multiple domains, separate each with a comma.

+

+

+ +
+

+   + +
+
+ ); + } +}); -- cgit v1.2.3-1-g7c22