From b9bac12d88e5c91ca7f503ac5d90fec395462d04 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Tue, 1 Aug 2017 13:14:31 -0700 Subject: [PATCH 1/3] Fix test and user submitted values check --- ui/spec/shared/parsing/getRangeForDygraphSpec.js | 4 ++-- ui/src/shared/parsing/getRangeForDygraph.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/spec/shared/parsing/getRangeForDygraphSpec.js b/ui/spec/shared/parsing/getRangeForDygraphSpec.js index 2cec89bcfe..d7840444f3 100644 --- a/ui/spec/shared/parsing/getRangeForDygraphSpec.js +++ b/ui/spec/shared/parsing/getRangeForDygraphSpec.js @@ -17,10 +17,10 @@ describe.only('getRangeForDygraphSpec', () => { it('does not get range when a range is provided', () => { const timeSeries = [[date, min], [date, max], [date, mid]] - const providedRange = [0, 4] + const providedRange = ['0', '4'] const actual = getRange(timeSeries, providedRange) - expect(actual).to.deep.equal(providedRange) + expect(actual).to.deep.equal([0, 4]) }) it('gets the range for multiple timeSeries', () => { diff --git a/ui/src/shared/parsing/getRangeForDygraph.js b/ui/src/shared/parsing/getRangeForDygraph.js index 43eec356df..8d7696dbd7 100644 --- a/ui/src/shared/parsing/getRangeForDygraph.js +++ b/ui/src/shared/parsing/getRangeForDygraph.js @@ -18,9 +18,9 @@ const getRange = ( ruleValues = {value: null, rangeValue: null} ) => { const {value, rangeValue, operator} = ruleValues + const [userMin, userMax] = userSelectedRange - if (userSelectedRange.length) { - const [userMin, userMax] = userSelectedRange + if (userMin && userMax) { return [considerZero(userMin), considerZero(userMax)] } @@ -72,7 +72,7 @@ const getRange = ( const [min, max] = range - return [min, max] + return [considerZero(userMin, min), considerZero(userMax, max)] } export default getRange From 2270604c6841d7ea632fe59495f007319a930851 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Tue, 1 Aug 2017 13:24:52 -0700 Subject: [PATCH 2/3] Comment out undone features --- ui/src/dashboards/components/Ranger.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/src/dashboards/components/Ranger.js b/ui/src/dashboards/components/Ranger.js index 1e94ac92a8..e97fec0ca9 100644 --- a/ui/src/dashboards/components/Ranger.js +++ b/ui/src/dashboards/components/Ranger.js @@ -1,6 +1,7 @@ import React, {PropTypes} from 'react' import _ from 'lodash' +// TODO: add logic for for Prefix, Suffix, Scale, and Multiplier const Ranger = ({onSetRange, axes}) => { const min = _.get(axes, ['y', 'bounds', '0'], '') const max = _.get(axes, ['y', 'bounds', '1'], '') @@ -9,7 +10,7 @@ const Ranger = ({onSetRange, axes}) => {
Y Axis Controls
-
+ {/*
{ name="suffix" id="suffix" /> -
+
*/}
{ placeholder="auto" />
-
+ {/*
  • Base 10
  • @@ -73,7 +74,7 @@ const Ranger = ({onSetRange, axes}) => {
  • Linear
  • Logarithmic
-
+
*/}
) From b9754fd5d54830ad2555341244a34913da1c3fb5 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Tue, 1 Aug 2017 14:12:40 -0700 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7613754c15..f8780fc094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Features 1. [#1717](https://github.com/influxdata/chronograf/pull/1717): View server generated TICKscripts 1. [#1681](https://github.com/influxdata/chronograf/pull/1681): Add the ability to select Custom Time Ranges in the Hostpages, Data Explorer, and Dashboards. +1. [#1714](https://github.com/influxdata/chronograf/pull/1714): Add ability for users to set y-axis bounds ### UI Improvements