diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/channel_info_modal.jsx | 12 | ||||
-rw-r--r-- | web/react/components/rhs_thread.jsx | 12 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_security.jsx | 6 |
3 files changed, 23 insertions, 7 deletions
diff --git a/web/react/components/channel_info_modal.jsx b/web/react/components/channel_info_modal.jsx index 18e125de3..72c7c3daa 100644 --- a/web/react/components/channel_info_modal.jsx +++ b/web/react/components/channel_info_modal.jsx @@ -1,6 +1,7 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. +import * as Utils from '../utils/utils.jsx'; const Modal = ReactBootstrap.Modal; export default class ChannelInfoModal extends React.Component { @@ -10,10 +11,13 @@ export default class ChannelInfoModal extends React.Component { channel = { display_name: 'No Channel Found', name: 'No Channel Found', + purpose: 'No Channel Found', id: 'No Channel Found' }; } + const channelURL = Utils.getShortenedTeamURL() + channel.name; + return ( <Modal show={this.props.show} @@ -28,13 +32,17 @@ export default class ChannelInfoModal extends React.Component { <div className='col-sm-9'>{channel.display_name}</div> </div> <div className='row form-group'> - <div className='col-sm-3 info__label'>{'Channel Handle:'}</div> - <div className='col-sm-9'>{channel.name}</div> + <div className='col-sm-3 info__label'>{'Channel URL:'}</div> + <div className='col-sm-9'>{channelURL}</div> </div> <div className='row'> <div className='col-sm-3 info__label'>{'Channel ID:'}</div> <div className='col-sm-9'>{channel.id}</div> </div> + <div className='row'> + <div className='col-sm-3 info__label'>{'Channel Purpose:'}</div> + <div className='col-sm-9'>{channel.purpose}</div> + </div> </Modal.Body> <Modal.Footer> <button diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx index 2edcd8b37..945b09e37 100644 --- a/web/react/components/rhs_thread.jsx +++ b/web/react/components/rhs_thread.jsx @@ -17,6 +17,8 @@ export default class RhsThread extends React.Component { constructor(props) { super(props); + this.mounted = false; + this.onChange = this.onChange.bind(this); this.onChangeAll = this.onChangeAll.bind(this); this.forceUpdateInfo = this.forceUpdateInfo.bind(this); @@ -50,8 +52,11 @@ export default class RhsThread extends React.Component { PostStore.addSelectedPostChangeListener(this.onChange); PostStore.addChangeListener(this.onChangeAll); PreferenceStore.addChangeListener(this.forceUpdateInfo); + this.resize(); window.addEventListener('resize', this.handleResize); + + this.mounted = true; } componentDidUpdate() { if ($('.post-right__scroll')[0]) { @@ -63,7 +68,10 @@ export default class RhsThread extends React.Component { PostStore.removeSelectedPostChangeListener(this.onChange); PostStore.removeChangeListener(this.onChangeAll); PreferenceStore.removeChangeListener(this.forceUpdateInfo); + window.removeEventListener('resize', this.handleResize); + + this.mounted = false; } forceUpdateInfo() { if (this.state.postList) { @@ -82,7 +90,7 @@ export default class RhsThread extends React.Component { } onChange() { var newState = this.getStateFromStores(); - if (!Utils.areObjectsEqual(newState, this.state)) { + if (this.mounted && !Utils.areObjectsEqual(newState, this.state)) { this.setState(newState); } } @@ -120,7 +128,7 @@ export default class RhsThread extends React.Component { } var newState = this.getStateFromStores(); - if (!Utils.areObjectsEqual(newState, this.state)) { + if (this.mounted && !Utils.areObjectsEqual(newState, this.state)) { this.setState(newState); } } diff --git a/web/react/components/user_settings/user_settings_security.jsx b/web/react/components/user_settings/user_settings_security.jsx index d9c5f58a9..d1266dd3f 100644 --- a/web/react/components/user_settings/user_settings_security.jsx +++ b/web/react/components/user_settings/user_settings_security.jsx @@ -206,7 +206,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email)} > {'Switch to using email and password'} </a> @@ -221,7 +221,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email + '&new_type=' + Constants.GITLAB_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GITLAB_SERVICE} > {'Switch to using GitLab SSO'} </a> @@ -236,7 +236,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email + '&new_type=' + Constants.GOOGLE_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GOOGLE_SERVICE} > {'Switch to using Google SSO'} </a> |