public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM5282] "Count Rows" option missing from partition sub tables
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM5282] "Count Rows" option missing from partition sub tables
@ 2021-01-01 11:50  Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Aditya Toshniwal @ 2021-01-01 11:50 UTC (permalink / raw)
  To: pgadmin-hackers

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) {


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin][RM5282] "Count Rows" option missing from partition sub tables
@ 2021-01-04 09:55  Akshay Joshi <[email protected]>
  parent: Aditya Toshniwal <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-01-04 09:55 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Fri, Jan 1, 2021 at 5:21 PM Aditya Toshniwal <
[email protected]> wrote:

> 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"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-01-04 09:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 11:50 [pgAdmin][RM5282] "Count Rows" option missing from partition sub tables Aditya Toshniwal <[email protected]>
2021-01-04 09:55 ` Akshay Joshi <[email protected]>

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