diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/login.jsx | 68 | ||||
-rw-r--r-- | web/react/components/setting_item_max.jsx | 2 | ||||
-rw-r--r-- | web/react/components/user_settings_modal.jsx | 8 | ||||
-rw-r--r-- | web/react/stores/browser_store.jsx | 2 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 6 |
5 files changed, 63 insertions, 23 deletions
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index b61ea931e..678a2ff87 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -7,8 +7,13 @@ var UserStore = require('../stores/user_store.jsx'); var BrowserStore = require('../stores/browser_store.jsx'); var Constants = require('../utils/constants.jsx'); -module.exports = React.createClass({ - handleSubmit: function(e) { +export default class Login extends React.Component { + constructor(props) { + super(props); + this.handleSubmit = this.handleSubmit.bind(this); + this.state = {}; + } + handleSubmit(e) { e.preventDefault(); var state = {}; @@ -49,9 +54,9 @@ module.exports = React.createClass({ var redirect = utils.getUrlParameter('redirect'); if (redirect) { - window.location.pathname = decodeURIComponent(redirect); + window.location.href = decodeURIComponent(redirect); } else { - window.location.pathname = '/' + name + '/channels/town-square'; + window.location.href = '/' + name + '/channels/town-square'; } }, function loginFailed(err) { @@ -64,11 +69,8 @@ module.exports = React.createClass({ this.setState(state); }.bind(this) ); - }, - getInitialState: function() { - return { }; - }, - render: function() { + } + render() { var serverError; if (this.state.serverError) { serverError = <label className='control-label'>{this.state.serverError}</label>; @@ -124,13 +126,33 @@ module.exports = React.createClass({ {serverError} </div> <div className={'form-group' + errorClass}> - <input autoFocus={focusEmail} type='email' className='form-control' name='email' defaultValue={priorEmail} ref='email' placeholder='Email' /> + <input + autoFocus={focusEmail} + type='email' + className='form-control' + name='email' + defaultValue={priorEmail} + ref='email' + placeholder='Email' + /> </div> <div className={'form-group' + errorClass}> - <input autoFocus={focusPassword} type='password' className='form-control' name='password' ref='password' placeholder='Password' /> + <input + autoFocus={focusPassword} + type='password' + className='form-control' + name='password' + ref='password' + placeholder='Password' + /> </div> <div className='form-group'> - <button type='submit' className='btn btn-primary'>Sign in</button> + <button + type='submit' + className='btn btn-primary' + > + Sign in + </button> </div> {loginMessage} <div className='form-group margin--extra form-group--small'> @@ -140,10 +162,28 @@ module.exports = React.createClass({ <a href={'/' + teamName + '/reset_password'}>I forgot my password</a> </div> <div className='margin--extra'> - <span>{'Want to create your own ' + strings.Team + '?'} <a href='/' className='signup-team-login'>Sign up now</a></span> + <span>{'Want to create your own ' + strings.Team + '? '} + <a + href='/' + className='signup-team-login' + > + Sign up now + </a> + </span> </div> </form> </div> ); } -}); +} + +Login.defaultProps = { + teamName: '', + teamDisplayName: '', + authServices: '' +}; +Login.propTypes = { + teamName: React.PropTypes.string, + teamDisplayName: React.PropTypes.string, + authServices: React.PropTypes.string +}; diff --git a/web/react/components/setting_item_max.jsx b/web/react/components/setting_item_max.jsx index d3d386534..fd95b8b32 100644 --- a/web/react/components/setting_item_max.jsx +++ b/web/react/components/setting_item_max.jsx @@ -3,7 +3,7 @@ module.exports = React.createClass({ render: function() { - var clientError = this.props.clientError ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.clientError }</label></div> : null; + var clientError = this.props.client_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.client_error }</label></div> : null; var server_error = this.props.server_error ? <div className='form-group'><label className='col-sm-12 has-error'>{ this.props.server_error }</label></div> : null; var inputs = this.props.inputs; diff --git a/web/react/components/user_settings_modal.jsx b/web/react/components/user_settings_modal.jsx index 7181c4020..f5a555951 100644 --- a/web/react/components/user_settings_modal.jsx +++ b/web/react/components/user_settings_modal.jsx @@ -26,10 +26,10 @@ module.exports = React.createClass({ }, render: function() { var tabs = []; - tabs.push({name: "general", ui_name: "General", icon: "glyphicon glyphicon-cog"}); - tabs.push({name: "security", ui_name: "Security", icon: "glyphicon glyphicon-lock"}); - tabs.push({name: "notifications", ui_name: "Notifications", icon: "glyphicon glyphicon-exclamation-sign"}); - tabs.push({name: "appearance", ui_name: "Appearance", icon: "glyphicon glyphicon-wrench"}); + tabs.push({name: "general", uiName: "General", icon: "glyphicon glyphicon-cog"}); + tabs.push({name: "security", uiName: "Security", icon: "glyphicon glyphicon-lock"}); + tabs.push({name: "notifications", uiName: "Notifications", icon: "glyphicon glyphicon-exclamation-sign"}); + tabs.push({name: "appearance", uiName: "Appearance", icon: "glyphicon glyphicon-wrench"}); return ( <div className="modal fade" ref="modal" id="user_settings" role="dialog" tabIndex="-1" aria-hidden="true"> diff --git a/web/react/stores/browser_store.jsx b/web/react/stores/browser_store.jsx index 436b8d76d..b1f51e5f4 100644 --- a/web/react/stores/browser_store.jsx +++ b/web/react/stores/browser_store.jsx @@ -10,7 +10,7 @@ function getPrefix() { } // Also change model/utils.go ETAG_ROOT_VERSION -var BROWSER_STORE_VERSION = '.4'; +var BROWSER_STORE_VERSION = '.5'; module.exports = { initialized: false, diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index c2d250e74..df7a1e697 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -631,9 +631,9 @@ module.exports.changeCss = function(className, classValue) { // we need invisible container to store additional css definitions var cssMainContainer = $('#css-modifier-container'); if (cssMainContainer.length === 0) { - var cssMainContainer2 = $('<div id="css-modifier-container"></div>'); - cssMainContainer2.hide(); - cssMainContainer2.appendTo($('body')); + cssMainContainer = $('<div id="css-modifier-container"></div>'); + cssMainContainer.hide(); + cssMainContainer.appendTo($('body')); } // and we need one div for each class |