Update modified queryTransition funcs to ES6 and spread operator

pull/1885/head
Jared Scheib 2017-09-07 12:22:13 -07:00
parent bb0dc81dd7
commit c2a7d21d09
1 changed files with 14 additions and 18 deletions

View File

@ -7,25 +7,21 @@ export function editRawText(query, rawText) {
return Object.assign({}, query, {rawText})
}
export function chooseNamespace(query, namespace, isKapacitorRule = false) {
return Object.assign(
{},
defaultQueryConfig({id: query.id, isKapacitorRule}),
namespace
)
}
export const chooseNamespace = (query, namespace, isKapacitorRule = false) => ({
...defaultQueryConfig({id: query.id, isKapacitorRule}),
...namespace,
})
export function chooseMeasurement(query, measurement, isKapacitorRule = false) {
return Object.assign(
{},
defaultQueryConfig({id: query.id, isKapacitorRule}),
{
database: query.database,
retentionPolicy: query.retentionPolicy,
measurement,
}
)
}
export const chooseMeasurement = (
query,
measurement,
isKapacitorRule = false
) => ({
...defaultQueryConfig({id: query.id, isKapacitorRule}),
database: query.database,
retentionPolicy: query.retentionPolicy,
measurement,
})
export const toggleField = (query, {field, funcs}, isKapacitorRule = false) => {
const {fields, groupBy} = query