-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fixes unexpected behavior of step panel dropdown #1328
Conversation
@jywarren @harshkhandeparkar Can you please review the changes!! |
Codecov Report
@@ Coverage Diff @@
## main #1328 +/- ##
==========================================
- Coverage 66.58% 66.57% -0.02%
==========================================
Files 125 125
Lines 2547 2546 -1
Branches 397 397
==========================================
- Hits 1696 1695 -1
Misses 851 851
|
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.
LGTM 👍
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.
The issue here is that $step
becomes a global variable. The fix here is a workaround rather than a proper solution.
I would like to suggest a better solution.
The variables $step
and $stepAll
can be isolated by making them a part of the step
variable. step.$step
and step.$stepAll
.
Please change the following lines and it should work.
File: scopeQuery.js
- line 51-53
function scopeSelector(scope){
- return $scope(scope);
+ return new $scope(scope);
}
- line 61-63
function scopeSelector(scope){
- return $scopeAll(scope);
+ return new $scopeAll(scope);
}
File: defaultHtmlStepUI.js
- line 18-19
- let $step, $stepAll;
-
- line 74-77
- $step = scopeQuery.scopeSelector(step.ui);
- $stepAll = scopeQuery.scopeSelectorAll(step.ui);
- step.ui.$step = $step;
- step.ui.$stepAll = $stepAll;
and replace by
+ step.$step = scopeQuery.scopeSelector(step.ui);
+ step.$stepAll = scopeQuery.scopeSelectorAll(step.ui);
+ let {$step, $stepAll} = step;
-
line 192-194: Revert the changes
-
line 261
- function onDraw() {
+ function onDraw({$step, $stepAll}) {
- line 267-269
function onComplete(step) {
+ let {$step, $stepAll} = step;
$step('img').show();
$stepAll('.load-spin').hide();
Thank You!
@jywarren So made changes as per the @harshkhandeparkar review. I also think it good to make $step , $stepAll local variable. Thanks a lot, @harshkhandeparkar for such a constructive review |
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 am extremely sorry I forgot the intermediateHtmlStepUi
file. I was going through your latest changes and I found out that insert step was not working.
Please change line 78-79
- const $step = step.ui.$step,
- $stepAll = step.ui.$stepAll;
+ const $step = step.$step,
+ $stepAll = step.$stepAll;
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.
LGTM. Just check everything once locally. Thanks!
Thanks!! @harshkhandeparkar for notifying me |
Great work!!! |
* Fixes dropdown * Update defaultHtmlStepUi.js * Update intermediateHtmlStepUi.js
Fixes #1327
![Untitled_ Dec 6 2019 3_24 AM](https://user-images.githubusercontent.com/45951376/70277621-bf6a2200-17d8-11ea-86a5-d9ead4e63545.gif)
Fixes unexpected behavior of step panel dropdown