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

Fix Execute Selected not working for dirty queries #4176

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

gabrieldutra
Copy link
Member

@gabrieldutra gabrieldutra commented Sep 23, 2019

What type of PR is this? (check all applicable)

  • Bug Fix

Description

The Execute Selected was not working when the query wasn't in a "dirty state".

Pending:

  • Test on Netlify (and make gifs)
  • Cypress test(?) Not that easy to select a text inside Ace Editor in Cypress 😕

Related Tickets & Documents

--

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Before
execute-selected

After
execute-selected-fix

@gabrieldutra gabrieldutra self-assigned this Sep 23, 2019
@@ -42,7 +42,7 @@ function QueryViewCtrl(
}

$scope.showLog = false;
if ($scope.isDirty) {
if ($scope.isDirty || !isEmpty(selectedQueryText)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is isDirty being checked here actually?

Copy link
Member

Choose a reason for hiding this comment

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

If the query text wasn't changed we use the results API that takes just the query id (the safe API which requires only read access). If the text was changed, we use the results API that takes SQL (requires full access).

@ranbena
Copy link
Contributor

ranbena commented Sep 24, 2019

@gabrieldutra maybe this could help with ace/cypress cypress-io/cypress#1818 (comment)

@gabrieldutra
Copy link
Member Author

@ranbena thanks, that helps with Ace Editor usages in code (avoids having to to use { force: true }), but the bigger issue is to select the text in Ace. I think I'll give a last try with mouse events 👍

@ranbena
Copy link
Contributor

ranbena commented Sep 24, 2019

@gabrieldutra hmm right. Not sure it's worth the effort.

@gabrieldutra
Copy link
Member Author

Yep, not as simple, so I'm dropping it

@gabrieldutra gabrieldutra merged commit 874e0d1 into master Sep 24, 2019
@gabrieldutra gabrieldutra deleted the fix-execute-selected branch September 24, 2019 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants