var React = require('react'); var FeatureList = require('./FeatureList'); var FeatureForm = require('./FeatureForm'); var FeatureActions = require('../../stores/FeatureToggleActions'); var ErrorActions = require('../../stores/ErrorActions'); var FeatureTogglesComponent = React.createClass({ getInitialState: function() { return { createView: false }; }, updateFeature: function (feature) { FeatureActions.update.triggerPromise(feature); }, archiveFeature: function (feature) { FeatureActions.archive.triggerPromise(feature); }, createFeature: function (feature) { FeatureActions.create.triggerPromise(feature) .then(this.cancelNewFeature); }, newFeature: function() { this.setState({createView: true}); }, cancelNewFeature: function () { this.setState({createView: false}); ErrorActions.clear(); }, render: function() { return (