diff --git a/packages/unleash-frontend-next/src/component/feature/AddFeatureToggle.jsx b/packages/unleash-frontend-next/src/component/feature/AddFeatureToggle.jsx index c2e1375211..6d97a565f9 100644 --- a/packages/unleash-frontend-next/src/component/feature/AddFeatureToggle.jsx +++ b/packages/unleash-frontend-next/src/component/feature/AddFeatureToggle.jsx @@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { Input, Switch, Button } from 'react-toolbox'; import { createFeatureToggles } from '../../store/feature-actions'; +import ConfigureStrategy from './ConfigureStrategy'; const mapStateToProps = (state) => ({ strategies: state.strategies.toJS(), @@ -15,11 +16,8 @@ class AddFeatureToggle extends React.Component { name: '', description: '', enabled: false, - strategies: [ - { name: 'default' }, - ], + strategies: [], }, - showAddStrategy: false, }; } @@ -40,11 +38,6 @@ class AddFeatureToggle extends React.Component { this.context.router.push('/features'); }; - addStrategy = (evt) => { - evt.preventDefault(); - this.setState({ showAddStrategy: true }); - } - handleChange = (key, value) => { const change = {}; change[key] = value; @@ -53,20 +46,45 @@ class AddFeatureToggle extends React.Component { this.setState({ featureToggle: updatedFeatureToggle }); }; + cancelConfig = () => { + this.setState({ configureStrategy: undefined }); + }; + renderAddStrategy () { - if (this.state.showAddStrategy) { + if (this.state.configureStrategy) { return (
Possible: {this.props.strategies.map(s => s.name).join(', ')}
+