Skip to content

Commit 831298a

Browse files
committed
Fix - add state to aggregator radio buttons
1 parent d2949ac commit 831298a

File tree

3 files changed

+10
-665
lines changed

3 files changed

+10
-665
lines changed

nerdlets/e2m-gui-nerdlet/form-components/aggregator-selector.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33

44
import { RadioGroup, Radio } from 'nr1';
55

6-
const AggregatorSelector = ({ setAggregator, selectedEventType }) => {
6+
const AggregatorSelector = ({ setAggregator, selectedEventType, selectedAggregator }) => {
77
/* TODO: Pull the disabledOrNotObj out to AddRule Component */
88
const disabledOrNotObj = !selectedEventType ? { disabled: true } : {};
99
return (
@@ -12,19 +12,22 @@ const AggregatorSelector = ({ setAggregator, selectedEventType }) => {
1212
{...disabledOrNotObj}
1313
label="Summary--use if the query's function is min, max, sum, count, or average"
1414
value="summary"
15-
onChange={() => setAggregator('summary')}
15+
checked={selectedAggregator == 'summary'}
16+
onClick={() => setAggregator('summary')}
1617
/>
1718
<Radio
1819
{...disabledOrNotObj}
1920
label="Distribution--use if the query's function is percentile or histogram"
2021
value="distribution"
21-
onChange={() => setAggregator('distribution')}
22+
checked={selectedAggregator == 'distribution'}
23+
onClick={() => setAggregator('distribution')}
2224
/>
2325
<Radio
2426
{...disabledOrNotObj}
2527
label="Unique Count--use if the query's function is unique count"
2628
value="uniqueCount"
27-
onChange={() => setAggregator('uniqueCount')}
29+
checked={selectedAggregator == 'uniqueCount'}
30+
onClick={() => setAggregator('uniqueCount')}
2831
/>
2932
</RadioGroup>
3033
);

0 commit comments

Comments
 (0)