diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-08-11 10:31:56 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-08-11 10:31:56 -0400 |
commit | 0cee02d4d3ca05e1e09a918f175c8e021743e992 (patch) | |
tree | aaf4ffc9bc396f7d5abd3ad58493587b479e4d02 /webapp/components/change_url_modal.jsx | |
parent | 8d5aa69950032777ea7286329d920de36aaa8a73 (diff) | |
download | chat-0cee02d4d3ca05e1e09a918f175c8e021743e992.tar.gz chat-0cee02d4d3ca05e1e09a918f175c8e021743e992.tar.bz2 chat-0cee02d4d3ca05e1e09a918f175c8e021743e992.zip |
PLT-3700 Made error message for too short channel URL more clear (#3773)
Diffstat (limited to 'webapp/components/change_url_modal.jsx')
-rw-r--r-- | webapp/components/change_url_modal.jsx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/webapp/components/change_url_modal.jsx b/webapp/components/change_url_modal.jsx index 2219ff317..fa115cf36 100644 --- a/webapp/components/change_url_modal.jsx +++ b/webapp/components/change_url_modal.jsx @@ -119,16 +119,20 @@ export default class ChangeUrlModal extends React.Component { } render() { let urlClass = 'input-group input-group--limit'; - let urlError = null; - let serverError = null; + let error = null; if (this.state.urlError) { urlClass += ' has-error'; - urlError = (<p className='input__help error'>{this.state.urlError}</p>); } - if (this.props.serverError) { - serverError = <div className='form-group has-error'><p className='input__help error'>{this.props.serverError}</p></div>; + if (this.props.serverError || this.state.urlError) { + error = ( + <div className='form-group has-error'> + <p className='input__help error'> + {this.state.urlError || this.props.serverError} + </p> + </div> + ); } const fullTeamUrl = TeamStore.getCurrentTeamUrl(); @@ -173,8 +177,7 @@ export default class ChangeUrlModal extends React.Component { tabIndex='1' /> </div> - {urlError} - {serverError} + {error} </div> </div> </Modal.Body> @@ -211,7 +214,7 @@ ChangeUrlModal.defaultProps = { urlLabel: 'URL', submitButtonText: 'Save', currentURL: '', - serverError: '' + serverError: null }; ChangeUrlModal.propTypes = { @@ -221,7 +224,7 @@ ChangeUrlModal.propTypes = { urlLabel: React.PropTypes.string, submitButtonText: React.PropTypes.string, currentURL: React.PropTypes.string, - serverError: React.PropTypes.string, + serverError: React.PropTypes.node, onModalSubmit: React.PropTypes.func.isRequired, onModalDismissed: React.PropTypes.func.isRequired }; |