From a5ddfb9d90dab942557ff50451cb0847001c3134 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Tue, 24 Sep 2024 11:14:37 -0400 Subject: [PATCH] Fix updateChart() missing filter expressions map When a filter is applied, updateChart() should not be called without the filter expression map. Replace method updateSearchFilters(), which computes the filter expression map and calls updateChart with the map if it applies, with method filterExpressionsMap() which only computes the map. This method is now always called to compute the parameter to be passed in updateChart(). Method _debouncedUpdateSearch() is removed, as _debouncedUpdateChart() can always be used instead. Signed-off-by: Patrick Tasse --- .../components/timegraph-output-component.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/react-components/src/components/timegraph-output-component.tsx b/packages/react-components/src/components/timegraph-output-component.tsx index 0e67f1bd..f1820929 100644 --- a/packages/react-components/src/components/timegraph-output-component.tsx +++ b/packages/react-components/src/components/timegraph-output-component.tsx @@ -102,9 +102,8 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent this.updateSearchFilters(), 500); private _debouncedUpdateChart = debounce(() => { - this.chartLayer.updateChart(); + this.chartLayer.updateChart(this.filterExpressionsMap()); }, 500); constructor(props: TimegraphOutputProps) { @@ -332,7 +331,7 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent { + private filterExpressionsMap() { const filterExpressionsMap: { [key: number]: string[] } = {}; if (this.state.searchString) { const DIMMED = 1; @@ -882,13 +881,12 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent 0) { - this.chartLayer.updateChart(filterExpressionsMap); + return filterExpressionsMap; } else { - this.chartLayer.updateChart(); + return undefined; } - }; + } private clearSearchBox() { this.setState({ searchString: '' });