Explore: No logs should show an empty graph (#19132)

* Explore: add no data points text to graph

* Explore: add console log for error (accidentaly removed)

* Explore: refactor, created getYAxes method for better readability

* Explore: remove unnecessary console.log

* Explore: fix getYAxes method to return value

* Graph: Simplify warning from no data points to No data
This commit is contained in:
Ivana Huckova
2019-09-16 18:55:52 +02:00
committed by Torkel Ödegaard
parent 3c61b563c3
commit 85e128fede
3 changed files with 31 additions and 21 deletions

View File

@@ -225,14 +225,14 @@ class GraphCtrl extends MetricsPanelCtrl {
if (datapointsCount === 0) {
this.dataWarning = {
title: 'No data points',
tip: 'No datapoints returned from data query',
title: 'No data',
tip: 'No data returned from query',
};
} else {
for (const series of this.seriesList) {
if (series.isOutsideRange) {
this.dataWarning = {
title: 'Data points outside time range',
title: 'Data outside time range',
tip: 'Can be caused by timezone mismatch or missing time filter in query',
};
break;

View File

@@ -58,7 +58,7 @@ describe('GraphCtrl', () => {
});
it('should set datapointsOutside', () => {
expect(ctx.ctrl.dataWarning.title).toBe('Data points outside time range');
expect(ctx.ctrl.dataWarning.title).toBe('Data outside time range');
});
});
@@ -94,7 +94,7 @@ describe('GraphCtrl', () => {
});
it('should set datapointsCount warning', () => {
expect(ctx.ctrl.dataWarning.title).toBe('No data points');
expect(ctx.ctrl.dataWarning.title).toBe('No data');
});
});
});