Skip to content

Commit 91a2116

Browse files
committed
Merge branch 'main' into feat/hubspot
2 parents 95cb9a4 + 87cfcd9 commit 91a2116

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

frontend/common/providers/FeatureListProvider.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,26 @@ const FeatureListProvider = class extends React.Component {
5151
this.editFeatureValue(
5252
projectId,
5353
environmentId,
54+
/* todo: Saving features involves sending an adjusted project flag rather than a feature state (old tech debt).
55+
This will be removed when migrating to RTK. The following converts the feature state to the accepted format.
56+
*/
5457
{
5558
...projectFlag,
5659
default_enabled: !environmentFlag.enabled,
60+
initial_value: environmentFlag.feature_state_value,
61+
multivariate_options: projectFlag.multivariate_options.map((mv) => {
62+
const matching =
63+
environmentFlag.multivariate_feature_state_values.find(
64+
(v) => v.multivariate_feature_option == mv.id,
65+
)
66+
return {
67+
...mv,
68+
default_percentage_allocation: matching.percentage_allocation,
69+
}
70+
}),
5771
},
5872
projectFlag,
59-
{
60-
...environmentFlag,
61-
enabled: !environmentFlag.enabled,
62-
},
73+
environmentFlag,
6374
)
6475
}
6576

frontend/web/components/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ const App = class extends Component {
433433
/>
434434
)}
435435
{user && showBanner && (
436-
<Row>
436+
<Row className={'px-3'}>
437437
<InfoMessage
438438
title={announcementValue.title}
439439
infoMessageClass={'announcement'}

0 commit comments

Comments
 (0)