public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikhil Mohite <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM-6046]: [Query Tool] state of Save File icon does not match dirty editor indicator.
Date: Wed, 16 Dec 2020 11:29:06 +0530
Message-ID: <CAOBg0AMWnT4ch8KCqCk8NT3ixtDO81NWakXAMcvaKmRio+2Duw@mail.gmail.com> (raw)

Hi Team,

Please find the attached patch for RM-6046:
<https://redmine.postgresql.org/issues/6046; [Query Tool] state of Save
File icon does not match the dirty editor indicator.



-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* <https://www.enterprisedb.com/;
*Mob.No: +91-7798364578.*


Attachments:

  [application/octet-stream] RM_6046.patch (1.1K, 3-RM_6046.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 47d4de4..abd33a4 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -4286,7 +4286,14 @@ define('tools.querytool', [
         $('#btn-explain-options-dropdown').prop('disabled', mode_disabled);
         $('#btn-edit-dropdown').prop('disabled', mode_disabled);
         $('#btn-load-file').prop('disabled', mode_disabled);
-        $('#btn-save-file').prop('disabled', mode_disabled);
+        if(this.gridView.current_file) {
+          if(this.gridView.query_tool_obj.file_data != this.gridView.query_tool_obj.getValue()) {
+            $('#btn-save-file').prop('disabled', mode_disabled);
+          }
+        } else {
+          $('#btn-save-file').prop('disabled', mode_disabled);
+        }
+
         $('#btn-file-menu-dropdown').prop('disabled', mode_disabled);
         $('#btn-find').prop('disabled', mode_disabled);
         $('#btn-find-menu-dropdown').prop('disabled', mode_disabled);


view thread (2+ 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]
  Subject: Re: [pgAdmin][RM-6046]: [Query Tool] state of Save File icon does not match dirty editor indicator.
  In-Reply-To: <CAOBg0AMWnT4ch8KCqCk8NT3ixtDO81NWakXAMcvaKmRio+2Duw@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