public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node
@ 2016-05-06 09:41 Khushboo Vashi <[email protected]>
  2016-05-06 14:48 ` Re: [pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node Dave Page <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Khushboo Vashi @ 2016-05-06 09:41 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

When we try to drop any node and the visibility of the Delete/Drop context
Menu of that node is having dependency on some function then, after
deleting that node object, it gives a JS error.

Please find the attached patch to fix this issue.

Thanks,
Khushboo


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


Attachments:

  [text/x-patch] pgAdmin4_canDrop_fix.patch (1.4K, 3-pgAdmin4_canDrop_fix.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js
index 5810e74..7814934 100644
--- a/web/pgadmin/browser/templates/browser/js/node.js
+++ b/web/pgadmin/browser/templates/browser/js/node.js
@@ -89,7 +89,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
           applies: ['object', 'context'], callback: 'delete_obj',
           priority: 3, label: '{{ _("Delete/Drop") }}',
           data: {'url': 'drop'}, icon: 'fa fa-trash',
-          enable: _.isFunction(self.canDrop) ? function() { return self.canDrop.apply(self, arguments); } : false
+          enable: _.isFunction(self.canDrop) ? !!self.canDrop.apply(self, arguments) : (!!self.canDrop)
         }]);
         if (self.canDropCascade) {
           pgAdmin.Browser.add_menus([{
@@ -97,8 +97,8 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
             applies: ['object', 'context'], callback: 'delete_obj',
             priority: 3, label: '{{ _("Drop Cascade") }}',
             data: {'url': 'delete'}, icon: 'fa fa-trash',
-            enable: (_.isFunction(self.canDropCascade) ?
-              function() { return self.canDropCascade.apply(self, arguments); } : true)
+            enable: _.isFunction(self.canDropCascade) ?
+              function() { return self.canDropCascade.apply(self, arguments); } : (!!self.canDropCascade)
           }]);
         }
       }


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

* Re: [pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node
  2016-05-06 09:41 [pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node Khushboo Vashi <[email protected]>
@ 2016-05-06 14:48 ` Dave Page <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-05-06 14:48 UTC (permalink / raw)
  To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers

Thanks, committed.

On Fri, May 6, 2016 at 10:41 AM, Khushboo Vashi
<[email protected]> wrote:
> Hi,
>
> When we try to drop any node and the visibility of the Delete/Drop context
> Menu of that node is having dependency on some function then, after deleting
> that node object, it gives a JS error.
>
> Please find the attached patch to fix this issue.
>
> Thanks,
> Khushboo
>
>
> --
> Sent via pgadmin-hackers mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



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




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


end of thread, other threads:[~2016-05-06 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06 09:41 [pgAdmin4][Patch]: Fixed an issue related to the Delete/Drop context Menu of the node Khushboo Vashi <[email protected]>
2016-05-06 14:48 ` Dave Page <[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