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
Improving designer #15165
Improving designer #15165
Conversation
Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
@Bournvita1998 I see that you have made great improvements, can you fix https://travis-ci.org/phpmyadmin/phpmyadmin/jobs/517394475#L645 before I review the PR please ? |
js/designer/database.js
Outdated
@@ -2,8 +2,7 @@ var designer_tables = [{ name: 'pdf_pages', key: 'pg_nr', auto_inc: true }, | |||
{ name: 'table_coords', key: 'id', auto_inc: true }]; | |||
|
|||
var DesignerOfflineDB = (function () { | |||
var designerDB = {}; | |||
var datastore = null; | |||
var designerDB = {}, datastore = null; |
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.
You should split var
declarations into multiple statements.
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.
I remembered that we should not declare the variables in multiple lines as per good coding practices. But found that its wrong :(. Thus reverted the changes. Also due to the same reason its showing linting error (which I have removed rn, will be displayed in the new commit).
js/designer/history.js
Outdated
document.getElementById('query_where').style.zIndex = '103'; | ||
document.getElementById('query_where').style.visibility = 'visible'; | ||
document.getElementById('query_where').style.display = 'block'; | ||
$("#eQuery").value = history_array[index].get_obj().getquery(); // get_obj(),get_query might be removed |
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.
Why replace document.getElementById
with the jQuery ID selector?
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.
I was trying to convert some of the JS into jQuery while refactoring the code. Should I continue doing this in this PR itself or should I create a new one?
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.
What I want to know is, for example in the #eQuery
case, what are the advantages in using jQuery instead of using plain JavaScript?
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.
@MauricioFauth I would like to suggest that if you hadn't looked my proposal on "Refactoring and Improving Designer" till now, please have a look at that you will definitely find the answer for "what are the advantages in using jQuery instead of using plain JavaScript?"
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.
@williamdes Here is the link to the proposal :p
https://docs.google.com/document/d/16rg0DImKFuW_dwxGXbgncJQ0NjZuglXVkRF2rUPzrwA/edit?usp=sharing
Hello. Thanks for your contribution! We require a full name for legal compliance reasons. Could you use your full name in the signature tag? |
Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
Codecov Report
@@ Coverage Diff @@
## master #15165 +/- ##
============================================
+ Coverage 52.82% 52.83% +0.01%
Complexity 14044 14044
============================================
Files 485 485
Lines 62139 62131 -8
============================================
+ Hits 32826 32829 +3
+ Misses 29313 29302 -11 |
@williamdes If everything is fine, should I go ahead with other changes? |
@Bournvita1998 I would say yes, @MauricioFauth do you agree ? |
Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in> Improved the performance of all the JS files of the designer and imrpoved the names of the new variables used.
@williamdes I am done with all the changes, please review. |
@williamdes @MauricioFauth I am thinking of closing this PR and create new PRs in a step by step manner as mentioned in my proposal. Its because I will be working on the designer project this summer. Should I go ahead? |
@Bournvita1998 I agree, good proposal ! |
Description
#15163
Signed-off-by: Bournvita1998 mohit.kuri@research.iiit.ac.in
Refactored 2 JS files of Designer
Fixes #
Before submitting pull request, please review the following checklist:
Signed-off-by
line as described in our DCO. This ensures that the work you're submitting is your own creation.