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

Import and Export Modularized #14469

Merged
merged 4 commits into from Aug 1, 2018

Conversation

Projects
None yet
2 participants
@Piyush3079
Copy link
Contributor

Piyush3079 commented Jul 8, 2018

This pr contains the modular code for Import and Export js files.

This pr is in continuation of Mod_Jd_Navigation. Before reviewing this pr, review Mod_Js_Navigation and merge and then compare with this pr.
Before submitting pull request, please check that every commit:

  • Has proper Signed-Off-By
  • Has commit message which describes it
  • Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
  • Any new functionality is covered by tests

@devenbansod devenbansod self-requested a review Jul 30, 2018

@devenbansod devenbansod self-assigned this Jul 30, 2018

@devenbansod devenbansod changed the base branch from master to gsoc-js-refactoring Jul 30, 2018

@devenbansod

This comment has been minimized.

Copy link
Member

devenbansod commented Jul 30, 2018

Please rebase and remove conflicts.

@Piyush3079 Piyush3079 force-pushed the Piyush3079:Mod_Js_Import_Export branch from fee3432 to 6c119c9 Jul 30, 2018

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jul 30, 2018

Codecov Report

❗️ No coverage uploaded for pull request base (gsoc-js-refactoring@00e9049). Click here to learn what that means.
The diff coverage is 15.17%.

@@                  Coverage Diff                   @@
##             gsoc-js-refactoring   #14469   +/-   ##
======================================================
  Coverage                       ?   49.93%           
  Complexity                     ?    14435           
======================================================
  Files                          ?      504           
  Lines                          ?    68973           
  Branches                       ?        0           
======================================================
  Hits                           ?    34442           
  Misses                         ?    34531           
  Partials                       ?        0

@Piyush3079 Piyush3079 force-pushed the Piyush3079:Mod_Js_Import_Export branch 6 times, most recently from 3b774a6 to f6f397d Jul 30, 2018

@Piyush3079
Copy link
Contributor Author

Piyush3079 left a comment

General comments to increase the readability of the pr.

@@ -1,3 +1,5 @@
js/vendor/
tmp/
vendor/
js/dist/

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

Add some folders to avoid check of linting

@@ -56,3 +56,6 @@ composer.lock
# NPM
/node_modules/
yarn.lock
# Javascript Bundle

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

Add some folders to gitignore to avoid pushing them to the repo

@@ -0,0 +1,678 @@
/**

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

Chart class needed for drawing chart of server_status_queries.php page

server_status_advisor: ['server_status_advisor'],
server_status_processes: ['server_status_processes'],
server_status_variables: ['server_status_variables'],
user_password: ['server_privileges']
user_password: ['server_privileges'],

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

Other server related files and server import and export files are added to the object

@@ -0,0 +1,391 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

Modular code for exporting sql.
Functions required for this file are imported from a files js/src/functions/export.js

@@ -20,7 +20,7 @@
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('import.js');
$scripts->addFile('import');

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

.js extension removed from file to enable dynamic import

@@ -26,7 +26,7 @@
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_privileges');
$scripts->addFile('replication.js');
$scripts->addFile('replication');

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

.js extension removed from file to enable dynamic import

@@ -30,8 +30,8 @@
$scripts->addFile('vendor/jqplot/plugins/jqplot.highlighter.js');
$scripts->addFile('vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js');
$scripts->addFile('vendor/jquery/jquery.tablesorter.js');
$scripts->addFile('server_status_sorter.js');
$scripts->addFile('server_status_queries.js');
$scripts->addFile('server_status_sorter');

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

.js extension removed from file to enable dynamic import

@@ -23,7 +23,7 @@
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('server_user_groups.js');
$scripts->addFile('server_user_groups');

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

.js extension removed from file to enable dynamic import

@@ -19,6 +19,6 @@
{#- If the time limit set is zero, then time out won't occur so no need
to check for time out. -#}
{%- if exec_time_limit > 0 %}
onclick="check_time_out({{ exec_time_limit }})"
data-timeout={{ exec_time_limit }}

This comment has been minimized.

@Piyush3079

Piyush3079 Jul 30, 2018

Author Contributor

removed inline onClick event which requires the function to be available in the global scope.
Added the value of timeOut in data and the add an event in export.js to make call to this function.

Piyush3079 added some commits Jun 24, 2018

Edit ndex files and more files whitelisted in ajax.js and files.js for
adding them in modular code.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
Modularize server related remaining files like replication, plugins, …
…queries, processes.

Sever monitor is also modularised and is not working but jQplot is not imported as it is giving error with webpack.
Another issue with these files is that table sorter is also not woking
working properly as it is not available on npm as plugin.
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>

@Piyush3079 Piyush3079 force-pushed the Piyush3079:Mod_Js_Import_Export branch from ba8ca5d to d111a2c Jul 30, 2018

Piyush3079 added some commits Jul 30, 2018

Remove some functions to make this pr reproduceable on local machine.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
Add event for submit of export sql form to remove error of undefined …
…function.

Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
@devenbansod
Copy link
Member

devenbansod left a comment

Tested locally. Works fine for me.

@devenbansod devenbansod merged commit 5e9d705 into phpmyadmin:gsoc-js-refactoring Aug 1, 2018

1 of 2 checks passed

Codacy/PR Quality Review Codacy was unable to analyse your pull request.
Details
DCO All commits have a DCO sign-off from the author
Details
@Piyush3079

This comment has been minimized.

Copy link
Contributor Author

Piyush3079 commented Aug 2, 2018

With this pr the tablesorter plugin of jquery is broken as the plugin available on npm is comparatively large as compared to the one we are using with the downloaded version. This issue is resolved in the future pr as these plugins are downloaded from github with the versions upgraded so that the plugins will not give error with webpack based code.

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