Add format to timeRange

pull/2083/head
Andrew Watkins 2017-10-09 12:50:07 -07:00
parent d4f002cc63
commit d6663a1dcb
2 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,12 @@ import {
} from 'shared/actions/app' } from 'shared/actions/app'
import {presentationButtonDispatcher} from 'shared/dispatchers' 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 { class DashboardPage extends Component {
constructor(props) { constructor(props) {
@ -92,6 +97,7 @@ class DashboardPage extends Component {
dashboardActions.setDashTimeV1(dashboard.id, { dashboardActions.setDashTimeV1(dashboard.id, {
upper, upper,
lower, lower,
format: FORMAT_INFLUXQL,
}) })
} }

View File

@ -20,8 +20,8 @@ const dashTimeV1 = (state = initialState, action) => {
} }
case 'SET_DASHBOARD_TIME_V1': { case 'SET_DASHBOARD_TIME_V1': {
const {dashboardID, timeRange: {upper, lower}} = action.payload const {dashboardID, timeRange: {upper, lower, format}} = action.payload
const newTimeRange = [{dashboardID, upper, lower}] const newTimeRange = [{dashboardID, upper, lower, format}]
const ranges = _.unionBy(newTimeRange, state.ranges, 'dashboardID') const ranges = _.unionBy(newTimeRange, state.ranges, 'dashboardID')
return {...state, ranges} return {...state, ranges}