From a8dfb740a4be097ea8d3ada6aecdb3cb6539d3ca Mon Sep 17 00:00:00 2001 From: Hunter Trujillo Date: Fri, 30 Jun 2017 16:22:46 -0600 Subject: [PATCH] Add upperDashboardTime TV. --- ui/src/dashboards/containers/DashboardPage.js | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ui/src/dashboards/containers/DashboardPage.js b/ui/src/dashboards/containers/DashboardPage.js index 94dc3872e..413487c7b 100644 --- a/ui/src/dashboards/containers/DashboardPage.js +++ b/ui/src/dashboards/containers/DashboardPage.js @@ -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