summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-08-31 05:42:57 -0400
committerGeorge Goldberg <george@gberg.me>2017-08-31 10:42:57 +0100
commit5d74857b6827e6b809b074db61a7160d18b4d783 (patch)
tree5ae94e5970fe2818ebc69a4fd8d63d9434c9a4e7 /webapp
parentf34cd567a6332fe53dae27e6b99b4382505de7a1 (diff)
downloadchat-5d74857b6827e6b809b074db61a7160d18b4d783.tar.gz
chat-5d74857b6827e6b809b074db61a7160d18b4d783.tar.bz2
chat-5d74857b6827e6b809b074db61a7160d18b4d783.zip
Add minimum channel name length in rename modal (#7308)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/rename_channel_modal.jsx11
-rwxr-xr-xwebapp/i18n/en.json1
2 files changed, 12 insertions, 0 deletions
diff --git a/webapp/components/rename_channel_modal.jsx b/webapp/components/rename_channel_modal.jsx
index 8d36e15c7..6d7156b51 100644
--- a/webapp/components/rename_channel_modal.jsx
+++ b/webapp/components/rename_channel_modal.jsx
@@ -139,6 +139,17 @@ export class RenameChannelModal extends React.Component {
} else if (channel.display_name.length > Constants.MAX_CHANNELNAME_LENGTH) {
state.displayNameError = formatMessage(holders.maxLength, {maxLength: Constants.MAX_CHANNELNAME_LENGTH});
state.invalid = true;
+ } else if (channel.display_name.length < Constants.MIN_CHANNELNAME_LENGTH) {
+ state.displayNameError = (
+ <FormattedMessage
+ id='rename_channel.minLength'
+ defaultMessage='Channel name must be {minLength, number} or more characters'
+ values={{
+ minLength: Constants.MIN_CHANNELNAME_LENGTH
+ }}
+ />
+ );
+ state.invalid = true;
} else {
state.displayNameError = '';
}
diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json
index 720a66317..eb86f647e 100755
--- a/webapp/i18n/en.json
+++ b/webapp/i18n/en.json
@@ -2063,6 +2063,7 @@
"rename_channel.handleHolder": "lowercase alphanumeric characters",
"rename_channel.lowercase": "Must be lowercase alphanumeric characters",
"rename_channel.maxLength": "This field must be less than {maxLength, number} characters",
+ "rename_channel.minLength": "Channel name must be {minLength, number} or more characters",
"rename_channel.required": "This field is required",
"rename_channel.save": "Save",
"rename_channel.title": "Rename Channel",