From c055b60e2fa6c29e07dabadc0e5ceae53c33be9e Mon Sep 17 00:00:00 2001 From: Praveen K B Date: Fri, 6 Dec 2024 10:46:08 +0530 Subject: [PATCH] fix:Handling dashboard saved filters for old filters --- .../Stream/components/Querier/SavedFiltersModal.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/Stream/components/Querier/SavedFiltersModal.tsx b/src/pages/Stream/components/Querier/SavedFiltersModal.tsx index d60887a2..579c5451 100644 --- a/src/pages/Stream/components/Querier/SavedFiltersModal.tsx +++ b/src/pages/Stream/components/Querier/SavedFiltersModal.tsx @@ -85,7 +85,16 @@ const SavedFilterItem = (props: { const onApplyFilters = useCallback(() => { if (location.pathname.includes('dashboard')) { - setFilterStore((store) => setAppliedFilterQuery(store, query.filter_query)); + if (query.filter_query) { + setFilterStore((store) => setAppliedFilterQuery(store, query.filter_query)); + } else if (query.filter_builder) { + setFilterStore((store) => + setAppliedFilterQuery( + store, + parseQuery(props.queryEngine, query.filter_builder as QueryType, stream_name).parsedQuery, + ), + ); + } setFilterStore((store) => toggleSavedFiltersModal(store, false)); } else { if (query.filter_query) {