-
Notifications
You must be signed in to change notification settings - Fork 920
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
[Enhancement] Keyboard shortcut for running queries #8322
[Enhancement] Keyboard shortcut for running queries #8322
Conversation
Signed-off-by: sumukhswamy <[email protected]>
ℹ️ Manual Changeset Creation ReminderPlease ensure manual commit for changeset file 8322.yml under folder changelogs/fragments to complete this PR. If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link. For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8322 +/- ##
=======================================
Coverage 60.94% 60.94%
=======================================
Files 3759 3759
Lines 89329 89329
Branches 13973 13973
=======================================
Hits 54438 54438
Misses 31494 31494
Partials 3397 3397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -72,6 +72,20 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) { | |||
}, | |||
} = opensearchDashboards.services; | |||
|
|||
useEffect(() => { | |||
function handleCmdEnter(event: KeyboardEvent) { |
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.
I think we could use
this.inputRef which is the Monaco Editor ref and add an action like this
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.
Have updated it
Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
@sumukhswamy can we add a changeset file here? |
Co-authored-by: Ashwin P Chandran <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]>
Signed-off-by: sumukhswamy <[email protected]>
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.
Rerunning failed test, should just a random failure from not starting up correctly. Otherwise, LGTM!
* added keyboard listener Signed-off-by: sumukhswamy <[email protected]> * changed implementation to monaco action button Signed-off-by: sumukhswamy <[email protected]> * changed implementation to monaco action button Signed-off-by: sumukhswamy <[email protected]> * added space Signed-off-by: sumukhswamy <[email protected]> * Update src/plugins/data/public/ui/query_editor/query_editor.tsx Co-authored-by: Ashwin P Chandran <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> * updated linter, added changesheet Signed-off-by: sumukhswamy <[email protected]> --------- Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]> (cherry picked from commit 57eea79) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* added keyboard listener * changed implementation to monaco action button * changed implementation to monaco action button * added space * Update src/plugins/data/public/ui/query_editor/query_editor.tsx * updated linter, added changesheet --------- (cherry picked from commit 57eea79) Signed-off-by: sumukhswamy <[email protected]> Signed-off-by: Sumukh Swamy <[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: Ashwin P Chandran <[email protected]>
Description
cmd+enter functionality runs the query in the editor
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration