From 737bc6a965f67cefe0acf9a30c8e72a70ec01fde Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Wed, 25 Aug 2021 11:05:28 +0530 Subject: [PATCH] Ensure that the lock panel should not be blocked for larger records. Fixes #6570 --- docs/en_US/release_notes_5_7.rst | 1 + web/pgadmin/dashboard/static/js/dashboard.js | 24 ++++++++++++++++++-- web/pgadmin/static/scss/_pgadmin.style.scss | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_5_7.rst b/docs/en_US/release_notes_5_7.rst index f0d28f183..7eea255ca 100644 --- a/docs/en_US/release_notes_5_7.rst +++ b/docs/en_US/release_notes_5_7.rst @@ -25,6 +25,7 @@ Bug fixes | `Issue #6531 `_ - Fixed the export image issue where relation lines are over the nodes. | `Issue #6544 `_ - Fixed width limitation issue in PSQL tool window. | `Issue #6564 `_ - Fixed an issue where columns with sequences get altered unnecessarily with a schema diff tool. +| `Issue #6570 `_ - Ensure that the lock panel should not be blocked for larger records. | `Issue #6572 `_ - Partially fixes the data output panel display issue. | `Issue #6641 `_ - Enables pgAdmin to retrieve user permissions in case of nested roles which helps to terminate the session for AWS RDS. | `Issue #6663 `_ - Fixed no attribute '_asdict' error when connecting the database server. diff --git a/web/pgadmin/dashboard/static/js/dashboard.js b/web/pgadmin/dashboard/static/js/dashboard.js index 8d7e42ecc..4a1475aea 100644 --- a/web/pgadmin/dashboard/static/js/dashboard.js +++ b/web/pgadmin/dashboard/static/js/dashboard.js @@ -480,9 +480,17 @@ define('pgadmin.dashboard', [ $(container).data('grid', grid); $(container).data('filter', filter); }, - + __loadMoreRows: function(e) { + let elem = e.currentTarget; + if ((elem.scrollHeight - 10) < elem.scrollTop + elem.offsetHeight) { + if (this.data.length > 0) { + this.local_grid.collection.add(this.data.splice(0, 50)); + } + } + }, // Render the data in a grid render_grid_data: function(container) { + var that = this; var data = $(container).data('data'), grid = $(container).data('grid'), filter = $(container).data('filter'); @@ -493,7 +501,11 @@ define('pgadmin.dashboard', [ data.fetch({ reset: true, - success: function() { + success: function(res) { + that.data = res.models; + that.local_grid = grid; + grid.collection.reset(that.data.splice(0,50)); + // If we're showing an error, remove it, and replace the grid & filter if ($(container).hasClass('grid-error')) { $(container).removeClass('grid-error'); @@ -501,6 +513,14 @@ define('pgadmin.dashboard', [ $(filter.el).show(); } + if(that.data.length > 50) { + // Listen scroll event to load more rows + $('.pg-panel-content').on('scroll', that.__loadMoreRows.bind(that)); + } else { + // Listen scroll event to load more rows + $('.pg-panel-content').off('scroll', that.__loadMoreRows); + } + // Re-apply search criteria filter.search(); }, diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss index d990b5509..861c9b08f 100644 --- a/web/pgadmin/static/scss/_pgadmin.style.scss +++ b/web/pgadmin/static/scss/_pgadmin.style.scss @@ -166,6 +166,7 @@ right:0px; bottom:0px; height: 100%!important; + overflow: scroll; } .pg-prop-footer {