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

Disable execute when params are dirty #4001

Merged
merged 3 commits into from
Jul 22, 2019
Merged

Disable execute when params are dirty #4001

merged 3 commits into from
Jul 22, 2019

Conversation

ranbena
Copy link
Contributor

@ranbena ranbena commented Jul 21, 2019

  • Bug Fix

Description

Fixes #3997.

The bug

There are a few execution paths in query.js and not all apply "pending param changes" before execution. In this scenario changes have not been applied, executing the parameter's initial value instead of the pending value.

The fix

Instead of coding applyPendingChanges() into every which way, made it so execution by button and shortcut are disabled when params are dirty.

  • Disable button (also bottom one) and kb shortcut when params dirty
  • Allow execution upon applying param changes from button and kb shortcut
  • Add relevant tests

What is commit a02a2dc for?

Since the query page already listens to ctrl+enter, I previously had to disable the params listener to prevent multiple listeners from executing. But now that param dirty state disables the query shortcut, there's no risk of that happening, so the whole mechanism can be removed.


@ranbena ranbena requested a review from arikfr July 21, 2019 12:40
@ranbena ranbena self-assigned this Jul 21, 2019
@ranbena ranbena changed the title Disable execute Disable execute when params are dirty Jul 21, 2019
@ranbena ranbena marked this pull request as ready for review July 21, 2019 13:03
Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

👍

@arikfr arikfr merged commit 64f274f into master Jul 22, 2019
@arikfr arikfr deleted the disable-execute branch July 22, 2019 09:13
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Nov 14, 2019
* Disable execute when params dirty

* Removed special apply handling for query page

* Updated tests
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.

null passed as parameter value.
3 participants