Make Jared's belief system conversion look nicer

Signed-off-by: Jared Scheib <jared.scheib@gmail.com>
pull/10616/head
Hunter Trujillo 2017-09-08 11:05:55 -07:00 committed by Jared Scheib
parent 619c0411a6
commit 5676d54fed
2 changed files with 4 additions and 13 deletions

View File

@ -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

View File

@ -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) {