Convert Jared to a believer in functional programming overlord technology
parent
ccd2db9ffa
commit
be0e1a066e
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue