From 6abc9601bec18e5005ff16dd4147bf038dafb264 Mon Sep 17 00:00:00 2001 From: David Lu Date: Thu, 14 Jul 2016 08:18:56 -0400 Subject: PLT-3192 EE: Restricted site name to 30 characters (#3560) * Restricted site name to 30 characters * Added maxlength to TextSetting --- webapp/components/admin_console/text_setting.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webapp/components/admin_console/text_setting.jsx') 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} /> -- cgit v1.2.3-1-g7c22