-
Notifications
You must be signed in to change notification settings - Fork 208
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
Update defaultHtmlSequencerUi.js #1712
Conversation
Fixed Module Selector dropdown showing error in console publiclab#1531
Thanks for opening this pull request! |
Codecov Report
@@ Coverage Diff @@
## main #1712 +/- ##
===========================================
+ Coverage 55.11% 65.41% +10.29%
===========================================
Files 117 132 +15
Lines 2344 2741 +397
Branches 360 438 +78
===========================================
+ Hits 1292 1793 +501
+ Misses 1052 948 -104
|
@@ -28,7 +28,7 @@ function DefaultHtmlSequencerUi(_sequencer, options) { | |||
function selectNewStepUi() { | |||
var m = $(addStepSel + ' select').val(); | |||
if(!m) m = arguments[0]; | |||
$(addStepSel + ' .info').html(_sequencer.modulesInfo(m).description); | |||
else $(addStepSel + ' .info').html(_sequencer.modulesInfo(m).description); |
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.
Hi! Hm, @blurry-x-face are you sure about this? I believe line 30 is checking if it's unset. Wouldn't this else
skip displaying the description if that is the case? Sorry if I misunderstand!
Thank you @bajajvinamr for your help, and happy to approve if you can explain and maybe I misunderstand!
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.
No @jywarren , this works fine because what was happening was that when no module was selected(m===null
) it was still running $(addStepSel + ' .info').html(_sequencer.modulesInfo(m).description);
hence showing error on calling moduleInfo with null
value, now after adding this else
clause it will run only when there is a module selected hence no error will be displayed on the console if m
was null
I reviewed it in gitpod, it works fine there, we can also add this in moduleInfo function that if NULL is given as an argument it could return a statement like No module selected
or something similar.
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.
Ok sounds great! Thanks for the clarification!
Congrats on merging your first pull request! 🙌🎉⚡️ |
Great work and many thanks!!!!! 🔥 |
Thanks a lot! |
Fixed Module Selector dropdown showing error in console #1531
Fixes #0000 (<=== Replace
0000
with the Issue Number)Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
npm run test-all
@publiclab/is-reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part
Thanks!