From 5d74857b6827e6b809b074db61a7160d18b4d783 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 31 Aug 2017 05:42:57 -0400 Subject: Add minimum channel name length in rename modal (#7308) --- webapp/components/rename_channel_modal.jsx | 11 +++++++++++ webapp/i18n/en.json | 1 + 2 files changed, 12 insertions(+) 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 = ( + + ); + 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", -- cgit v1.2.3-1-g7c22