diff options
author | David Lu <david.lu@hotmail.com> | 2016-07-14 08:18:56 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-07-14 08:18:56 -0400 |
commit | 6abc9601bec18e5005ff16dd4147bf038dafb264 (patch) | |
tree | c7e6c8611365e84ddf237e6ec661b35a50011f23 /webapp | |
parent | 294981d4a3a36d48c983a3a92cf423910347b4c4 (diff) | |
download | chat-6abc9601bec18e5005ff16dd4147bf038dafb264.tar.gz chat-6abc9601bec18e5005ff16dd4147bf038dafb264.tar.bz2 chat-6abc9601bec18e5005ff16dd4147bf038dafb264.zip |
PLT-3192 EE: Restricted site name to 30 characters (#3560)
* Restricted site name to 30 characters
* Added maxlength to TextSetting
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/admin_console/custom_brand_settings.jsx | 2 | ||||
-rw-r--r-- | webapp/components/admin_console/text_setting.jsx | 6 | ||||
-rw-r--r-- | webapp/utils/constants.jsx | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/webapp/components/admin_console/custom_brand_settings.jsx b/webapp/components/admin_console/custom_brand_settings.jsx index 193889ea9..b4026c4a9 100644 --- a/webapp/components/admin_console/custom_brand_settings.jsx +++ b/webapp/components/admin_console/custom_brand_settings.jsx @@ -11,6 +11,7 @@ import BrandImageSetting from './brand_image_setting.jsx'; import {FormattedMessage} from 'react-intl'; import SettingsGroup from './settings_group.jsx'; import TextSetting from './text_setting.jsx'; +import Constants from 'utils/constants.jsx'; export default class CustomBrandSettings extends AdminSettings { constructor(props) { @@ -115,6 +116,7 @@ export default class CustomBrandSettings extends AdminSettings { defaultMessage='Site Name:' /> } + maxLength={Constants.MAX_SITENAME_LENGTH} placeholder={Utils.localizeMessage('admin.team.siteNameExample', 'Ex "Mattermost"')} helpText={ <FormattedMessage diff --git a/webapp/components/admin_console/text_setting.jsx b/webapp/components/admin_console/text_setting.jsx index bb37f8e29..a5844aca7 100644 --- a/webapp/components/admin_console/text_setting.jsx +++ b/webapp/components/admin_console/text_setting.jsx @@ -4,6 +4,7 @@ import React from 'react'; import Setting from './setting.jsx'; +import Constants from 'utils/constants.jsx'; export default class TextSetting extends React.Component { static get propTypes() { @@ -16,6 +17,7 @@ export default class TextSetting extends React.Component { React.PropTypes.string, React.PropTypes.number ]).isRequired, + maxLength: React.PropTypes.number, onChange: React.PropTypes.func.isRequired, disabled: React.PropTypes.bool, type: React.PropTypes.oneOf([ @@ -27,7 +29,8 @@ export default class TextSetting extends React.Component { static get defaultProps() { return { - type: 'input' + type: 'input', + maxLength: Constants.MAX_TEXTSETTING_LENGTH }; } @@ -51,6 +54,7 @@ export default class TextSetting extends React.Component { type='text' placeholder={this.props.placeholder} value={this.props.value} + maxLength={this.props.maxLength} onChange={this.handleChange} disabled={this.props.disabled} /> diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx index 52fb23d51..df9cb3ba4 100644 --- a/webapp/utils/constants.jsx +++ b/webapp/utils/constants.jsx @@ -761,6 +761,8 @@ export default { MAX_PASSWORD_LENGTH: 64, MIN_TRIGGER_LENGTH: 1, MAX_TRIGGER_LENGTH: 128, + MAX_TEXTSETTING_LENGTH: 1024, + MAX_SITENAME_LENGTH: 30, TIME_SINCE_UPDATE_INTERVAL: 30000, MIN_HASHTAG_LINK_LENGTH: 3, CHANNEL_SCROLL_ADJUSTMENT: 100, |