Refactoring of PR #14772

This commit is contained in:
Torkel Ödegaard 2019-03-08 13:49:48 +01:00
parent 01eb5fade3
commit 878da68c90
2 changed files with 3 additions and 7 deletions

View File

@ -2,12 +2,12 @@ import kbn from '../utils/kbn';
describe('stringToJsRegex', () => {
it('should parse the valid regex value', () => {
const output = kbn.stringToJsRegex("/validRegexp/");
const output = kbn.stringToJsRegex('/validRegexp/');
expect(output).toBeInstanceOf(RegExp);
});
it('should throw error on invalid regex value', () => {
const input = "/etc/hostname";
const input = '/etc/hostname';
expect(() => {
kbn.stringToJsRegex(input);
}).toThrow();

View File

@ -235,11 +235,7 @@ class GraphCtrl extends MetricsPanelCtrl {
}
for (const series of this.seriesList) {
try {
series.applySeriesOverrides(this.panel.seriesOverrides);
} catch (e) {
this.publishAppEvent('alert-error', [e.message]);
}
series.applySeriesOverrides(this.panel.seriesOverrides);
if (series.unit) {
this.panel.yaxes[series.yaxis - 1].format = series.unit;