From c2a7d21d09adaae14a06c94c5ff53aa1598507e3 Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Thu, 7 Sep 2017 12:22:13 -0700 Subject: [PATCH] Update modified queryTransition funcs to ES6 and spread operator --- ui/src/utils/queryTransitions.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/ui/src/utils/queryTransitions.js b/ui/src/utils/queryTransitions.js index 4281e855e..8676fd253 100644 --- a/ui/src/utils/queryTransitions.js +++ b/ui/src/utils/queryTransitions.js @@ -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