-
Notifications
You must be signed in to change notification settings - Fork 934
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] Fix Initialization if No Saved Query #8930
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Update saved search initialization logic to use current query instead of default query ([#8930](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8930)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,8 +392,7 @@ | |
const savedSearchInstance = await getSavedSearchById(savedSearchId); | ||
|
||
const query = | ||
savedSearchInstance.searchSource.getField('query') || | ||
data.query.queryString.getDefaultQuery(); | ||
savedSearchInstance.searchSource.getField('query') || data.query.queryString.getQuery(); | ||
|
||
const isEnhancementsEnabled = await uiSettings.get('query:enhancements:enabled'); | ||
if (isEnhancementsEnabled && query.dataset) { | ||
|
@@ -432,7 +431,7 @@ | |
} | ||
|
||
filterManager.setAppFilters(actualFilters); | ||
data.query.queryString.setQuery(savedQuery ? data.query.queryString.getQuery() : query); | ||
data.query.queryString.setQuery(query); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this have any impact to saved queries? like logically to me when reading this this makes sense why we would remove it but save query expected functionality is a little weird to me. so if a saved query is applied and we update the query. but dont fire it's the correct bheavior here right There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this here because originally, |
||
setSavedSearch(savedSearchInstance); | ||
|
||
if (savedSearchInstance?.id) { | ||
|
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.
Since
.getDefaultQuery()
isn't being used here, is it still used in other locations? I would've assumed I would see the removal of this function as well after reading the descriptionThere 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.
i dont know if we want removal of the function in general. but i understand what you mean it should probably be a private function within the query string manager.