diff options
Diffstat (limited to 'web/react/components/user_settings')
3 files changed, 32 insertions, 9 deletions
diff --git a/web/react/components/user_settings/custom_theme_chooser.jsx b/web/react/components/user_settings/custom_theme_chooser.jsx index 35f836adb..778c74c23 100644 --- a/web/react/components/user_settings/custom_theme_chooser.jsx +++ b/web/react/components/user_settings/custom_theme_chooser.jsx @@ -3,6 +3,9 @@ import Constants from '../../utils/constants.jsx'; +const OverlayTrigger = ReactBootstrap.OverlayTrigger; +const Popover = ReactBootstrap.Popover; + export default class CustomThemeChooser extends React.Component { constructor(props) { super(props); @@ -72,6 +75,19 @@ export default class CustomThemeChooser extends React.Component { ); }); + var popoverContent = ( + <Popover + bsStyle='info' + id='code-popover' + className='code-popover' + > + <img + width='200' + src={'/static/images/themes/code_themes/' + theme[element.id] + 'Large.png'} + /> + </Popover> + ); + elements.push( <div className='col-sm-4 form-group' @@ -90,11 +106,17 @@ export default class CustomThemeChooser extends React.Component { > {codeThemeOptions} </select> + <OverlayTrigger + placement='top' + overlay={popoverContent} + ref='headerOverlay' + > <span className='input-group-addon'> <img src={'/static/images/themes/code_themes/' + theme[element.id] + '.png'} /> </span> + </OverlayTrigger> </div> </div> ); diff --git a/web/react/components/user_settings/manage_outgoing_hooks.jsx b/web/react/components/user_settings/manage_outgoing_hooks.jsx index 9c0fe3709..ede639691 100644 --- a/web/react/components/user_settings/manage_outgoing_hooks.jsx +++ b/web/react/components/user_settings/manage_outgoing_hooks.jsx @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import LoadingScreen from '../loading_screen.jsx'; @@ -36,7 +36,7 @@ export default class ManageOutgoingHooks extends React.Component { if (this.state.triggerWords.length !== 0) { hook.trigger_words = this.state.triggerWords.trim().split(','); } - hook.callback_urls = this.state.callbackURLs.split('\n'); + hook.callback_urls = this.state.callbackURLs.split('\n').map((url) => url.trim()); Client.addOutgoingHook( hook, diff --git a/web/react/components/user_settings/user_settings_general.jsx b/web/react/components/user_settings/user_settings_general.jsx index 962efd7a2..7c1a1297f 100644 --- a/web/react/components/user_settings/user_settings_general.jsx +++ b/web/react/components/user_settings/user_settings_general.jsx @@ -51,7 +51,7 @@ export default class UserSettingsGeneralTab extends React.Component { } if (user.username === username) { - this.setState({clientError: 'You must submit a new username.', emailError: '', serverError: ''}); + this.updateSection(''); return; } @@ -66,7 +66,7 @@ export default class UserSettingsGeneralTab extends React.Component { const nickname = this.state.nickname.trim(); if (user.nickname === nickname) { - this.setState({clientError: 'You must submit a new nickname.', emailError: '', serverError: ''}); + this.updateSection(''); return; } @@ -82,7 +82,7 @@ export default class UserSettingsGeneralTab extends React.Component { const lastName = this.state.lastName.trim(); if (user.first_name === firstName && user.last_name === lastName) { - this.setState({clientError: 'You must submit a new first or last name.', emailError: '', serverError: ''}); + this.updateSection(''); return; } @@ -98,10 +98,6 @@ export default class UserSettingsGeneralTab extends React.Component { const email = this.state.email.trim().toLowerCase(); const confirmEmail = this.state.confirmEmail.trim().toLowerCase(); - if (user.email === email) { - return; - } - if (email === '' || !Utils.isEmail(email)) { this.setState({emailError: 'Please enter a valid email address.', clientError: '', serverError: ''}); return; @@ -112,6 +108,11 @@ export default class UserSettingsGeneralTab extends React.Component { return; } + if (user.email === email) { + this.updateSection(''); + return; + } + user.email = email; this.submitUser(user, true); } |