Skip to content

Commit

Permalink
Merge pull request #5893 from influxdata/5889/aggregation_fn_optional
Browse files Browse the repository at this point in the history
feat(ui): make aggregation function optional in Flux Query Builder
  • Loading branch information
sranka authored Mar 21, 2022
2 parents eed35a1 + 75585c3 commit 4d7c772
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. [#5881](https://github.com/influxdata/chronograf/pull/5881): Highlight that Script Builder keys/values depend on the selected time range.

1. [#5856](https://github.com/influxdata/chronograf/pull/5856): Add alert rule options to not send alert on state recovery and send regardless of state change.
1. [#5893](https://github.com/influxdata/chronograf/pull/5893): Make aggregation function selection optional.

### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'

import {connect} from 'react-redux'
import {notify as notifyAction} from 'src/shared/actions/notifications'
import {fluxWizardError} from 'src/shared/copy/notifications'

import {ComponentSize, SlideToggle} from 'src/reusable_ui'
import ReactTooltip from 'react-tooltip'
Expand Down Expand Up @@ -122,16 +121,7 @@ const AggregationSelector = (props: Props & {children?: JSX.Element}) => {
const newSelected = active
? selectedFunctions.filter(x => x !== fn)
: [fn, ...selectedFunctions]
// at least one function must be selected
if (newSelected.length) {
setSelectedFunctions(newSelected)
} else {
props.notify(
fluxWizardError(
'You must have at least one aggregation function selected'
)
)
}
setSelectedFunctions(newSelected)
}

const id = `flx-agrselect${fn}`
Expand Down

0 comments on commit 4d7c772

Please sign in to comment.