diff --git a/frontend/src/component/feature/form-add-container.jsx b/frontend/src/component/feature/form-add-container.jsx index e153aee10c..cf2aca15e6 100644 --- a/frontend/src/component/feature/form-add-container.jsx +++ b/frontend/src/component/feature/form-add-container.jsx @@ -32,6 +32,7 @@ const prepare = (methods, dispatch) => { }; methods.addStrategy = (v) => { + v.id = Math.round(Math.random() * 10000000); methods.pushToList('strategies', v); }; diff --git a/frontend/src/component/feature/form-edit-container.jsx b/frontend/src/component/feature/form-edit-container.jsx index 7605b994af..f19d36c67a 100644 --- a/frontend/src/component/feature/form-edit-container.jsx +++ b/frontend/src/component/feature/form-edit-container.jsx @@ -13,7 +13,12 @@ function getId (props) { // best is to emulate the "input-storage"? const mapStateToProps = createMapper({ id: getId, - getDefault: (state, ownProps) => ownProps.featureToggle, + getDefault: (state, ownProps) => { + ownProps.featureToggle.strategies.forEach((strategy, index) => { + strategy.id = Math.round(Math.random() * 1000000 * (1 + index)); + }); + return ownProps.featureToggle; + }, prepare: (props) => { props.editmode = true; return props; @@ -38,6 +43,7 @@ const prepare = (methods, dispatch) => { }; methods.addStrategy = (v) => { + v.id = Math.round(Math.random() * 10000000); methods.pushToList('strategies', v); }; diff --git a/frontend/src/component/feature/form/strategies-list.jsx b/frontend/src/component/feature/form/strategies-list.jsx index 3bf2d8d84a..d8d752ae5f 100644 --- a/frontend/src/component/feature/form/strategies-list.jsx +++ b/frontend/src/component/feature/form/strategies-list.jsx @@ -32,7 +32,7 @@ class StrategiesList extends React.Component { const blocks = configuredStrategies.map((strategy, i) => (