Skip to content

Commit

Permalink
adding value property to select options
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Apr 10, 2020
1 parent 93971db commit fd62aa0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ function FormRow({
return (
<SelectWithPlaceholder
placeholder={setting.placeholder}
options={[{ text: 'true' }, { text: 'false' }]}
options={[
{ text: 'true', value: 'true' },
{ text: 'false', value: 'false' }
]}
value={value}
onChange={e => onChange(setting.key, e.target.value)}
/>
Expand Down Expand Up @@ -105,7 +108,7 @@ function FormRow({
defaultMessage: 'Select unit'
})}
value={unit}
options={setting.units?.map(text => ({ text }))}
options={setting.units?.map(text => ({ text, value: text }))}
onChange={e =>
onChange(
setting.key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export const generalSettings: RawSettingDefinition[] = [
}
),
options: [
{ text: 'off' },
{ text: 'errors' },
{ text: 'transactions' },
{ text: 'all' }
{ text: 'off', value: 'off' },
{ text: 'errors', value: 'errors' },
{ text: 'transactions', value: 'transactions' },
{ text: 'all', value: 'all' }
],
excludeAgents: ['js-base', 'rum-js']
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface FloatSetting extends BaseSetting {

interface SelectSetting extends BaseSetting {
type: 'select';
options: Array<{ text: string }>;
options: Array<{ text: string; value: string }>;
}

interface BooleanSetting extends BaseSetting {
Expand Down

0 comments on commit fd62aa0

Please sign in to comment.