summaryrefslogtreecommitdiffstats
path: root/webapp/components
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/components
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/components')
-rw-r--r--webapp/components/rename_channel_modal.jsx11
1 files changed, 11 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 = '';
}