diff --git a/docs/en_US/release_notes_4_30.rst b/docs/en_US/release_notes_4_30.rst index e2971847c..ab50728e9 100644 --- a/docs/en_US/release_notes_4_30.rst +++ b/docs/en_US/release_notes_4_30.rst @@ -21,6 +21,7 @@ Bug fixes ********* | `Issue #4892 `_ - Fixed an issue where pressing the back button will show another instance of the main page inside of the Query Tool tab. +| `Issue #5282 `_ - Added 'Count Rows' option to the partition sub tables. | `Issue #5571 `_ - Added support for expression in exclusion constraints. | `Issue #5875 `_ - Ensure that the 'template1' database should not be visible after pg_upgrade. | `Issue #5965 `_ - Ensure that the macro query result should be download properly. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js index 7debeba6c..1152c58b5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js @@ -88,8 +88,12 @@ function( applies: ['object', 'context'], callback: 'detach_partition', priority: 2, label: gettext('Detach Partition'), icon: 'fa fa-remove', - }, - ]); + },{ + name: 'count_table_rows', node: 'partition', module: pgBrowser.Nodes['table'], + applies: ['object', 'context'], callback: 'count_table_rows', + category: 'Count', priority: 2, label: gettext('Count Rows'), + enable: true, + }]); }, generate_url: function(item, type, d, with_id, info) { if (_.indexOf([ diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js index b7adaa8e9..ab1f38d50 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js @@ -251,9 +251,13 @@ define('pgadmin.node.table', [ if (!d) return false; + /* Set the type to table so that partition module can call this func */ + let newD = { + ...d, _type: this.type, + }; // Fetch the total rows of a table $.ajax({ - url: obj.generate_url(i, 'count_rows' , d, true), + url: obj.generate_url(i, 'count_rows' , newD, true), type:'GET', }) .done(function(res) {