Skip to content

Commit

Permalink
Merge branch 'QA_5_2'
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Apr 28, 2022
2 parents b008cca + 49e2b08 commit 6dc859c
Show file tree
Hide file tree
Showing 32 changed files with 52 additions and 117 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -30,6 +30,7 @@ phpMyAdmin - ChangeLog
- issue #16197 Replace the master/slave terminology
- issue #17257 Replace libraries/vendor_config.php constants with an array
- issue Add the Bootstrap theme
- issue #17499 Remove stickyfilljs JavaScript dependency

5.1.4 (not yet released)
- issue #17287 Fixed sorting the database list with "statistics" enabled on "Data" column creates a PHP type error
Expand Down
2 changes: 1 addition & 1 deletion doc/faq.rst
Expand Up @@ -1905,7 +1905,7 @@ to plot' field. Once you have decided over your criteria, click 'Go'
to display the plot.

After the plot is generated, you can use the
mousewheel to zoom in and out of the plot. In addition, panning
mouse wheel to zoom in and out of the plot. In addition, panning
feature is enabled to navigate through the plot. You can zoom-in to a
certain level of detail and use panning to locate your area of
interest. Clicking on a point opens a dialogue box, displaying field
Expand Down
13 changes: 4 additions & 9 deletions js/src/gis_data_editor.js
Expand Up @@ -96,15 +96,10 @@ function loadJSAndGISEditor (value, field, type, inputName) {
var head = document.getElementsByTagName('head')[0];
var script;

// Loads a set of small JS file needed for the GIS editor
var smallScripts = ['js/vendor/jquery/jquery.mousewheel.js', 'js/dist/table/gis_visualization.js'];

for (var i = 0; i < smallScripts.length; i++) {
script = document.createElement('script');
script.type = 'text/javascript';
script.src = smallScripts[i];
head.appendChild(script);
}
script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'js/dist/table/gis_visualization.js';
head.appendChild(script);

// OpenLayers.js is BIG and takes time. So asynchronous loading would not work.
// Load the JS and do a callback to load the content for the GIS Editor.
Expand Down
7 changes: 0 additions & 7 deletions js/src/sql.js
Expand Up @@ -7,7 +7,6 @@
* @test-module Sql
*/

/* global Stickyfill */
/* global isStorageSupported */ // js/config.js
/* global codeMirrorEditor */ // js/functions.js
/* global makeGrid */ // js/makegrid.js
Expand Down Expand Up @@ -1089,9 +1088,3 @@ AJAX.registerOnload('sql.js', function () {
Sql.makeProfilingChart();
Sql.initProfilingTables();
});

/**
* Polyfill to make table headers sticky.
*/
var elements = $('.sticky');
Stickyfill.add(elements);
6 changes: 4 additions & 2 deletions js/src/table/gis_visualization.js
Expand Up @@ -2,7 +2,6 @@
* @fileoverview functions used for visualizing GIS data
*
* @requires jquery
* @requires vendor/jquery/jquery.mousewheel.js
*/

/* global drawOpenLayers */ // templates/table/gis_visualization/gis_visualization.twig
Expand Down Expand Up @@ -148,6 +147,9 @@ function getRelativeCoords (e) {
};
}

/**
* @param {WheelEvent} event
*/
function onGisMouseWheel (event) {
if (event.deltaY === 0) {
return;
Expand All @@ -169,7 +171,7 @@ function onGisMouseWheel (event) {
*
* Actions Ajaxified here:
*
* Zooming in and zooming out on mousewheel movement.
* Zooming in and zooming out on mouse wheel movement.
* Panning the visualization on dragging.
* Zooming in on double clicking.
* Zooming out on clicking the zoom out button.
Expand Down
7 changes: 1 addition & 6 deletions libraries/classes/Controllers/Database/SearchController.php
Expand Up @@ -38,12 +38,7 @@ public function __invoke(): void
$GLOBALS['tooltip_aliasname'] = $GLOBALS['tooltip_aliasname'] ?? null;
$GLOBALS['pos'] = $GLOBALS['pos'] ?? null;

$this->addScriptFiles([
'database/search.js',
'vendor/stickyfill.min.js',
'sql.js',
'makegrid.js',
]);
$this->addScriptFiles(['database/search.js', 'sql.js', 'makegrid.js']);

$this->checkParameters(['db']);

Expand Down
7 changes: 1 addition & 6 deletions libraries/classes/Controllers/Database/SqlController.php
Expand Up @@ -34,12 +34,7 @@ public function __invoke(): void
$GLOBALS['back'] = $GLOBALS['back'] ?? null;
$GLOBALS['errorUrl'] = $GLOBALS['errorUrl'] ?? null;

$this->addScriptFiles([
'makegrid.js',
'vendor/jquery/jquery.uitablefilter.js',
'vendor/stickyfill.min.js',
'sql.js',
]);
$this->addScriptFiles(['makegrid.js', 'vendor/jquery/jquery.uitablefilter.js', 'sql.js']);

$pageSettings = new PageSettings('Sql');
$this->response->addHTML($pageSettings->getErrorHTML());
Expand Down
7 changes: 1 addition & 6 deletions libraries/classes/Controllers/Server/SqlController.php
Expand Up @@ -38,12 +38,7 @@ public function __invoke(): void
{
$GLOBALS['errorUrl'] = $GLOBALS['errorUrl'] ?? null;

$this->addScriptFiles([
'makegrid.js',
'vendor/jquery/jquery.uitablefilter.js',
'vendor/stickyfill.min.js',
'sql.js',
]);
$this->addScriptFiles(['makegrid.js', 'vendor/jquery/jquery.uitablefilter.js', 'sql.js']);

$pageSettings = new PageSettings('Sql');
$this->response->addHTML($pageSettings->getErrorHTML());
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Controllers/Sql/SqlController.php
Expand Up @@ -77,7 +77,6 @@ public function __invoke(): void
'vendor/jquery/jquery.uitablefilter.js',
'table/change.js',
'indexes.js',
'vendor/stickyfill.min.js',
'gis_data_editor.js',
'multi_column_sort.js',
]);
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Controllers/Table/ChangeController.php
Expand Up @@ -139,7 +139,6 @@ public function __invoke(): void

$this->addScriptFiles([
'makegrid.js',
'vendor/stickyfill.min.js',
'sql.js',
'table/change.js',
'vendor/jquery/additional-methods.js',
Expand Down
8 changes: 1 addition & 7 deletions libraries/classes/Controllers/Table/ReplaceController.php
Expand Up @@ -108,13 +108,7 @@ public function __invoke(): void
*/
$GLOBALS['goto_include'] = false;

$this->addScriptFiles([
'makegrid.js',
'vendor/stickyfill.min.js',
'sql.js',
'indexes.js',
'gis_data_editor.js',
]);
$this->addScriptFiles(['makegrid.js', 'sql.js', 'indexes.js', 'gis_data_editor.js']);

$insertRows = $_POST['insert_rows'] ?? null;
if (is_numeric($insertRows) && $insertRows != $GLOBALS['cfg']['InsertRows']) {
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Controllers/Table/SearchController.php
Expand Up @@ -181,7 +181,6 @@ public function __invoke(): void

$this->addScriptFiles([
'makegrid.js',
'vendor/stickyfill.min.js',
'sql.js',
'table/select.js',
'table/change.js',
Expand Down
7 changes: 1 addition & 6 deletions libraries/classes/Controllers/Table/SqlController.php
Expand Up @@ -38,12 +38,7 @@ public function __invoke(): void
$GLOBALS['goto'] = $GLOBALS['goto'] ?? null;
$GLOBALS['back'] = $GLOBALS['back'] ?? null;

$this->addScriptFiles([
'makegrid.js',
'vendor/jquery/jquery.uitablefilter.js',
'vendor/stickyfill.min.js',
'sql.js',
]);
$this->addScriptFiles(['makegrid.js', 'vendor/jquery/jquery.uitablefilter.js', 'sql.js']);

$pageSettings = new PageSettings('Sql');
$this->response->addHTML($pageSettings->getErrorHTML());
Expand Down
Expand Up @@ -106,7 +106,6 @@ public function __invoke(): void
DbTableExists::check($GLOBALS['db'], $GLOBALS['table']);

$this->addScriptFiles([
'vendor/stickyfill.min.js',
'makegrid.js',
'sql.js',
'vendor/jqplot/jquery.jqplot.js',
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Display/Results.php
Expand Up @@ -1111,7 +1111,7 @@ private function getFieldVisibilityParams(

$displayParams['emptypre'] = $emptyPreCondition ? 4 : 0;

$buttonHtml .= '<th class="column_action sticky d-print-none"' . $colspan
$buttonHtml .= '<th class="column_action position-sticky d-print-none"' . $colspan
. '>' . $fullOrPartialTextLink . '</th>';
} elseif (
$leftOrBoth
Expand All @@ -1125,7 +1125,7 @@ private function getFieldVisibilityParams(
} elseif ($GLOBALS['cfg']['RowActionLinks'] === self::POSITION_NONE) {
// ... elseif display an empty column if the actions links are
// disabled to match the rest of the table
$buttonHtml .= '<th class="column_action sticky"></th>';
$buttonHtml .= '<th class="column_action position-sticky"></th>';
}

$this->properties['display_params'] = $displayParams;
Expand Down
1 change: 0 additions & 1 deletion libraries/classes/Header.php
Expand Up @@ -137,7 +137,6 @@ private function addDefaultScripts(): void
$this->scripts->addFile('name-conflict-fixes.js');
$this->scripts->addFile('vendor/bootstrap/bootstrap.bundle.min.js');
$this->scripts->addFile('vendor/js.cookie.js');
$this->scripts->addFile('vendor/jquery/jquery.mousewheel.js');
$this->scripts->addFile('vendor/jquery/jquery.validate.js');
$this->scripts->addFile('vendor/jquery/jquery-ui-timepicker-addon.js');
$this->scripts->addFile('vendor/jquery/jquery.debounce-1.0.6.js');
Expand Down
2 changes: 0 additions & 2 deletions libraries/classes/Sql.php
Expand Up @@ -1086,7 +1086,6 @@ private function getQueryResponseForNoResultsReturned(
if ($profilingResults !== null) {
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('vendor/stickyfill.min.js');
$scripts->addFile('sql.js');

$profiling = $this->getDetailedProfilingStats($profilingResults);
Expand Down Expand Up @@ -1495,7 +1494,6 @@ private function getQueryResponseForResultsReturned(

if (! isset($_POST['printview']) || $_POST['printview'] != '1') {
$scripts->addFile('makegrid.js');
$scripts->addFile('vendor/stickyfill.min.js');
$scripts->addFile('sql.js');
unset($GLOBALS['message']);
//we don't need to buffer the output in getMessage here.
Expand Down
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -24,7 +24,6 @@
"jquery": "3.6.0",
"jquery-debounce-throttle": "^1.0.6-rc.0",
"jquery-migrate": "3.3.2",
"jquery-mousewheel": "3.1.13",
"jquery-ui-dist": "1.12.1",
"jquery-ui-timepicker-addon": "1.6.3",
"jquery-uitablefilter": "^1.0.0",
Expand All @@ -39,7 +38,6 @@
"rtlcss": "^3.3.0",
"sass": "^1.42.1",
"sass-loader": "^12.4.0",
"stickyfilljs": "2.1.0",
"tablesorter": "^2.31.3",
"tracekit": "0.4.6",
"u2f-api-polyfill": "0.4.4",
Expand Down
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Expand Up @@ -8825,6 +8825,11 @@ parameters:
count: 1
path: test/classes/CommonTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with null will always evaluate to false\\.$#"
count: 1
path: test/classes/Config/FormDisplayTest.php

-
message: "#^Cannot access offset 'pma_testform' on mixed\\.$#"
count: 1
Expand Down Expand Up @@ -10220,6 +10225,11 @@ parameters:
count: 1
path: test/classes/Partitioning/TablePartitionDefinitionTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with 32 and 0 will always evaluate to false\\.$#"
count: 1
path: test/classes/Plugins/Auth/AuthenticationCookieTest.php

-
message: "#^Method PhpMyAdmin\\\\Tests\\\\Plugins\\\\Auth\\\\AuthenticationCookieTest\\:\\:checkRulesProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion templates/display/results/table_headers_for_columns.twig
@@ -1,5 +1,5 @@
{% for column in columns %}
<th class="draggable sticky{{ column.is_column_numeric ? ' text-end' }}{{ column.is_column_hidden ? ' hide' -}}
<th class="draggable position-sticky{{ column.is_column_numeric ? ' text-end' }}{{ column.is_column_hidden ? ' hide' -}}
{{- is_sortable ? ' column_heading' }}{{ is_sortable and column.is_browse_marker_enabled ? ' marker' }}{{ is_sortable and column.is_browse_pointer_enabled ? ' pointer' -}}
{{- not is_sortable and column.has_condition ? ' condition' }}" data-column="{{ column.column_name }}">
{% if is_sortable %}
Expand Down
1 change: 0 additions & 1 deletion test/jest/test-env.js
Expand Up @@ -6,4 +6,3 @@ global.jQuery = $;
global.CommonParams = require('phpmyadmin/common');
global.AJAX = require('phpmyadmin/ajax');
global.Functions = require('phpmyadmin/functions');
global.Stickyfill = require('@vendor/stickyfill.min');
10 changes: 0 additions & 10 deletions themes/bootstrap/scss/_common.scss
Expand Up @@ -1497,12 +1497,6 @@ input#auto_increment_opt {
}
}

.sticky {
position: -webkit-sticky;
position: sticky;
top: 60px;
}

.pma_table {
td {
position: static;
Expand Down Expand Up @@ -2632,10 +2626,6 @@ body .ui-dialog {
overflow-x: auto;
}

.sticky {
top: 0;
}

body#loginform div.container {
width: 100%;
}
Expand Down
5 changes: 5 additions & 0 deletions themes/bootstrap/scss/_tables.scss
@@ -0,0 +1,5 @@
@media only screen and (min-width: 768px) {
.table th.position-sticky {
top: 96px;
}
}
1 change: 1 addition & 0 deletions themes/bootstrap/scss/theme.scss
Expand Up @@ -9,6 +9,7 @@
@import "jqplot";
@import "icons";
@import "reboot";
@import "tables";
@import "forms";
@import "breadcrumb";
@import "print";
Expand Down
12 changes: 0 additions & 12 deletions themes/metro/scss/_common.scss
Expand Up @@ -1710,12 +1710,6 @@ form.append_fields_form .tblFooters {
}
}

.sticky {
position: -webkit-sticky;
position: sticky;
top: 60px;
}

.pma_table {
td {
position: static;
Expand Down Expand Up @@ -2856,12 +2850,6 @@ body {
}
}

@media only screen and (max-width: 768px) {
.sticky {
top: 0;
}
}

.resize-vertical {
resize: vertical;
}
6 changes: 6 additions & 0 deletions themes/metro/scss/_tables.scss
Expand Up @@ -16,3 +16,9 @@
}
}
}

@media only screen and (min-width: 768px) {
.table th.position-sticky {
top: 87px;
}
}
10 changes: 0 additions & 10 deletions themes/original/scss/_common.scss
Expand Up @@ -1508,12 +1508,6 @@ input#auto_increment_opt {
}
}

.sticky {
position: -webkit-sticky;
position: sticky;
top: 60px;
}

.pma_table {
td {
position: static;
Expand Down Expand Up @@ -2616,10 +2610,6 @@ body {
overflow-x: auto;
}

.sticky {
top: 0;
}

body#loginform div.container {
width: 100%;
}
Expand Down
6 changes: 6 additions & 0 deletions themes/original/scss/_tables.scss
Expand Up @@ -32,3 +32,9 @@
--#{$variable-prefix}table-hover-color: #{$table-hover-color};
--#{$variable-prefix}table-hover-bg: #{$table-hover-bg};
}

@media only screen and (min-width: 768px) {
.table th.position-sticky {
top: 49px;
}
}

0 comments on commit 6dc859c

Please sign in to comment.