Testdata: Rename package to circumvent convention in go (#19409)

Before this change the tests for test datasource was not run.
This commit is contained in:
Marcus Efraimsson
2019-09-27 16:18:24 +02:00
committed by GitHub
parent d6eb4e8459
commit 00e7c7c4b7
8 changed files with 23 additions and 20 deletions

View File

@@ -35,7 +35,7 @@
<label class="gf-form-label query-keyword width-7">New value</label>
<input type="number" class="gf-form-input width-15" placeholder="value" ng-model="ctrl.newPointValue">
<label class="gf-form-label query-keyword">Time</label>
<input type="string" class="gf-form-input width-12" placeholder="time" ng-model="ctrl.newPointTime" input-datetime>
<input type="string" class="gf-form-input width-12" placeholder="time" ng-model="ctrl.newPointTime">
<button class="btn btn-secondary gf-form-btn" ng-click="ctrl.addPoint()">Add</button>
<label class="gf-form-label query-keyword">All values</label>
<gf-form-dropdown css-class="width-12" model="ctrl.selectedPoint" get-options="ctrl.getPoints()" on-change="ctrl.pointSelected($option)">

View File

@@ -3,7 +3,7 @@ import _ from 'lodash';
import { QueryCtrl } from 'app/plugins/sdk';
import { defaultQuery } from './runStreams';
import { getBackendSrv } from 'app/core/services/backend_srv';
import { dateTime } from '@grafana/data';
import { dateTime, dateMath } from '@grafana/data';
export const defaultPulse: any = {
timeStep: 60,
@@ -63,6 +63,7 @@ export class TestDataQueryCtrl extends QueryCtrl {
addPoint() {
this.target.points = this.target.points || [];
this.newPointTime = dateMath.parse(this.newPointTime);
this.target.points.push([this.newPointValue, this.newPointTime.valueOf()]);
this.target.points = _.sortBy(this.target.points, p => p[1]);
this.refresh();