-
Notifications
You must be signed in to change notification settings - Fork 906
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] Query editor state sync fixes #8803
[Discover] Query editor state sync fixes #8803
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8803 +/- ##
=======================================
Coverage 60.77% 60.77%
=======================================
Files 3798 3798
Lines 90695 90695
Branches 14279 14279
=======================================
Hits 55121 55121
Misses 32075 32075
Partials 3499 3499
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: Kawika Avilla <[email protected]> Signed-off-by: Ashwin P Chandran <[email protected]>
* mosty working * fix reference issue * Changeset file for PR #8803 created/updated * Apply suggestions from code review Co-authored-by: Kawika Avilla <[email protected]> Signed-off-by: Ashwin P Chandran <[email protected]> --------- Signed-off-by: Ashwin P Chandran <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Kawika Avilla <[email protected]> (cherry picked from commit 358d823) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* mosty working * fix reference issue * Changeset file for PR #8803 created/updated * Apply suggestions from code review --------- (cherry picked from commit 358d823) Signed-off-by: Ashwin P Chandran <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Kawika Avilla <[email protected]>
Description
The Query editor and similarly auto complete use the query state to corretcly query the Datasource. However the query state value used by different parts of the editor UI are out of sync. This PR clearly demarcates which instance of the query you are using and calls out why that is the rught query object to reference.
It also addresses a quirk of monaco which after initialization does not use the latest value of the query object resulting in incorrect values being used for language and dataset. This is fixed by using useRef to store a referenc of the object that the monaco callback can use when the shortcut commands are fired.
Issues Resolved
Enter
did not use the vlue from the editor. Fixed by using the editor value directlyCmd+Enter
is hit, the language and datasource revert back to the default values when the app was loaded. Thsi is fixed using the ref hackScreenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration