public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Ashesh Vashi <[email protected]>
Subject: Re: [pgAdmin4][Patch]: RM1627 - Objects are not visible after creation until press refresh button
Date: Tue, 20 Sep 2016 14:52:53 +0530
Message-ID: <CAM5-9D8_pg1u6OxWcDPy+SxOdVf_PiQH7N57bL1=dL4KNn8suw@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxowHpsu3S+sOXMeDL=Y6f_i=vjYi_9q7Os-Hh8jYo+iPRw@mail.gmail.com>
References: <CAM5-9D-5Vf2XvBm-U7DQLQY2ZKepyaLHVTOHcAsGiW84=V5cSA@mail.gmail.com>
	<CA+OCxowHpsu3S+sOXMeDL=Y6f_i=vjYi_9q7Os-Hh8jYo+iPRw@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

On Mon, Sep 19, 2016 at 9:49 PM, Dave Page <[email protected]> wrote:

> Hi
>
>
> On Mon, Sep 19, 2016 at 4:23 PM, Surinder Kumar
> <[email protected]> wrote:
> > Hi
> >
> > Please find patch with following fixes:
> >
> > 1) Newly added server-group not listing in tree view.
> >
> > 2) On creating a first node for collection node with no child. the
> created
> > node doesn't show up under its respective parent node.
> > - to add a node to child under its parent node. its parent node attribute
> > must be set 'inode: true' but it always gets false for inode that doesn't
> > add the node.
> >
> > Ashesh - Can you please review it?
>
> I tested this by adding a sequence to a database and schema that
> didn't previously contain any. The node was not added, and in the
> Javascript console I get:
>
> browser.js:1108 Failed to append

​This issue is taken care in updated patch, Also properly handled the case
for 'server-group' not listing in tree view, thus removing
'addNodeWithNoParent' method from previous patch.
I have tested it for most of the nodes, it works.
Please find updated patch and review.

> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM1627_v1.patch (1.2K, 3-RM1627_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js
index 151d05b..46c49cf 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -820,6 +820,10 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
               ctx.b._findTreeChildNode(
                 ctx.i, d, ctx
               );
+              // if parent node is null
+              if (!_data._pid) {
+                addItemNode.apply(ctx, arguments);
+              }
             }
             return true;
           }.bind(ctx),
@@ -958,9 +962,11 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
                           });
                         }.bind(ctx);

-                    if (!ctx.t.isInode(ctx.i) && ctx.d.inode) {
+                    if (ctx.i && !ctx.t.isInode(ctx.i)) {
                         ctx.t.setInode(ctx.i, {success: _append});
                     } else {
+                        // Handle case for node without parent i.e. server-group
+                        // or if parent node's inode is true.
                         _append();
                     }
                   }


view thread (4+ 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], [email protected], [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM1627 - Objects are not visible after creation until press refresh button
  In-Reply-To: <CAM5-9D8_pg1u6OxWcDPy+SxOdVf_PiQH7N57bL1=dL4KNn8suw@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