Remove FillQuery component from Kapacitor rule alert query builder
parent
c40b0a35a0
commit
b5ea9dbbca
|
@ -61,11 +61,3 @@ export const groupByTime = (queryId, time) => ({
|
|||
time,
|
||||
},
|
||||
})
|
||||
|
||||
export const fill = (queryId, value) => ({
|
||||
type: 'KAPA_FILL',
|
||||
payload: {
|
||||
queryId,
|
||||
value,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -5,7 +5,6 @@ import classnames from 'classnames'
|
|||
import DatabaseList from 'src/shared/components/DatabaseList'
|
||||
import MeasurementList from 'src/shared/components/MeasurementList'
|
||||
import FieldList from 'src/shared/components/FieldList'
|
||||
import FillQuery from 'shared/components/FillQuery'
|
||||
|
||||
import {defaultEveryFrequency} from 'src/kapacitor/constants'
|
||||
|
||||
|
@ -35,10 +34,6 @@ class DataSection extends Component {
|
|||
this.props.actions.groupByTime(this.props.query.id, null)
|
||||
}
|
||||
|
||||
handleFillQuery = value => {
|
||||
this.props.actions.fill(this.props.query.id, value)
|
||||
}
|
||||
|
||||
handleGroupByTime = time => {
|
||||
this.props.actions.groupByTime(this.props.query.id, time)
|
||||
}
|
||||
|
@ -61,19 +56,13 @@ class DataSection extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {query, timeRange: {lower}} = this.props
|
||||
const statement = query.rawText || buildInfluxQLQuery({lower}, query)
|
||||
const {query, timeRange: {lower}, isKapacitorRule} = this.props
|
||||
const statement =
|
||||
query.rawText || buildInfluxQLQuery({lower}, query, isKapacitorRule)
|
||||
|
||||
return (
|
||||
<div className="rule-section">
|
||||
<h3 className="rule-section--heading">
|
||||
Select a Time Series
|
||||
<FillQuery
|
||||
onSelection={this.handleFillQuery}
|
||||
theme="GREEN"
|
||||
size="sm"
|
||||
/>
|
||||
</h3>
|
||||
<h3 className="rule-section--heading">Select a Time Series</h3>
|
||||
<div className="rule-section--body">
|
||||
<pre className="rule-section--border-bottom">
|
||||
<code
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
chooseTag,
|
||||
groupByTag,
|
||||
groupByTime,
|
||||
fill,
|
||||
toggleField,
|
||||
toggleTagAcceptance,
|
||||
} from 'src/utils/queryTransitions'
|
||||
|
@ -109,16 +108,6 @@ const queryConfigs = (state = {}, action) => {
|
|||
[queryId]: nextQueryConfig,
|
||||
})
|
||||
}
|
||||
|
||||
case 'KAPA_FILL': {
|
||||
const {queryId, value} = action.payload
|
||||
const nextQueryConfig = fill(state[queryId], value)
|
||||
|
||||
return {
|
||||
...state,
|
||||
[queryId]: nextQueryConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
return state
|
||||
}
|
||||
|
|
|
@ -19,7 +19,11 @@ export const quoteIfTimestamp = ({lower, upper}) => {
|
|||
}
|
||||
/* eslint-enable quotes */
|
||||
|
||||
export default function buildInfluxQLQuery(timeBounds, config) {
|
||||
export default function buildInfluxQLQuery(
|
||||
timeBounds,
|
||||
config,
|
||||
isKapacitorRule
|
||||
) {
|
||||
const {groupBy, fill, tags, areTagsAccepted} = config
|
||||
const {upper, lower} = quoteIfTimestamp(timeBounds)
|
||||
|
||||
|
@ -30,7 +34,7 @@ export default function buildInfluxQLQuery(timeBounds, config) {
|
|||
|
||||
const condition = _buildWhereClause({lower, upper, tags, areTagsAccepted})
|
||||
const dimensions = _buildGroupBy(groupBy)
|
||||
const fillClause = _buildFill(fill)
|
||||
const fillClause = isKapacitorRule ? '' : _buildFill(fill)
|
||||
|
||||
return `${select}${condition}${dimensions}${fillClause}`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue