diff --git a/unleash-server/public/js/unleash.jsx b/unleash-server/public/js/unleash.jsx index eadc60c70a..9cc7c0317a 100644 --- a/unleash-server/public/js/unleash.jsx +++ b/unleash-server/public/js/unleash.jsx @@ -18,44 +18,72 @@ var FeatureForm = React.createClass({ + getInitialState: function () { + return {name: '', description: '', strategy: 'Default'}; + }, + + handleNameChange: function(e) { this.setState({name: e.target.value.trim()}); }, + handleDescriptionChange: function(e) { this.setState({description: e.target.value.trim()}); }, + handleStrategyChange: function(e) { this.setState({strategy: e.target.value.trim()}); }, + + handleSubmit: function(e) { + e.preventDefault(); + this.props.onFeatureSubmit(this.state); + return; + }, + render: function () { return ( -