From 57618aeed338e369c9070914e37c7a96a8117bd9 Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Mon, 12 Nov 2018 19:29:32 -0700 Subject: [PATCH] Fixes duplicate 'Value' options in math function select (#25556) (#25567) --- .../datacolumn/simple_math_function.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js index 499c42d915f84..3da639b3669ad 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js @@ -8,19 +8,19 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiSelect } from '@elastic/eui'; -const options = [ - { text: 'Average', value: 'mean' }, - { text: 'Count', value: 'size' }, - { text: 'First', value: 'first' }, - { text: 'Last', value: 'last' }, - { text: 'Max', value: 'max' }, - { text: 'Median', value: 'median' }, - { text: 'Min', value: 'min' }, - { text: 'Sum', value: 'sum' }, - { text: 'Unique', value: 'unique' }, -]; - export const SimpleMathFunction = ({ onChange, value, inputRef, onlymath }) => { + const options = [ + { text: 'Average', value: 'mean' }, + { text: 'Count', value: 'size' }, + { text: 'First', value: 'first' }, + { text: 'Last', value: 'last' }, + { text: 'Max', value: 'max' }, + { text: 'Median', value: 'median' }, + { text: 'Min', value: 'min' }, + { text: 'Sum', value: 'sum' }, + { text: 'Unique', value: 'unique' }, + ]; + if (!onlymath) options.unshift({ text: 'Value', value: '' }); return (