diff --git a/frontend/src/component/feature/form/form-add-feature-container.jsx b/frontend/src/component/feature/form/form-add-feature-container.jsx index 6835ffbc52..332a1e9fa3 100644 --- a/frontend/src/component/feature/form/form-add-feature-container.jsx +++ b/frontend/src/component/feature/form/form-add-feature-container.jsx @@ -3,6 +3,8 @@ import { createFeatureToggles, validateName } from './../../../store/feature-act import { createMapper, createActions } from './../../input-helpers'; import AddFeatureComponent from './form-add-feature-component'; +const defaultStrategy = { name: 'default' }; + const ID = 'add-feature-toggle'; const mapStateToProps = createMapper({ id: ID, @@ -26,6 +28,8 @@ const prepare = (methods, dispatch, ownProps) => { input.strategies.forEach(s => { delete s.id; }); + } else { + input.strategies = [defaultStrategy]; } createFeatureToggles(input)(dispatch) diff --git a/frontend/src/component/feature/form/strategies-list.jsx b/frontend/src/component/feature/form/strategies-list.jsx index dabaf01aa6..c7dcd709e8 100644 --- a/frontend/src/component/feature/form/strategies-list.jsx +++ b/frontend/src/component/feature/form/strategies-list.jsx @@ -18,7 +18,11 @@ class StrategiesList extends React.Component { const { strategies, configuredStrategies, moveStrategy, removeStrategy, updateStrategy } = this.props; if (!configuredStrategies || configuredStrategies.length === 0) { - return No strategies added; + return ( +
+ No activation strategies selected. +
+ ); } const blocks = configuredStrategies.map((strategy, i) => ( diff --git a/frontend/src/component/feature/form/strategies-section.jsx b/frontend/src/component/feature/form/strategies-section.jsx index ed3c24605b..2006d82210 100644 --- a/frontend/src/component/feature/form/strategies-section.jsx +++ b/frontend/src/component/feature/form/strategies-section.jsx @@ -8,9 +8,9 @@ import { HeaderTitle } from '../../common'; class StrategiesSectionComponent extends React.Component { static propTypes = { strategies: PropTypes.array.isRequired, - addStrategy: PropTypes.func, - removeStrategy: PropTypes.func, - updateStrategy: PropTypes.func, + addStrategy: PropTypes.func.isRequired, + removeStrategy: PropTypes.func.isRequired, + updateStrategy: PropTypes.func.isRequired, fetchStrategies: PropTypes.func.isRequired, }; @@ -24,7 +24,7 @@ class StrategiesSectionComponent extends React.Component { } return ( -