public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM4856] Saving the contents of the "Query Editor"
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM4856] Saving the contents of the "Query Editor"
@ 2020-04-07 08:16  Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Aditya Toshniwal @ 2020-04-07 08:16 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Attached is the patch to enable the save button by default when a query
tool is opened with CREATE or other scripts.
Code is changed to consider it as a change when the script text is set.
This will enable the save button automatically.

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


Attachments:

  [application/octet-stream] RM4856.patch (1.5K, 3-RM4856.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 4fc4f329b..f76bdbc7a 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2279,6 +2279,7 @@ define('tools.querytool', [
           }
         });
 
+        self.init_events();
         if (self.is_query_tool) {
           // Fetch the SQL for Scripts (eg: CREATE/UPDATE/DELETE/SELECT)
           // Call AJAX only if script type url is present
@@ -2292,11 +2293,9 @@ define('tools.querytool', [
                 if (res && res !== '') {
                   self.gridView.query_tool_obj.setValue(res);
                 }
-                self.init_events();
               })
               .fail(function(jqx) {
                 let msg = '';
-                self.init_events();
 
                 msg = httpErrorHandler.handleQueryToolAjaxError(
                   pgAdmin, self, jqx, null, [], false
@@ -2306,13 +2305,10 @@ define('tools.querytool', [
                   gettext('Error fetching SQL for script: %s.', msg)
                 );
               });
-          } else {
-            self.init_events();
           }
         }
         else {
           // Disable codemirror by setting readOnly option to true, background to dark, and cursor, hidden.
-          self.init_events();
           self.gridView.query_tool_obj.setOption('readOnly', true);
           var cm = self.gridView.query_tool_obj.getWrapperElement();
           if (cm) {


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

* Re: [pgAdmin][RM4856] Saving the contents of the "Query Editor"
@ 2020-04-07 08:25  Akshay Joshi <[email protected]>
  parent: Aditya Toshniwal <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2020-04-07 08:25 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Tue, Apr 7, 2020 at 1:47 PM Aditya Toshniwal <
[email protected]> wrote:

> Hi Hackers,
>
> Attached is the patch to enable the save button by default when a query
> tool is opened with CREATE or other scripts.
> Code is changed to consider it as a change when the script text is set.
> This will enable the save button automatically.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | 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:[~2020-04-07 08:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 08:16 [pgAdmin][RM4856] Saving the contents of the "Query Editor" Aditya Toshniwal <[email protected]>
2020-04-07 08:25 ` 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