public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node
@ 2019-11-04 07:58 Aditya Toshniwal <[email protected]>
  2019-11-05 05:50 ` Re: [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Aditya Toshniwal @ 2019-11-04 07:58 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Attached is the patch to fix create object shortcut on collection nodes.
Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM3130.patch (1.0K, 3-RM3130.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js
index 3958e8cf5..1a402da8d 100644
--- a/web/pgadmin/browser/static/js/keyboard.js
+++ b/web/pgadmin/browser/static/js/keyboard.js
@@ -273,13 +273,20 @@ _.extend(pgBrowser.keyboardNavigation, {
   },
   bindSubMenuCreate: function() {
     const tree = this.getTreeDetails();
-
-    if (!tree.d || pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type].collection_node === true)
+    let node_obj = pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type];
+    if (!tree.d){
       return;
+    } else if(node_obj.collection_node === true) {
+      if(node_obj.node) {
+        node_obj = pgAdmin.Browser.Nodes[node_obj.node];
+      } else {
+        return;
+      }
+    }
 
     // Open properties dialog in edit mode
     pgAdmin.Browser.Node.callbacks.show_obj_properties.call(
-      pgAdmin.Browser.Nodes[tree.t.itemData(tree.i)._type], {action: 'create'}
+      node_obj, {action: 'create', item: tree.i}
     );
   },
   bindSubMenuDelete: function() {


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

* Re: [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node
  2019-11-04 07:58 [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node Aditya Toshniwal <[email protected]>
@ 2019-11-05 05:50 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2019-11-05 05:50 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Mon, Nov 4, 2019 at 1:29 PM Aditya Toshniwal <
[email protected]> wrote:

> Hi Hackers,
>
> Attached is the patch to fix create object shortcut on collection nodes.
> Kindly review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


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


end of thread, other threads:[~2019-11-05 05:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04 07:58 [pgAdmin][RM3130] User can not open create new object dialogue with alt+shift+n key on collection node Aditya Toshniwal <[email protected]>
2019-11-05 05:50 ` 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