From dc2e73305858bad53a9f1d1cba407649890d2497 Mon Sep 17 00:00:00 2001
From: Ruzette Tanyag <ruzette@users.noreply.github.com>
Date: Tue, 14 Mar 2017 12:06:31 -0400
Subject: PLT-5764 Fixed channel name minimum length (#5693)

* make sure that we use constants for channel name min length

* changed channel name error to match channel URL error

* changed constant max channel name length to 22 and reapply in modal

* reverted dutch translation
---
 webapp/components/new_channel_modal.jsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'webapp/components/new_channel_modal.jsx')

diff --git a/webapp/components/new_channel_modal.jsx b/webapp/components/new_channel_modal.jsx
index 2f9533b0e..f16b4596f 100644
--- a/webapp/components/new_channel_modal.jsx
+++ b/webapp/components/new_channel_modal.jsx
@@ -77,7 +77,7 @@ export default class NewChannelModal extends React.Component {
         e.preventDefault();
 
         const displayName = ReactDOM.findDOMNode(this.refs.display_name).value.trim();
-        if (displayName.length < 1) {
+        if (displayName.length < Constants.MIN_CHANNELNAME_LENGTH) {
             this.setState({displayNameError: true});
             return;
         }
@@ -104,7 +104,7 @@ export default class NewChannelModal extends React.Component {
                 <p className='input__help error'>
                     <FormattedMessage
                         id='channel_modal.displayNameError'
-                        defaultMessage='This field is required'
+                        defaultMessage='Channel name must be 2 or more characters'
                     />
                     {this.state.displayNameError}
                 </p>
@@ -232,7 +232,7 @@ export default class NewChannelModal extends React.Component {
                                         ref='display_name'
                                         className='form-control'
                                         placeholder={Utils.localizeMessage('channel_modal.nameEx', 'E.g.: "Bugs", "Marketing", "客户支持"')}
-                                        maxLength='22'
+                                        maxLength={Constants.MAX_CHANNELNAME_LENGTH}
                                         value={this.props.channelData.displayName}
                                         autoFocus={true}
                                         tabIndex='1'
-- 
cgit v1.2.3-1-g7c22

