-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discover] Include current filters into "Test query" request #134184
[Discover] Include current filters into "Test query" request #134184
Conversation
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @jughosta |
setTestQueryResponse({ | ||
result: null, | ||
error: null, | ||
isLoading: true, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 love this improvements!
testSearchSource.setField( | ||
'filter', | ||
timeFilter ? [timeFilter, ...ruleConfiguration.filter] : ruleConfiguration.filter | ||
); | ||
const { rawResponse } = await firstValueFrom(testSearchSource.fetch$()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq @Dosant, unrelated to what we fix with this PR, but this should be changed to lastValueFrom
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Tested locally and it now works as expected. For this fix, since this part of the code didn't make it into production, I think it's fine to merge without a covering test (however, adding one on top would of course be 🍰 )
note that we might have to change the observable handling ... but this could also be done in a follow up |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#134323) * [Discover] Include current filters into "Test query" request * [Discover] Reset query results when criteria is changed * [Discover] Add a comment * [Discover] Reset "Test query" when any rule configuration changes (cherry picked from commit 7b17093) Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Closes #134180
Summary
This PR fixes "Test query" button when user changes current Rule filters.
It also removes number of matches from a previous test run if configuration (query, filter, etc) was updated. This way user would be confused whether it's a previous calculation or a new one.
Steps to test: