mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: Add filtering for service graph query (#41162)
* Add filter based on AdHocFilter element * Add tests * Cancel layout in case we have have new data or we unmount node graph * Fix typing * Fix test
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
const { layout } = jest.requireActual('../../app/plugins/panel/nodeGraph/layout.worker.js');
|
||||
|
||||
class LayoutMockWorker {
|
||||
timeout: number | undefined;
|
||||
constructor() {}
|
||||
|
||||
postMessage(data: any) {
|
||||
const { nodes, edges, config } = data;
|
||||
setTimeout(() => {
|
||||
this.timeout = setTimeout(() => {
|
||||
this.timeout = undefined;
|
||||
layout(nodes, edges, config);
|
||||
// @ts-ignore
|
||||
this.onmessage({ data: { nodes, edges } });
|
||||
}, 1);
|
||||
}, 1) as any;
|
||||
}
|
||||
terminate() {
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user