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

Update defaultHtmlSequencerUi.js #1712

Merged
merged 2 commits into from
Oct 1, 2020
Merged

Update defaultHtmlSequencerUi.js #1712

merged 2 commits into from
Oct 1, 2020

Conversation

bajajvinamr
Copy link

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!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm run test-all
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below
  • Insert-step functionality is working correct as expected.

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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!

Fixed Module Selector dropdown showing error in console publiclab#1531
@welcome
Copy link

welcome bot commented Sep 3, 2020

Thanks for opening this pull request!
There may be some errors, but don't worry! We're here to help! 👍🎉😄

@gitpod-io
Copy link

gitpod-io bot commented Sep 3, 2020

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #1712 into main will increase coverage by 10.29%.
The diff coverage is 63.90%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
examples/lib/scopeQuery.js 18.51% <ø> (ø)
src/Modules.js 100.00% <ø> (ø)
src/modules/WebglDistort/Module.js 2.29% <0.00%> (ø)
src/ui/SetInputStep.js 12.90% <0.00%> (-1.39%) ⬇️
src/modules/ColorHalftone/Module.js 3.63% <3.63%> (ø)
examples/lib/defaultHtmlStepUi.js 11.35% <4.08%> (-0.85%) ⬇️
examples/lib/intermediateHtmlStepUi.js 11.11% <5.55%> (+0.94%) ⬆️
examples/lib/insertPreview.js 13.15% <20.00%> (-0.36%) ⬇️
src/util/getImageDimensions.js 20.00% <20.00%> (ø)
src/util/isGif.js 20.00% <20.00%> (ø)
... and 100 more

@@ -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);
Copy link
Member

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!

Copy link
Member

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.

Copy link
Member

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!

@jywarren jywarren merged commit 8a929c4 into publiclab:main Oct 1, 2020
@welcome
Copy link

welcome bot commented Oct 1, 2020

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will be published to https://beta.sequencer.publiclab.org in a day or two.
In the meantime, can you tell us your Twitter handle so we can thank you properly?
Now that you've completed this, you can help someone else take their first step!
See: Public Lab's coding community!

@jywarren
Copy link
Member

jywarren commented Oct 1, 2020

Great work and many thanks!!!!! 🔥

@bajajvinamr
Copy link
Author

bajajvinamr commented Oct 1, 2020

Great work and many thanks!!!!! 🔥

Thanks a lot!
Feels great to have mentors like @jywarren & @blurry-x-face , would try to contribute more!
Also, my twitter handle is https://twitter.com/VinamrBajaj

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.

None yet

3 participants