mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
# Backport This will backport the following commits from `main` to `8.11`: - [[Security Solution] Fixes ES|QL Tab resetting to KQL Bar (#168716)](https://github.com/elastic/kibana/pull/168716) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2023-10-13T06:22:06Z","message":"[Security Solution] Fixes ES|QL Tab resetting to KQL Bar (#168716)\n\n## Summary\r\n\r\nHandles #168431\r\n\r\nThis PR fixes a race condition which was causing Discover ES|QL tab to\r\nrevert to it KQL query bar. See demo below:\r\n\r\n| Before | After |\r\n|---|---|\r\n| <video\r\nsrc=\"746946ad
-bd69-412f-bd38-d3d79b570c68\"\r\n/>|","sha":"6fd6966ed8225935feee247b04b4988424b47c88","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat Hunting:Investigations","v8.11.0","v8.12.0"],"number":168716,"url":"https://github.com/elastic/kibana/pull/168716","mergeCommit":{"message":"[Security Solution] Fixes ES|QL Tab resetting to KQL Bar (#168716)\n\n## Summary\r\n\r\nHandles #168431\r\n\r\nThis PR fixes a race condition which was causing Discover ES|QL tab to\r\nrevert to it KQL query bar. See demo below:\r\n\r\n| Before | After |\r\n|---|---|\r\n| <video\r\nsrc=\"746946ad
-bd69-412f-bd38-d3d79b570c68\"\r\n/>|","sha":"6fd6966ed8225935feee247b04b4988424b47c88"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168716","number":168716,"mergeCommit":{"message":"[Security Solution] Fixes ES|QL Tab resetting to KQL Bar (#168716)\n\n## Summary\r\n\r\nHandles #168431\r\n\r\nThis PR fixes a race condition which was causing Discover ES|QL tab to\r\nrevert to it KQL query bar. See demo below:\r\n\r\n| Before | After |\r\n|---|---|\r\n| <video\r\nsrc=\"746946ad
-bd69-412f-bd38-d3d79b570c68\"\r\n/>|","sha":"6fd6966ed8225935feee247b04b4988424b47c88"}}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
This commit is contained in:
parent
5dc69b421c
commit
12a59a2521
1 changed files with 4 additions and 0 deletions
|
@ -181,6 +181,10 @@ export const DiscoverTabContent: FC<DiscoverTabContentProps> = ({ timelineId })
|
|||
if (!savedObjectId) return;
|
||||
if (!status || status === 'draft') return;
|
||||
const latestState = getCombinedDiscoverSavedSearchState();
|
||||
const index = latestState?.searchSource.getField('index');
|
||||
/* when a new timeline is loaded, a new discover instance is loaded which first emits
|
||||
* discover's initial state which is then updated in the saved search. We want to avoid that.*/
|
||||
if (!index) return;
|
||||
if (!latestState || combinedDiscoverSavedSearchStateRef.current === latestState) return;
|
||||
if (isEqualWith(latestState, savedSearchById, savedSearchComparator)) return;
|
||||
debouncedUpdateSavedSearch(latestState, timelineId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue