From 2ea9272fcd896b983aa813a08f9ea0e0bcc12ba5 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Thu, 12 Oct 2017 11:07:30 -0700 Subject: [PATCH] Fix toggle field logic --- ui/src/utils/queryTransitions.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/src/utils/queryTransitions.js b/ui/src/utils/queryTransitions.js index 7841b6d31d..de4c715273 100644 --- a/ui/src/utils/queryTransitions.js +++ b/ui/src/utils/queryTransitions.js @@ -75,16 +75,15 @@ export const toggleField = (query, {name, type}) => { } } - if (!newFuncs) { + // if we are not applying functions apply a field + if (!newFuncs.length) { return { ...query, fields: [ ...fields, { - type: 'func', - alias: `mean_${name}`, - args: [{name, type: 'field'}], - name: 'mean', + name, + type: 'field', }, ], }