public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM5131] ctrl + a shortcut does not move cursor in sql editor with macOS
Date: Mon, 28 Sep 2020 15:22:47 +0530
Message-ID: <CAM9w-_=98Ocz9tX9M9dAz5D_g8DjtZxriS1rw72V8Zx_v3Z73g@mail.gmail.com> (raw)

Hi Hackers,

Attached patch removes the incorrect overriding of default CodeMirror
shortcuts.
Please review.

-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM5131.patch (3.2K, 3-RM5131.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 0eb7840b0..e9463f2ea 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -2171,22 +2171,6 @@ define('pgadmin.browser', [
       'Ctrl-Space': 'autocomplete',
       'Cmd-Space': 'autocomplete',
 
-      // Select All text
-      'Ctrl-A': 'selectAll',
-      'Cmd-A': 'selectAll',
-
-      // Redo text
-      'Ctrl-Y': 'redo',
-      'Cmd-Y': 'redo',
-
-      // Undo text
-      'Ctrl-Z': 'undo',
-      'Cmd-Z': 'undo',
-
-      // Delete Line
-      'Ctrl-D': 'deleteLine',
-      'Cmd-D': 'deleteLine',
-
       'Alt-Up': 'goLineUp',
       'Alt-Down': 'goLineDown',
 
diff --git a/web/pgadmin/static/scss/_pgadmin.style.scss b/web/pgadmin/static/scss/_pgadmin.style.scss
index 2bd4d5a19..52f96170b 100644
--- a/web/pgadmin/static/scss/_pgadmin.style.scss
+++ b/web/pgadmin/static/scss/_pgadmin.style.scss
@@ -287,6 +287,7 @@
     margin-top: 25px !important;
     position: relative;
     text-align: center;
+    font-size: $font-size-base;
 
     &:before {
         font-family: $font-family-icon;
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index ddd9ad701..b4ee29e50 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -76,6 +76,14 @@ define('tools.querytool', [
 
   var is_query_running = false;
 
+  const EMPTY_DATA_OUTPUT_CONTENT = '<div role="status" class="pg-panel-message">' +
+    gettext('No data output. Execute a query to get output.') +
+  '</div>';
+
+  const EMPTY_EXPLAIN_CONTENT = '<div role="status" class="pg-panel-message">' +
+    gettext('Use Explain/Explain analyze button to generate the plan for a query. Alternatively, you can also execute "EXPLAIN (FORMAT JSON) [QUERY]".') +
+  '</div>';
+
   // Defining Backbone view for the sql grid.
   var SQLEditorView = Backbone.View.extend({
     initialize: function(opts) {
@@ -251,7 +259,7 @@ define('tools.querytool', [
         isCloseable: false,
         isPrivate: true,
         extraClasses: 'hide-vertical-scrollbar',
-        content: '<div id ="datagrid" class="sql-editor-grid-container text-12" tabindex="0"></div>',
+        content: `<div id ="datagrid" class="sql-editor-grid-container text-12" tabindex="0">${EMPTY_DATA_OUTPUT_CONTENT}</div>`,
       });
 
       var explain = new pgAdmin.Browser.Panel({
@@ -261,7 +269,7 @@ define('tools.querytool', [
         height: '100%',
         isCloseable: false,
         isPrivate: true,
-        content: '<div class="sql-editor-explain" tabindex="0"></div>',
+        content: `<div class="sql-editor-explain pg-el-container" tabindex="0">${EMPTY_EXPLAIN_CONTENT}</div>`,
       });
 
       var messages = new pgAdmin.Browser.Panel({
@@ -2658,7 +2666,7 @@ define('tools.querytool', [
         self.changedModels = [];
         self.has_oids = data.has_oids;
         self.oids = data.oids;
-        $('.sql-editor-explain').empty();
+        $('.sql-editor-explain').html(EMPTY_EXPLAIN_CONTENT);
         self.explain_plan = false;
 
         /* If object don't have primary keys then set the


view thread (4+ 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][RM5131] ctrl + a shortcut does not move cursor in sql editor with macOS
  In-Reply-To: <CAM9w-_=98Ocz9tX9M9dAz5D_g8DjtZxriS1rw72V8Zx_v3Z73g@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