Skip to content
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

Merged
merged 12 commits into from
Oct 4, 2024

Conversation

sumukhswamy
Copy link
Contributor

Description

cmd+enter functionality runs the query in the editor

Issues Resolved

Screenshot

Testing the changes

Changelog

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: sumukhswamy <[email protected]>
Copy link
Contributor

ℹ️ Manual Changeset Creation Reminder

Please 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.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.94%. Comparing base (6f712e2) to head (8e8bc65).
Report is 13 commits behind head on main.

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           
Flag Coverage Δ
Linux_1 28.92% <ø> (ø)
Linux_2 56.30% <ø> (ø)
Linux_3 37.78% <ø> (ø)
Linux_4 29.94% <ø> (ø)
Windows_1 28.94% <ø> (ø)
Windows_2 56.25% <ø> (ø)
Windows_3 37.78% <ø> (ø)
Windows_4 29.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -72,6 +72,20 @@ export default function QueryEditorTopRow(props: QueryEditorTopRowProps) {
},
} = opensearchDashboards.services;

useEffect(() => {
function handleCmdEnter(event: KeyboardEvent) {
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated it

@kavilla kavilla added the discover for discover reinvent label Sep 26, 2024
@ashwin-pc
Copy link
Member

ashwin-pc commented Oct 1, 2024

@sumukhswamy can we add a changeset file here?

Copy link
Member

@sejli sejli left a 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!

@ashwin-pc ashwin-pc merged commit 57eea79 into opensearch-project:main Oct 4, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 4, 2024
* 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>
virajsanghvi pushed a commit that referenced this pull request Oct 18, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants