mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Refactoring of PR #14772
This commit is contained in:
parent
01eb5fade3
commit
878da68c90
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user