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