summaryrefslogtreecommitdiffstats
path: root/webapp/components/new_channel_flow.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-08-11 10:31:56 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-08-11 10:31:56 -0400
commit0cee02d4d3ca05e1e09a918f175c8e021743e992 (patch)
treeaaf4ffc9bc396f7d5abd3ad58493587b479e4d02 /webapp/components/new_channel_flow.jsx
parent8d5aa69950032777ea7286329d920de36aaa8a73 (diff)
downloadchat-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/new_channel_flow.jsx')
-rw-r--r--webapp/components/new_channel_flow.jsx15
1 files changed, 12 insertions, 3 deletions
diff --git a/webapp/components/new_channel_flow.jsx b/webapp/components/new_channel_flow.jsx
index abec799b5..c6c265725 100644
--- a/webapp/components/new_channel_flow.jsx
+++ b/webapp/components/new_channel_flow.jsx
@@ -9,7 +9,7 @@ import UserStore from 'stores/user_store.jsx';
import NewChannelModal from './new_channel_modal.jsx';
import ChangeURLModal from './change_url_modal.jsx';
-import {intlShape, injectIntl, defineMessages} from 'react-intl';
+import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router/es6';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
@@ -124,7 +124,16 @@ class NewChannelFlow extends React.Component {
},
(err) => {
if (err.id === 'model.channel.is_valid.2_or_more.app_error') {
- this.setState({flowState: SHOW_EDIT_URL_THEN_COMPLETE});
+ this.setState({
+ flowState: SHOW_EDIT_URL_THEN_COMPLETE,
+ serverError: (
+ <FormattedMessage
+ id='channel_flow.handleTooShort'
+ defaultMessage='Channel URL must be 2 or more lowercase alphanumeric characters'
+ />
+ )
+ });
+ return;
}
if (err.id === 'store.sql_channel.update.exists.app_error') {
this.setState({serverError: Utils.localizeMessage('channel_flow.alreadyExist', 'A channel with that URL already exists')});
@@ -148,7 +157,7 @@ class NewChannelFlow extends React.Component {
if (this.state.flowState === SHOW_EDIT_URL_THEN_COMPLETE) {
this.setState({channelName: newURL, nameModified: true}, this.doSubmit);
} else {
- this.setState({flowState: SHOW_NEW_CHANNEL, serverError: '', channelName: newURL, nameModified: true});
+ this.setState({flowState: SHOW_NEW_CHANNEL, serverError: null, channelName: newURL, nameModified: true});
}
}
urlChangeDismissed() {