Revert "fix: Logs UI: querybuildersearch: avoid emptying out query on sourceK…" (#4473)

This reverts commit 085cf34a49434e90f8ec50428a52017e14a985a3.
This commit is contained in:
Yunus M 2024-02-01 00:13:42 +05:30 committed by GitHub
parent 5c60a862e5
commit 457380c065
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,20 +150,6 @@ function QueryBuilderSearch({
(item) => item.key as BaseAutocompleteData, (item) => item.key as BaseAutocompleteData,
); );
// Avoid updating query with onChange at the bottom of this useEffect
// if there are no `tags` that need to be normalized after receiving
// the latest `sourceKeys`.
//
// Executing the following logic for empty tags leads to emptying
// out of `query` via `onChange`.
// `tags` can contain stale empty value while being updated by `useTag`
// which maintains it as a state and updates it via useEffect when props change.
// This was observed when pipeline filters were becoming empty after
// returning from logs explorer.
if ((tags?.length || 0) < 1) {
return;
}
initialTagFilters.items = tags.map((tag, index) => { initialTagFilters.items = tags.map((tag, index) => {
const isJsonTrue = query.filters?.items[index]?.key?.isJSON; const isJsonTrue = query.filters?.items[index]?.key?.isJSON;