Convert Jared to a believer in functional programming overlord technology

pull/1885/head
Jared Scheib 2017-09-07 16:52:50 -07:00
parent ccd2db9ffa
commit be0e1a066e
2 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import {NULL_STRING} from 'shared/constants/queryFillOptions'
const defaultQueryConfig = ({id, isKapacitorRule = false}) => {
const queryConfig = {
let queryConfig = {
id,
database: null,
measurement: null,
@ -12,14 +12,13 @@ const defaultQueryConfig = ({id, isKapacitorRule = false}) => {
time: null,
tags: [],
},
fill: NULL_STRING,
areTagsAccepted: true,
rawText: null,
status: null,
}
if (isKapacitorRule) {
delete queryConfig.fill
if (!isKapacitorRule) {
queryConfig = {...queryConfig, fill: NULL_STRING}
}
return queryConfig

View File

@ -126,13 +126,13 @@ export function applyFuncsToField(
time: shouldRemoveFuncs ? null : defaultGroupBy,
})
const nextQuery = {...query, fields: nextFields, groupBy: nextGroupBy}
let 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
Object.assign(nextQuery, {fill: nextFill})
nextQuery = {...nextQuery, fill: nextFill}
}
return nextQuery