diff --git a/packages/unleash-frontend-next/src/component/feature/add-component.jsx b/packages/unleash-frontend-next/src/component/feature/add-component.jsx index 58ec139294..6698c25781 100644 --- a/packages/unleash-frontend-next/src/component/feature/add-component.jsx +++ b/packages/unleash-frontend-next/src/component/feature/add-component.jsx @@ -1,78 +1,88 @@ -import React, { PropTypes } from 'react'; +import React, { Component, PropTypes } from 'react'; import { Input, Switch, Button } from 'react-toolbox'; -import AddFeatureToggleStrategy from './strategies-for-toggle'; +import SelectStrategies from './strategies-for-toggle'; import SelectedStrategies from './selected-strategies'; -const AddFeatureToggleComponent = ({ - strategies, - featureToggle, - updateField, - addStrategy, - removeStrategy, - onSubmit, - onCancel, - editmode, -}) => { - const { - name, // eslint-disable-line - description, - enabled, - } = featureToggle; - const configuredStrategies = featureToggle.strategies; +class AddFeatureToggleComponent extends Component { - return ( -
-
- - + componentWillMount () { + // TODO unwind this stuff + if (this.props.initCallRequired === true) { + this.props.init(this.props.input); + } + } + + render () { + const { + input, + setValue, + addStrategy, + removeStrategy, + onSubmit, + onCancel, + editmode = false, + } = this.props; + + const { + name, // eslint-disable-line + description, + enabled, + } = input; + const configuredStrategies = input.strategies || []; + + return ( + +
+ setValue('name', v)} /> + setValue('description', v)} /> + +
+ + setValue('enabled', v)} /> +
+
+ +
+ Activation strategies + +
+ +
+ +

- +
- -
- Activation strategies - -
- -
- -
- -
- - -