Skip to content

Commit

Permalink
datasource: fix disable query when using mixed datasource (#16409)
Browse files Browse the repository at this point in the history
This fixes an error that was thrown when one or several queries
was disabled using the mixed datasource.

Fixes #12977
  • Loading branch information
marefr committed Apr 8, 2019
1 parent 70dcb6a commit 4a70056
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion public/app/plugins/datasource/mixed/datasource.ts
Expand Up @@ -13,9 +13,17 @@ class MixedDatasource {
return this.$q([]);
}

const filtered = _.filter(targets, t => {
return !t.hide;
});

if (filtered.length === 0) {
return { data: [] };
}

return this.datasourceSrv.get(dsName).then(ds => {
const opt = angular.copy(options);
opt.targets = targets;
opt.targets = filtered;
return ds.query(opt);
});
});
Expand Down

0 comments on commit 4a70056

Please sign in to comment.