summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorRuzette Tanyag <ruzette@users.noreply.github.com>2017-03-14 12:06:31 -0400
committerChristopher Speller <crspeller@gmail.com>2017-03-14 12:06:31 -0400
commitdc2e73305858bad53a9f1d1cba407649890d2497 (patch)
tree32c1b4587bb788223c76861bd34a0da8bf2a638f /webapp
parentfa47132b8f1d6d889450021f6afbdc903208ac41 (diff)
downloadchat-dc2e73305858bad53a9f1d1cba407649890d2497.tar.gz
chat-dc2e73305858bad53a9f1d1cba407649890d2497.tar.bz2
chat-dc2e73305858bad53a9f1d1cba407649890d2497.zip
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
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/new_channel_modal.jsx6
-rw-r--r--webapp/i18n/en.json2
-rw-r--r--webapp/utils/constants.jsx2
3 files changed, 6 insertions, 4 deletions
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'
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index cb08c9b5e..36c016c23 100644
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -1124,7 +1124,7 @@
"channel_modal.channel": "Channel",
"channel_modal.createNew": "Create New ",
"channel_modal.descriptionHelp": "Describe how this {term} should be used.",
- "channel_modal.displayNameError": "This field is required",
+ "channel_modal.displayNameError": "Channel name must be 2 or more characters",
"channel_modal.edit": "Edit",
"channel_modal.group": "Group",
"channel_modal.header": "Header",
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 39dca99b3..3a16992ca 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -868,6 +868,8 @@ export const Constants = {
DEFAULT_MAX_NOTIFICATIONS_PER_CHANNEL: 1000,
MAX_TEAMNAME_LENGTH: 15,
MAX_TEAMDESCRIPTION_LENGTH: 50,
+ MIN_CHANNELNAME_LENGTH: 2,
+ MAX_CHANNELNAME_LENGTH: 22,
MIN_USERNAME_LENGTH: 3,
MAX_USERNAME_LENGTH: 22,
MAX_NICKNAME_LENGTH: 22,