Skip to content

Commit c3f1d1a

Browse files
committed
fix(influxdb): fixes extra semi colon due to hidden series
closes grafana#5005
1 parent ac674bd commit c3f1d1a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* **Templating**: Fixed issue mixing row repeat and panel repeats, fixes [#4988](https://github.com/grafana/grafana/issues/4988)
44
* **Templating**: Fixed issue detecting dependencies in nested variables, fixes [#4987](https://github.com/grafana/grafana/issues/4987), fixes [#4986](https://github.com/grafana/grafana/issues/4986)
55
* **Graph**: Fixed broken PNG rendering in graph panel, fixes [#5025](https://github.com/grafana/grafana/issues/5025)
6+
* **Influxdb**: Fixes crash when hiding middle serie, fixes [#5005](https://github.com/grafana/grafana/issues/5005)
67

78
# 3.0.1 Stable (2016-05-11)
89

public/app/plugins/datasource/influxdb/datasource.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class InfluxDatasource {
4545
var i, y;
4646

4747
var allQueries = _.map(options.targets, (target) => {
48-
if (target.hide) { return []; }
48+
if (target.hide) { return ""; }
4949

5050
queryTargets.push(target);
5151

@@ -54,8 +54,12 @@ export default class InfluxDatasource {
5454
var query = queryModel.render(true);
5555
query = query.replace(/\$interval/g, (target.interval || options.interval));
5656
return query;
57-
58-
}).join(";");
57+
}).reduce((acc, current) => {
58+
if (current !== "") {
59+
acc += ";" + current;
60+
}
61+
return acc;
62+
});
5963

6064
// replace grafana variables
6165
allQueries = allQueries.replace(/\$timeFilter/g, timeFilter);

0 commit comments

Comments
 (0)