mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
updated libs and fixed new typescript errors
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
"@types/enzyme": "^2.8.9",
|
||||
"@types/jest": "^21.1.4",
|
||||
"@types/node": "^8.0.31",
|
||||
"@types/react": "^16.0.5",
|
||||
"@types/react-dom": "^15.5.4",
|
||||
"@types/react": "^16.0.25",
|
||||
"@types/react-dom": "^16.0.3",
|
||||
"angular-mocks": "^1.6.6",
|
||||
"autoprefixer": "^6.4.0",
|
||||
"awesome-typescript-loader": "^3.2.3",
|
||||
@@ -128,8 +128,8 @@
|
||||
"ngreact": "^0.4.1",
|
||||
"perfect-scrollbar": "^1.2.0",
|
||||
"prop-types": "^15.6.0",
|
||||
"react": "^16.0.0",
|
||||
"react-dom": "^16.0.0",
|
||||
"react": "^16.1.1",
|
||||
"react-dom": "^16.1.1",
|
||||
"react-grid-layout": "^0.16.0",
|
||||
"react-sizeme": "^2.3.6",
|
||||
"remarkable": "^1.7.1",
|
||||
|
@@ -3,14 +3,12 @@ import 'app/core/services/backend_srv';
|
||||
|
||||
describe('backend_srv', function() {
|
||||
var _backendSrv;
|
||||
var _http;
|
||||
var _httpBackend;
|
||||
|
||||
beforeEach(angularMocks.module('grafana.core'));
|
||||
beforeEach(angularMocks.module('grafana.services'));
|
||||
beforeEach(angularMocks.inject(function ($httpBackend, $http, backendSrv) {
|
||||
_httpBackend = $httpBackend;
|
||||
_http = $http;
|
||||
_backendSrv = backendSrv;
|
||||
}));
|
||||
|
||||
|
@@ -84,12 +84,10 @@ describe("DateMath", () => {
|
||||
|
||||
describe('rounding', () => {
|
||||
var now;
|
||||
var anchored;
|
||||
|
||||
beforeEach(() => {
|
||||
clock = sinon.useFakeTimers(unix);
|
||||
now = moment();
|
||||
anchored = moment(anchor);
|
||||
});
|
||||
|
||||
_.each(spans, (span) => {
|
||||
|
@@ -210,7 +210,6 @@ export class AlertTabCtrl {
|
||||
}
|
||||
|
||||
let firstTarget;
|
||||
var fixed = false;
|
||||
let foundTarget = null;
|
||||
|
||||
for (var condition of this.alert.conditions) {
|
||||
@@ -232,7 +231,6 @@ export class AlertTabCtrl {
|
||||
if (firstTarget) {
|
||||
condition.query.params[0] = firstTarget.refId;
|
||||
foundTarget = firstTarget;
|
||||
fixed = true;
|
||||
} else {
|
||||
this.error = "Could not find any metric queries";
|
||||
}
|
||||
|
@@ -9,8 +9,7 @@ export class FolderPickerCtrl {
|
||||
labelClass: string;
|
||||
onChange: any;
|
||||
rootName = 'Root';
|
||||
|
||||
private folder: any;
|
||||
folder: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv) {
|
||||
|
@@ -9,4 +9,7 @@ describe('dashboardSrv', function() {
|
||||
_dashboardSrv = new DashboardSrv({}, {}, {});
|
||||
});
|
||||
|
||||
it("should do something", () => {
|
||||
expect(_dashboardSrv).not.to.be(null);
|
||||
});
|
||||
});
|
||||
|
@@ -51,10 +51,8 @@ describe('given dashboard with panel repeat in horizontal direction', function()
|
||||
});
|
||||
|
||||
describe('After a second iteration', function() {
|
||||
var repeatedPanelAfterIteration1;
|
||||
|
||||
beforeEach(function() {
|
||||
repeatedPanelAfterIteration1 = dashboard.panels[1];
|
||||
dashboard.panels[0].fill = 10;
|
||||
dashboard.processRepeats();
|
||||
});
|
||||
|
@@ -5,7 +5,6 @@ import 'app/features/dashboard/dashboard_srv';
|
||||
describe("unsavedChangesSrv", function() {
|
||||
var _unsavedChangesSrv;
|
||||
var _dashboardSrv;
|
||||
var _location;
|
||||
var _contextSrvStub = { isEditor: true };
|
||||
var _rootScope;
|
||||
var tracker;
|
||||
@@ -22,7 +21,6 @@ describe("unsavedChangesSrv", function() {
|
||||
beforeEach(angularMocks.inject(function(unsavedChangesSrv, $location, $rootScope, dashboardSrv) {
|
||||
_unsavedChangesSrv = unsavedChangesSrv;
|
||||
_dashboardSrv = dashboardSrv;
|
||||
_location = $location;
|
||||
_rootScope = $rootScope;
|
||||
}));
|
||||
|
||||
|
@@ -9,7 +9,6 @@ class PlaylistSrv {
|
||||
private dashboards: any;
|
||||
private index: number;
|
||||
private interval: any;
|
||||
private playlistId: number;
|
||||
private startUrl: string;
|
||||
public isPlaying: boolean;
|
||||
|
||||
@@ -65,7 +64,6 @@ class PlaylistSrv {
|
||||
|
||||
this.startUrl = window.location.href;
|
||||
this.index = 0;
|
||||
this.playlistId = playlistId;
|
||||
this.isPlaying = true;
|
||||
|
||||
if (this.$routeParams.kiosk) {
|
||||
@@ -84,7 +82,6 @@ class PlaylistSrv {
|
||||
stop() {
|
||||
this.index = 0;
|
||||
this.isPlaying = false;
|
||||
this.playlistId = 0;
|
||||
|
||||
if (this.cancelPromise) {
|
||||
this.$timeout.cancel(this.cancelPromise);
|
||||
|
@@ -12,7 +12,6 @@ export class TemplateSrv {
|
||||
private index = {};
|
||||
private grafanaVariables = {};
|
||||
private builtIns = {};
|
||||
private filters = {};
|
||||
|
||||
constructor() {
|
||||
this.builtIns['__interval'] = {text: '1s', value: '1s'};
|
||||
@@ -26,7 +25,6 @@ export class TemplateSrv {
|
||||
|
||||
updateTemplateData() {
|
||||
this.index = {};
|
||||
this.filters = {};
|
||||
|
||||
for (var i = 0; i < this.variables.length; i++) {
|
||||
var variable = this.variables[i];
|
||||
|
@@ -166,8 +166,6 @@ describe('CloudWatchDatasource', function() {
|
||||
});
|
||||
|
||||
describe('When performing CloudWatch query for extended statistics', function() {
|
||||
var requestParams;
|
||||
|
||||
var query = {
|
||||
range: { from: 'now-1h', to: 'now' },
|
||||
rangeRaw: { from: 1483228800, to: 1483232400 },
|
||||
@@ -212,7 +210,6 @@ describe('CloudWatchDatasource', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
ctx.backendSrv.datasourceRequest = function(params) {
|
||||
requestParams = params.data;
|
||||
return ctx.$q.when({data: response});
|
||||
};
|
||||
});
|
||||
|
@@ -112,13 +112,11 @@ describe('ElasticDatasource', function() {
|
||||
});
|
||||
|
||||
describe('When getting fields', function() {
|
||||
var requestOptions;
|
||||
|
||||
beforeEach(function() {
|
||||
createDatasource({url: 'http://es.com', index: 'metricbeat'});
|
||||
|
||||
ctx.backendSrv.datasourceRequest = function(options) {
|
||||
requestOptions = options;
|
||||
return ctx.$q.when({data: {
|
||||
metricbeat: {
|
||||
mappings: {
|
||||
|
@@ -167,9 +167,7 @@ Lexer.prototype = {
|
||||
this.from = this.char;
|
||||
|
||||
// Move to the next non-space character.
|
||||
var start;
|
||||
if (/\s/.test(this.peek())) {
|
||||
start = this.char;
|
||||
|
||||
while (/\s/.test(this.peek())) {
|
||||
this.from += 1;
|
||||
|
@@ -35,6 +35,7 @@ describe('opentsdb', function() {
|
||||
expect(requestOptions.url).to.be('/api/suggest');
|
||||
expect(requestOptions.params.type).to.be('metrics');
|
||||
expect(requestOptions.params.q).to.be('pew');
|
||||
expect(results).not.to.be(null);
|
||||
});
|
||||
|
||||
it('tag_names(cpu) should generate lookup query', function() {
|
||||
|
@@ -228,6 +228,7 @@ describe('PrometheusDatasource', function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('When resultFormat is table and instant = true', function() {
|
||||
var results;
|
||||
var urlExpected = 'proxied/api/v1/query?query=' +
|
||||
@@ -248,11 +249,17 @@ describe('PrometheusDatasource', function() {
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
||||
beforeEach(function () {
|
||||
ctx.$httpBackend.expect('GET', urlExpected).respond(response);
|
||||
ctx.ds.query(query).then(function (data) { results = data; });
|
||||
ctx.$httpBackend.flush();
|
||||
});
|
||||
|
||||
it("should return result", () => {
|
||||
expect(results).not.to.be(null);
|
||||
});
|
||||
|
||||
it('should return table model', function() {
|
||||
var table = ctx.ds.transformMetricDataToTable(response.data.result);
|
||||
expect(table.type).to.be('table');
|
||||
|
@@ -4,8 +4,8 @@ describe('Graph DataProcessor', function() {
|
||||
var panel: any = {
|
||||
xaxis: {}
|
||||
};
|
||||
|
||||
var processor = new DataProcessor(panel);
|
||||
var seriesList;
|
||||
|
||||
describe('Given default xaxis options and query that returns docs', () => {
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('Graph DataProcessor', function() {
|
||||
panel.xaxis.name = 'hostname';
|
||||
panel.xaxis.values = [];
|
||||
|
||||
seriesList = processor.getSeriesList({
|
||||
processor.getSeriesList({
|
||||
dataList: [
|
||||
{
|
||||
type: 'docs',
|
||||
|
@@ -34,7 +34,6 @@ export class ThresholdManager {
|
||||
var handleElem = $(evt.currentTarget).parents(".alert-handle-wrapper");
|
||||
var handleIndex = $(evt.currentTarget).data("handleIndex");
|
||||
|
||||
var isMoving = false;
|
||||
var lastY = null;
|
||||
var posTop;
|
||||
var plot = this.plot;
|
||||
@@ -53,7 +52,6 @@ export class ThresholdManager {
|
||||
}
|
||||
|
||||
function stopped() {
|
||||
isMoving = false;
|
||||
// calculate graph level
|
||||
var graphValue = plot.c2p({left: 0, top: posTop}).y;
|
||||
graphValue = parseInt(graphValue.toFixed(0));
|
||||
@@ -70,7 +68,6 @@ export class ThresholdManager {
|
||||
});
|
||||
}
|
||||
|
||||
isMoving = true;
|
||||
lastY = null;
|
||||
posTop = handleElem.position().top;
|
||||
|
||||
|
@@ -100,9 +100,8 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
|
||||
scaledDecimals: number;
|
||||
|
||||
/** @ngInject */
|
||||
constructor($scope, $injector, private $rootScope, timeSrv) {
|
||||
constructor($scope, $injector, timeSrv) {
|
||||
super($scope, $injector);
|
||||
this.$rootScope = $rootScope;
|
||||
this.timeSrv = timeSrv;
|
||||
this.selectionActivated = false;
|
||||
|
||||
|
@@ -13,10 +13,10 @@ config = merge(common, {
|
||||
fs: 'empty'
|
||||
},
|
||||
plugins: [
|
||||
// new webpack.SourceMapDevToolPlugin({
|
||||
// filename: null, // if no value is provided the sourcemap is inlined
|
||||
// test: /\.(ts|js)($|\?)/i // process .js and .ts files only
|
||||
// })
|
||||
new webpack.SourceMapDevToolPlugin({
|
||||
filename: null, // if no value is provided the sourcemap is inlined
|
||||
test: /\.(ts|js)($|\?)/i // process .js and .ts files only
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user