public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup
@ 2021-11-26 10:48 Yogesh Mahajan <[email protected]>
  2021-11-28 08:04 ` Re: [pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Yogesh Mahajan @ 2021-11-26 10:48 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find the attached patch which fixes errors thrown while creating a
new server via Add New Server from dashboard &  tree item is not selected.
Also fixes errors shown in console while startup.


Thanks,
Yogesh Mahajan
EnterpriseDB


Attachments:

  [application/octet-stream] RM7015_v1.patch (1.1K, 3-RM7015_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/dashboard/static/js/dashboard.js b/web/pgadmin/dashboard/static/js/dashboard.js
index 6e6228304..51425a679 100644
--- a/web/pgadmin/dashboard/static/js/dashboard.js
+++ b/web/pgadmin/dashboard/static/js/dashboard.js
@@ -394,9 +394,9 @@ define('pgadmin.dashboard', [
     // Handler function to support the "Add Server" link
     add_new_server: function() {
       if (pgBrowser && pgBrowser.tree) {
-        var i = pgBrowser.tree.selected().length != 0 ?
-            pgBrowser.tree.selected() :
-            pgBrowser.tree.first(null, false),
+        var i = _.isUndefined(pgBrowser.tree.selected()) ?
+            pgBrowser.tree.first(null, false):
+            pgBrowser.tree.selected(),
           serverModule = require('pgadmin.node.server'),
           itemData = pgBrowser.tree.itemData(i);
 
@@ -1141,7 +1141,7 @@ define('pgadmin.dashboard', [
         this.chartsDomObj && this.chartsDomObj.unmount();
       } else {
         var t = pgBrowser.tree,
-          i = t.selected(),
+          i = t ? t.selected() : 0,
           d = i && t.itemData(i);
 
         this.chartsDomObj && this.chartsDomObj.setPageVisible(dashboardVisible);


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

* Re: [pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup
  2021-11-26 10:48 [pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup Yogesh Mahajan <[email protected]>
@ 2021-11-28 08:04 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-11-28 08:04 UTC (permalink / raw)
  To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Fri, Nov 26, 2021 at 4:19 PM Yogesh Mahajan <
[email protected]> wrote:

> Hi,
>
> Please find the attached patch which fixes errors thrown while creating a
> new server via Add New Server from dashboard &  tree item is not selected.
> Also fixes errors shown in console while startup.
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>


-- 
*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-11-28 08:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26 10:48 [pgAdmin][Patch] - Bug #7015 - Unable to add new server on startup Yogesh Mahajan <[email protected]>
2021-11-28 08:04 ` 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