Skip to content

Commit 769e54b

Browse files
author
Lijun Zhang
committed
DM-9594:
Fixed the bug in RadioGroupInputView.jsx
1 parent 31dbb68 commit 769e54b

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

src/firefly/js/drawingLayers/DistanceToolUI.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function DistanceToolUI({drawLayer,pv}) {
4545
<div>
4646
Unit:
4747
<div style={{display:'inline-block', paddingLeft:7}}>
48-
<RadioGroupInputFieldView options={options} fieldKey='units' value={pref}
48+
<RadioGroupInputFieldView options={options} value={pref}
4949
onChange={(ev) => changeReadoutPref(drawLayer,pv,ev.target.value)} />
5050
</div>
5151
</div>

src/firefly/js/drawingLayers/NorthUpCompassUI.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function NorthUpCompassUI({drawLayer,pv}) {
3535
<div>
3636
Overlay:
3737
<div style={{display:'inline-block', paddingLeft:7}}>
38-
<RadioGroupInputFieldView options={options} fieldKey='overlay_option' value={pref.value}
38+
<RadioGroupInputFieldView options={options} value={pref.value}
3939
onChange={(ev) => changeOverlayPref(drawLayer,pv,ev.target.value)} />
4040
</div>
4141
</div>

src/firefly/js/templates/lightcurve/LcImageToolbarView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function LcImageToolbarView({activePlotId, viewerId, viewerPlotIds, layou
101101
<div style={{whiteSpace: 'nowrap', paddingLeft: 7}}>
102102
Image Count:
103103
<div style={{display:'inline-block', paddingLeft:7}}>
104-
<RadioGroupInputFieldView options={options} inline={true} fieldKey='frames' value={String(count)}
104+
<RadioGroupInputFieldView options={options} inline={true} value={String(count)}
105105
onChange={(ev) => changeSize(viewerId, ev.target.value)} />
106106
</div>
107107
</div>

src/firefly/js/ui/PointShapeSizePicker.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class ShapePickerWrapper extends Component {
240240
}}>
241241
<div style={{display: 'flex', marginLeft: mLeft}} >
242242
<div style={{width: labelW, color: textColor}} title={'pick a symbol'}>Symbols:</div>
243-
<RadioGroupInputFieldView fieldKey='pointoptions'
243+
<RadioGroupInputFieldView
244244
onChange={this.updateSymbol}
245245
tooltip='available symbol shapes'
246246
options={options}

src/firefly/js/ui/RadioGroupInputFieldView.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ const vStyle={paddingLeft: 3, paddingRight: 8};
66
const hStyle={paddingLeft: 0, paddingRight: 12};
77

88

9-
function makeOptions(options,alignment,fieldKey,value,onChange,tooltip) {
9+
function makeOptions(options,alignment ,value,onChange,tooltip) {
1010

1111
const labelStyle= alignment==='vertical' ? vStyle : hStyle;
12-
const uniqueName = uniqueId(fieldKey);
1312
return options.map((option) => (
1413
<span key={option.value}>
1514
<div style={{display:'inline-block'}} title={tooltip}>
1615
<input type='radio'
1716
title={tooltip}
18-
name={uniqueName}
1917
value={option.value}
2018
checked={value===option.value}
2119
onChange={onChange}
@@ -26,7 +24,7 @@ function makeOptions(options,alignment,fieldKey,value,onChange,tooltip) {
2624
));
2725
}
2826

29-
export function RadioGroupInputFieldView({options,alignment,fieldKey,value,
27+
export function RadioGroupInputFieldView({options,alignment,value,
3028
onChange,label,inline,tooltip,
3129
labelWidth, wrapperStyle={}}) {
3230
const style= Object.assign({whiteSpace:'nowrap',display: inline?'inline-block':'block'},wrapperStyle);
@@ -37,15 +35,14 @@ export function RadioGroupInputFieldView({options,alignment,fieldKey,value,
3735
<div style={style}>
3836
{label && <InputFieldLabel label={label} tooltip={tooltip} labelWidth={labelWidth} /> }
3937
<div style={radioStyle} >
40-
{makeOptions(options,alignment,fieldKey,value,onChange,tooltip)}
38+
{makeOptions(options,alignment,value,onChange,tooltip)}
4139
</div>
4240
</div>
4341
);
4442
}
4543

4644
RadioGroupInputFieldView.propTypes= {
4745
options: PropTypes.array.isRequired,
48-
fieldKey: PropTypes.string.isRequired,
4946
value: PropTypes.string.isRequired,
5047
alignment: PropTypes.string,
5148
onChange: PropTypes.func,

0 commit comments

Comments
 (0)