public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM5282] "Count Rows" option missing from partition sub tables
Date: Fri, 1 Jan 2021 17:20:41 +0530
Message-ID: <CAM9w-_=SQjhq9704j8zodB2g-rDHPak3f77wLJnxA50e-tKk3w@mail.gmail.com> (raw)

Hi Hackers,

Attached patch adds "Count rows" option to partition sub tables.
Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM5282.patch (2.0K, 3-RM5282.patch)
  download | inline diff:
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) {


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM5282] "Count Rows" option missing from partition sub tables
  In-Reply-To: <CAM9w-_=SQjhq9704j8zodB2g-rDHPak3f77wLJnxA50e-tKk3w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox