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 QE JS helpers' debounce not preserving this #11707

Merged
merged 2 commits into from Oct 5, 2016
Merged

Fix QE JS helpers' debounce not preserving this #11707

merged 2 commits into from Oct 5, 2016

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Oct 5, 2016

In #11390, we introduced helper functions to make the QE's life easier. But there was a bug where the modified _.debounce would not preserve the value of this all the way to the callback.

It got disabled in #11697, so this PR is re-enabling the functionality, and fixing the this bug..

Now, assuming new_debounced_func is called with the right this, it's passed to debounced_func, then orig_debounce preserves that so it gets passed to new_func, which means that with this change, it gets propagated to func too.

Re-added euwe/yes to #11390, adding here as well..

Cc @martinpovolny, @h-kataria

previously, we were always providing an empty object as `this` in the debounced function

Now, assuming `new_debounced_func` is called with the right `this`, it's passed to `debounced_func`, then `orig_debounce` preserves that so it gets passed to `new_func`, which means that with this change, it gets propagated to `func` too.
@miq-bot
Copy link
Member

miq-bot commented Oct 5, 2016

Checked commits https://github.com/himdel/manageiq/compare/841b010966e16d6cf09c1b454de0ab7b5cdee176~...cc3bb44beaeefe0b9f45210fff6562b418311a0c with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
0 files checked, 0 offenses detected
Everything looks good. 🍰

@h-kataria
Copy link
Contributor

Tested fix in UI, looks good.

@dclarizio dclarizio merged commit f1b91c1 into ManageIQ:master Oct 5, 2016
@dclarizio dclarizio added this to the Sprint 48 Ending Oct 24, 2016 milestone Oct 5, 2016
chessbyte pushed a commit that referenced this pull request Oct 5, 2016
Fix QE JS helpers' debounce not preserving this
(cherry picked from commit f1b91c1)
@chessbyte
Copy link
Member

Euwe Backport details:

$ git log
commit 9d9ec75abeefa5628b2a0ad7b6b8a2978d1a551f
Author: Dan Clarizio <dclarizi@redhat.com>
Date:   Wed Oct 5 08:54:07 2016 -0700

    Merge pull request #11707 from himdel/fix-qe

    Fix QE JS helpers' debounce not preserving this
    (cherry picked from commit f1b91c10a47375d149f73575934427d07f2b1146)

@simaishi
Copy link
Contributor

Backported to Darga via #11911

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.

None yet

7 participants