From d6663a1dcb1c9327c3b0bae4e5129cd603eb0ea9 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Mon, 9 Oct 2017 12:50:07 -0700 Subject: [PATCH] Add format to timeRange --- ui/src/dashboards/containers/DashboardPage.js | 8 +++++++- ui/src/dashboards/reducers/dashTimeV1.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/src/dashboards/containers/DashboardPage.js b/ui/src/dashboards/containers/DashboardPage.js index 91aeaf888..fa518407b 100644 --- a/ui/src/dashboards/containers/DashboardPage.js +++ b/ui/src/dashboards/containers/DashboardPage.js @@ -23,7 +23,12 @@ import { } from 'shared/actions/app' import {presentationButtonDispatcher} from 'shared/dispatchers' -const defaultTimeRange = {upper: null, lower: 'now() - 15m'} +const FORMAT_INFLUXQL = 'influxql' +const defaultTimeRange = { + upper: null, + lower: 'now() - 15m', + format: FORMAT_INFLUXQL, +} class DashboardPage extends Component { constructor(props) { @@ -92,6 +97,7 @@ class DashboardPage extends Component { dashboardActions.setDashTimeV1(dashboard.id, { upper, lower, + format: FORMAT_INFLUXQL, }) } diff --git a/ui/src/dashboards/reducers/dashTimeV1.js b/ui/src/dashboards/reducers/dashTimeV1.js index 067d79c00..0bedd3f43 100644 --- a/ui/src/dashboards/reducers/dashTimeV1.js +++ b/ui/src/dashboards/reducers/dashTimeV1.js @@ -20,8 +20,8 @@ const dashTimeV1 = (state = initialState, action) => { } case 'SET_DASHBOARD_TIME_V1': { - const {dashboardID, timeRange: {upper, lower}} = action.payload - const newTimeRange = [{dashboardID, upper, lower}] + const {dashboardID, timeRange: {upper, lower, format}} = action.payload + const newTimeRange = [{dashboardID, upper, lower, format}] const ranges = _.unionBy(newTimeRange, state.ranges, 'dashboardID') return {...state, ranges}