diff --git a/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx b/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx index ece66d3af8..62ac98fc01 100644 --- a/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx +++ b/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx @@ -46,6 +46,7 @@ const AddVariant = ({ name: editVariant.name, weight: editVariant.weight / 10, weightType: editVariant.weightType || weightTypes.VARIABLE, + stickiness: editVariant.stickiness }); if (editVariant.payload) { setPayload(editVariant.payload); @@ -100,6 +101,7 @@ const AddVariant = ({ name: data.name, weight: data.weight * 10, weightType: data.weightType, + stickiness: data.stickiness, payload: payload.value ? payload : undefined, overrides: overrides .map(o => ({ diff --git a/frontend/src/component/feature/variant/__tests__/__snapshots__/update-variant-component-test.jsx.snap b/frontend/src/component/feature/variant/__tests__/__snapshots__/update-variant-component-test.jsx.snap index 9e86b3c067..ed8e643691 100644 --- a/frontend/src/component/feature/variant/__tests__/__snapshots__/update-variant-component-test.jsx.snap +++ b/frontend/src/component/feature/variant/__tests__/__snapshots__/update-variant-component-test.jsx.snap @@ -522,7 +522,7 @@ exports[`renders correctly with with variants 1`] = ` By overriding the stickiness you can control which parameter you want to be used in order to ensure consistent traffic allocation across variants. diff --git a/frontend/src/component/feature/variant/update-variant-component.jsx b/frontend/src/component/feature/variant/update-variant-component.jsx index 8154add14d..4305f8513f 100644 --- a/frontend/src/component/feature/variant/update-variant-component.jsx +++ b/frontend/src/component/feature/variant/update-variant-component.jsx @@ -129,9 +129,8 @@ class UpdateVariantComponent extends Component { you want to be used in order to ensure consistent traffic allocation across variants.{' '} Read more diff --git a/frontend/src/component/feature/variant/update-variant-container.jsx b/frontend/src/component/feature/variant/update-variant-container.jsx index 20868a5221..063cb5cd3a 100644 --- a/frontend/src/component/feature/variant/update-variant-container.jsx +++ b/frontend/src/component/feature/variant/update-variant-container.jsx @@ -16,6 +16,9 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ addVariant: variant => { const { featureToggle } = ownProps; const currentVariants = featureToggle.variants || []; + const stickiness = currentVariants[0].stickiness || 'default'; + variant.stickiness = stickiness; + const variants = [...currentVariants, variant]; updateWeight(variants, 1000); return requestUpdateFeatureToggleVariants(