Skip to content

Commit

Permalink
Remove completely hidden frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
novykh committed Nov 23, 2023
1 parent efd46f5 commit 6b44519
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {

const promises = options.targets.map(
({ spaceId, roomId, contextId, nodes, groupBy, method, refId, dimensions, filterBy, filterValue, hide }) => {
if (hide) {
const frame = new MutableDataFrame({
refId: refId,
});
return Promise.resolve(frame);
}
if (hide) return null;

if (!spaceId || !roomId || !contextId) {
const frame = new MutableDataFrame({
Expand Down Expand Up @@ -85,7 +80,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
}
);

return Promise.all(promises).then((data) => ({ data }));
return Promise.all(promises.filter(Boolean)).then((data) => ({ data }));
}

async testDatasource() {
Expand Down

0 comments on commit 6b44519

Please sign in to comment.