-
Notifications
You must be signed in to change notification settings - Fork 884
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
Select the correct language when a different one is chosen by the dataset selector #8671
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- Select the correct language when a different one is chosen by the dataset selector ([#8671](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8671)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,11 +240,10 @@ export default class QueryEditorUI extends Component<Props, State> { | |
|
||
if (!isEqual(this.props.query.dataset, prevQuery.dataset)) { | ||
if (this.inputRef) { | ||
const newQuery = this.queryString.getInitialQuery(); | ||
const newQueryString = newQuery.query; | ||
if (this.inputRef.getValue() !== newQueryString) { | ||
const newQueryString = this.props.query.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. i think now when i select the dataset for the new language the query string is not updated with the updated dataset. 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. recreation steps:
|
||
if (this.inputRef.getValue() !== newQueryString && typeof newQueryString === 'string') { | ||
this.inputRef.setValue(newQueryString); | ||
this.onSubmit(newQuery); | ||
this.onSubmit(this.props.query); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is it potentially just a race condition or something?
could we verify if the props.query.language is the current query always. and this component gets re-rendered. i need to verify since last checking these things out. or if you have the insight already.
because what im thinking is that potentially the dataset is checking which languages are supported and adding to a list while this is listening to changes and before the language is added this setter is called but set to the first language it found.
there's a couple of places i think were we need loading spinners. shooting in the dark perhaps we just need to check if everything is done loading before setting the current language?
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.
or opt for just disabling unsupported languages and setting the current value vs removing them from view