Commit 13f55bc5 by Ryan McKinley Committed by GitHub

MixedDatasource: don't filter hidden queries before sending to datasources (#18814)

parent 1a4be4af
......@@ -17,17 +17,23 @@ class MixedDatasource extends DataSourceApi<DataQuery> {
return Promise.resolve([]);
}
const filtered = _.filter(targets, (t: DataQuery) => {
return !t.hide;
});
if (filtered.length === 0) {
if (targets.length === 0) {
return { data: [] };
}
return this.datasourceSrv.get(dsName).then(ds => {
// Remove any unused hidden queries
if (!ds.meta.hiddenQueries) {
targets = _.filter(targets, (t: DataQuery) => {
return !t.hide;
});
if (targets.length === 0) {
return { data: [] };
}
}
const opt = _.cloneDeep(options);
opt.targets = filtered;
opt.targets = targets;
return ds.query(opt);
});
});
......
......@@ -6,6 +6,7 @@
"builtIn": true,
"mixed": true,
"metrics": true,
"hiddenQueries": true,
"queryOptions": {
"minInterval": true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment