Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): make aggregation function optional in Flux Query Builder #5893

Merged
merged 2 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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