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

Added second spinner #691

Merged
merged 1 commit into from
Jan 23, 2019
Merged

Added second spinner #691

merged 1 commit into from
Jan 23, 2019

Conversation

aashna27
Copy link

@aashna27 aashna27 commented Jan 19, 2019

Fixes #679

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 test
  • 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

Thanks!

@aashna27
Copy link
Author

@publiclab/is-reviewers

@aashna27
Copy link
Author

@jywarren

Copy link
Member

@harshkhandeparkar harshkhandeparkar left a comment

Choose a reason for hiding this comment

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

You can shoten the code by using jquery hasClass('fa-caret-down')

dist/image-sequencer-ui.js Outdated Show resolved Hide resolved
@@ -216,11 +217,16 @@ function DefaultHtmlStepUi(_sequencer, options) {
function onDraw(step) {
$(step.ui.querySelector(".load")).show();
Copy link
Member

@rexagod rexagod Jan 20, 2019

Choose a reason for hiding this comment

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

One thing that I'd like to propose here is storing all these "query selected elements" into their respective descriptively named variables and using them instead so as to make the code more readable. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Yes that seems good. Also I was thinking something. step.ui.querySelector is used a lot of times in this code so instead maybe we can write a shorthand function which returns step.ui.querySelector wrapped in jquery.

Maybe

function stepSelector(queryString){
  return $(step.ui.querySelector(queryString));
}

If this idea is good then it can be a new issue even. Maybe an fto-candidate.

Copy link
Member

Choose a reason for hiding this comment

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

Definitely @harshkhandeparkar! Thinking about it now makes me wonder that there must be many more snippets such as this one in the codebase that can be optimized. We can actually open up and pin an issue with a label like first-timer-opportunity, promoting among new contributors the practice to find and execute such refactor opportunities hidden in the codebase to make it more readable and submit those refactored codes as fto PRs which can help us immensely in the future!! Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Thats an amazing idea. Maybe we can even add an fto issue to create another issue with many such refactor opportunities and then mark that issue as break-me-up and that issue can then be broken up into many more ftos. We can also create one issue about this stepSelector now and give it as an example. Thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

One thing that I'd like to propose here is storing all these "query selected elements" into their respective descriptively named variables and using them instead so as to make the code more readable. Thanks!

I appreciate your idea, and think that refactoring can be done for the entire project as you guys are discussing. And I think let's keep refactoring separate from this pr. Also if there are any more suggestions , please provide inputs.

Copy link
Member

@rexagod rexagod Jan 21, 2019

Choose a reason for hiding this comment

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

@jywarren We'd love to hear from you regarding the above ideas. Thanks!

Copy link
Member

@harshkhandeparkar harshkhandeparkar left a comment

Choose a reason for hiding this comment

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

Looks good to me! Waiting for @rexagod

@harshkhandeparkar
Copy link
Member

I guess this is good to go

@harshkhandeparkar
Copy link
Member

Thanks!

@jywarren
Copy link
Member

jywarren commented Jan 21, 2019 via email

@jywarren
Copy link
Member

jywarren commented Jan 21, 2019 via email

@harshkhandeparkar
Copy link
Member

@jywarren yes it is ready for final review. All the PRs with the label are ready for final review.

@jywarren
Copy link
Member

Ok! Ready to merge as soon as it's rebased, thank you!!!

@aashna27
Copy link
Author

@jywarren I have rebased, it's now ready to merge.

@jywarren jywarren merged commit 3c2d654 into publiclab:main Jan 23, 2019
@jywarren
Copy link
Member

Super great work!!!

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.

4 participants