Skip to content

Commit de1c66a

Browse files
authored
fix: Handles trailing space in flag value (#5324)
1 parent f681759 commit de1c66a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

frontend/web/components/modals/CreateFlag.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ const CreateFlag = class extends Component {
336336
enabled: default_enabled,
337337
feature_state_value: hasMultivariate
338338
? this.props.environmentFlag.feature_state_value
339-
: initial_value,
339+
: this.cleanInputValue(initial_value),
340340
multivariate_options: this.state.identityVariations,
341341
}),
342342
projectFlag,
@@ -352,7 +352,7 @@ const CreateFlag = class extends Component {
352352
{
353353
default_enabled,
354354
description,
355-
initial_value,
355+
initial_value: this.cleanInputValue(initial_value),
356356
is_archived,
357357
is_server_key_only,
358358
metadata:
@@ -440,6 +440,12 @@ const CreateFlag = class extends Component {
440440
}
441441
return { featureError, featureWarning }
442442
}
443+
cleanInputValue = (value) => {
444+
if (value && typeof value === 'string') {
445+
return value.trim()
446+
}
447+
return value
448+
}
443449
drawChart = (data) => {
444450
return data?.length ? (
445451
<ResponsiveContainer height={400} width='100%' className='mt-4'>

0 commit comments

Comments
 (0)