Subject: [pgAdmin4][PATCH] To fix graphical explain for Insert/Update/Delete quries

From: Murtuza Zabuawala <[email-masked]>
Date: Mon, 6 Feb 2017 11:10:19 +0530

Hi,

PFA patch to fix the issue with Graphical Explain plan functionality which
was breaking for INSERT/UPDATE/DELETE explain plans.
RM#2133

*Issue:* It was due to typo in imageMapper object.

Please review.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/templates/explain/js/explain.js b/web/pgadmin/misc/templates/explain/js/explain.js
index 382fd61..3c4c6d9 100644
--- a/web/pgadmin/misc/templates/explain/js/explain.js
+++ b/web/pgadmin/misc/templates/explain/js/explain.js
@@ -145,11 +145,11 @@ var imageMapper = {
   }
 },
 "ModifyTable" : function(data) {
-  switch (data['Operaton']) {
-    case "insert": return { "image":"ex_insert.png",
+  switch (data['Operation']) {
+    case "Insert": return { "image":"ex_insert.png",
                             "image_text":"Insert"
                            };
-    case "update": return {"image":"ex_update.png","image_text":"Update"};
+    case "Update": return {"image":"ex_update.png","image_text":"Update"};
     case "Delete": return {"image":"ex_delete.png","image_text":"Delete"};
   }
 },

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

---

From: Dave Page <[email-masked]>
Date: Mon, 6 Feb 2017 10:01:43 +0000

Hi

On Mon, Feb 6, 2017 at 5:40 AM, Murtuza Zabuawala
<[email-masked]> wrote:
> Issue: It was due to typo in imageMapper object.
>
> Please review.

It's a definite improvement, but still isn't quite right - see the
attached screenshot for example; the node name should be pem.agent
shouldn't it (or 'Delete' or 'Delete from pem.agent')?

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Murtuza Zabuawala <[email-masked]>
Date: Mon, 6 Feb 2017 16:03:49 +0530

Hi Dave,

With Same query I am getting proper output same as pgAdmin3.
Can you hard refresh browser & try again?

---

From: Dave Page <[email-masked]>
Date: Mon, 6 Feb 2017 10:45:22 +0000

> Can you hard refresh browser & try again?

That's really weird - it's working now. It was a single-file change,
and when I tested it went from failing to display the node properly at
all, to displaying it with the incorrect label, so it must have loaded
an update.

Oh well - it works now, so patch applied.

Thanks!