public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch] - RM #6844 - Partitions collection node loading issue.
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch] - RM #6844 - Partitions collection node loading issue.
@ 2021-10-04 10:09  Khushboo Vashi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Khushboo Vashi @ 2021-10-04 10:09 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find the attached patch to fix the RM #6844 - [Table node]:
Partitions collection node loading issue.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_6844.patch (1.3K, 3-RM_6844.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/tree/tree_nodes.ts b/web/pgadmin/static/js/tree/tree_nodes.ts
index f7b8d0142..b8d5350f3 100644
--- a/web/pgadmin/static/js/tree/tree_nodes.ts
+++ b/web/pgadmin/static/js/tree/tree_nodes.ts
@@ -155,15 +155,23 @@ export class ManageTreeNodes {
   public generate_url = (path: string) => {
     let _path = path;
     let _parent_path = [];
+    let _partitions = [];
     while(_path != '/') {
       let node = this.findNode(_path);
       let _parent = unix.dirname(_path);
       if(node.parentNode && node.parentNode.path == _parent) {
         if (node.parentNode.metadata.data !== null && !node.parentNode.metadata.data._type.includes('coll-'))
-          _parent_path.push(node.parentNode.metadata.data._id);
+          if(node.parentNode.metadata.data._type.includes('partition')) {
+            _partitions.push(node.parentNode.metadata.data._id);
+          } else {
+            _parent_path.push(node.parentNode.metadata.data._id);
+          }
      }
      _path = _parent;
     }
+    // Replace the table with the last partition as in reality partition node is not child of the table
+    if(_partitions.length > 0) _parent_path[0]  = _partitions[_partitions.length-1];
+
     let _rev_arr = _parent_path.reverse();
     return _rev_arr.join("/");
   }


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

* Re: [pgAdmin4][Patch] - RM #6844 - Partitions collection node loading issue.
@ 2021-10-04 10:46  Akshay Joshi <[email protected]>
  parent: Khushboo Vashi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-10-04 10:46 UTC (permalink / raw)
  To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Mon, Oct 4, 2021 at 3:39 PM Khushboo Vashi <
[email protected]> wrote:

> Hi,
>
> Please find the attached patch to fix the RM #6844 - [Table node]:
> Partitions collection node loading issue.
>
> Thanks,
> Khushboo
>


-- 
*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-10-04 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 10:09 [pgAdmin4][Patch] - RM #6844 - Partitions collection node loading issue. Khushboo Vashi <[email protected]>
2021-10-04 10:46 ` 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