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

Refactoring move.js of Designer #15378

Closed

Conversation

Bournvita1998
Copy link
Contributor

@Bournvita1998 Bournvita1998 commented Jul 8, 2019

Signed-off-by: Mohit Kuri mohit.kuri@research.iiit.ac.in

Description

Refactored move.js of the designer.

Fixes #

Before submitting pull request, please review the following checklist:

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

Signed-off-by: Mohit Kuri <mohit.kuri@research.iiit.ac.in>
@Bournvita1998
Copy link
Contributor Author

For testing, I have tested this whole thing in general. Here is an example of the same:

Using - document.getElementById('selector')

YO

Using - $('#selector')[0]

YO2

Since this worked, I replicated the same here.

@devenbansod Please review and provide feedback for the same. Will proceed further once the work till here is approved and we are good to go ahead.

Copy link
Member

@devenbansod devenbansod left a comment

Choose a reason for hiding this comment

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

@Bournvita1998 I've left a comment. It applies to all the changes.

@@ -101,7 +101,7 @@ DesignerMove.mouseDown = function (e) {
}

if (curClick !== null) {
document.getElementById('canvas').style.display = 'none';
$('#canvas')[0].style.display = 'none';
Copy link
Member

Choose a reason for hiding this comment

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

@Bournvita1998 this would work for the elements selected with IDs only. I'd ideally use .css() method to set the styles instead of manually selecting the first element and setting the native properties. IMO (even though it works) this current approach sort of doesn't use JQuery's power at all.

Using .css() would auto-loop over all the selected elements, so would be easier to read when we're selecting based on input types, classes etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @devenbansod . Don't try to hard-code things. As you're trying to refactor the code, try to do it in such a way that would let other developers work on the code without much changes to your code. It gets extremely difficult to manage such things on such a large scale.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I will make these changes asap. Thanks @devenbansod, @shucon

Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
@codecov
Copy link

codecov bot commented Jul 9, 2019

Codecov Report

Merging #15378 into master will decrease coverage by 0.26%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master   #15378      +/-   ##
============================================
- Coverage     52.99%   52.72%   -0.27%     
- Complexity    14047    14071      +24     
============================================
  Files           481      484       +3     
  Lines         62011    62131     +120     
============================================
- Hits          32862    32760     -102     
- Misses        29149    29371     +222

@Bournvita1998
Copy link
Contributor Author

@devenbansod @shucon Please have a look now

@MauricioFauth MauricioFauth changed the base branch from gsoc-db-designer to master July 12, 2019 05:49
Signed-off-by: Mohit Kuri <mohit.kuri@research.iiit.ac.in>
@Bournvita1998
Copy link
Contributor Author

I am done refactoring move.js once. Please share your reviews so that I can make the possible changes

@stale
Copy link

stale bot commented Sep 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 14, 2019
@stale stale bot closed this Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants