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

Open
wants to merge 3 commits into
base: master
from

Conversation

@Bournvita1998
Copy link
Contributor

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.
Refactoring move.js of Designer
Signed-off-by: Mohit Kuri <mohit.kuri@research.iiit.ac.in>
@Bournvita1998

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2019

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.

@devenbansod
Copy link
Member

left a comment

@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';

This comment has been minimized.

Copy link
@devenbansod

devenbansod Jul 8, 2019

Member

@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.

This comment has been minimized.

Copy link
@shucon

shucon Jul 8, 2019

Contributor

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.

This comment has been minimized.

Copy link
@Bournvita1998

Bournvita1998 Jul 8, 2019

Author Contributor

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

Added jQuery and removed hard-coded things
Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
@codecov

This comment has been minimized.

Copy link

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
@phpmyadmin-bot

This comment has been minimized.

Copy link

commented on af91f57 Jul 9, 2019

This commit has an invalid Signed-Off-By line, please use your full name for legal compliance reasons.
Please check Developer's Certificate of Origin
Here is a valid example: Signed-off-by: Jane Smith <jane.smith@example.org>

@Bournvita1998

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

@devenbansod @shucon Please have a look now

@mauriciofauth mauriciofauth changed the base branch from gsoc-db-designer to master Jul 12, 2019

Refactoring remaining part of move.js
Signed-off-by: Mohit Kuri <mohit.kuri@research.iiit.ac.in>
@Bournvita1998

This comment has been minimized.

Copy link
Contributor Author

commented Jul 15, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.