Make Jared's belief system conversion look nicer
Signed-off-by: Jared Scheib <jared.scheib@gmail.com>pull/10616/head
parent
619c0411a6
commit
5676d54fed
|
@ -1,7 +1,7 @@
|
|||
import {NULL_STRING} from 'shared/constants/queryFillOptions'
|
||||
|
||||
const defaultQueryConfig = ({id, isKapacitorRule = false}) => {
|
||||
let queryConfig = {
|
||||
const queryConfig = {
|
||||
id,
|
||||
database: null,
|
||||
measurement: null,
|
||||
|
@ -17,11 +17,7 @@ const defaultQueryConfig = ({id, isKapacitorRule = false}) => {
|
|||
status: null,
|
||||
}
|
||||
|
||||
if (!isKapacitorRule) {
|
||||
queryConfig = {...queryConfig, fill: NULL_STRING}
|
||||
}
|
||||
|
||||
return queryConfig
|
||||
return isKapacitorRule ? queryConfig : {...queryConfig, fill: NULL_STRING}
|
||||
}
|
||||
|
||||
export default defaultQueryConfig
|
||||
|
|
|
@ -126,16 +126,11 @@ export function applyFuncsToField(
|
|||
time: shouldRemoveFuncs ? null : defaultGroupBy,
|
||||
})
|
||||
|
||||
let nextQuery = {...query, fields: nextFields, groupBy: nextGroupBy}
|
||||
const nextQuery = {...query, fields: nextFields, groupBy: nextGroupBy}
|
||||
|
||||
// fill is not valid for kapacitor query configs since there is no actual
|
||||
// query and all alert rules create stream-based tasks currently
|
||||
if (!isKapacitorRule) {
|
||||
const nextFill = NULL_STRING
|
||||
nextQuery = {...nextQuery, fill: nextFill}
|
||||
}
|
||||
|
||||
return nextQuery
|
||||
return isKapacitorRule ? nextQuery : {...nextQuery, fill: NULL_STRING}
|
||||
}
|
||||
|
||||
export function updateRawQuery(query, rawText) {
|
||||
|
|
Loading…
Reference in New Issue