Add upperDashboardTime TV.

pull/1681/head
Hunter Trujillo 2017-06-30 16:22:46 -06:00
parent 342d46261e
commit a8dfb740a4
1 changed files with 18 additions and 8 deletions

View File

@ -259,16 +259,26 @@ class DashboardPage extends Component {
params: {sourceID}, params: {sourceID},
} = this.props } = this.props
const value = upper ? `'${lower}' AND time < '${upper}'` : lower
const dashboard = this.getActiveDashboard()
const dashboardTime = { const dashboardTime = {
id: 'dashtime', id: 'dashtime',
tempVar: ':dashboardTime:', tempVar: ':dashboardTime:',
type: 'constant', type: 'constant',
values: [ values: [
{ {
value, value: `'${lower}'`,
type: 'constant',
selected: true,
},
],
}
const upperDashboardTime = {
id: 'upperdashtime',
tempVar: ':upperDashboardTime:',
type: 'constant',
values: [
{
value: `'${upper}'`,
type: 'constant', type: 'constant',
selected: true, selected: true,
}, },
@ -285,10 +295,10 @@ class DashboardPage extends Component {
values: [], values: [],
} }
const templatesIncludingDashTime = const dashboard = this.getActiveDashboard()
(dashboard && const templatesIncludingDashTime = dashboard
dashboard.templates.concat(dashboardTime).concat(interval)) || ? [...dashboard.templates, dashboardTime, upperDashboardTime, interval]
[] : []
const {selectedCell, isEditMode, isTemplating} = this.state const {selectedCell, isEditMode, isTemplating} = this.state