public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin]RM6334] SQL panel show blank screen when detach panel.
Date: Thu, 15 Apr 2021 17:11:14 +0530
Message-ID: <CAM9w-_nDug_qA7U9Gway29fe6xJESDFC2eO+kq=qSxzUXHR2fA@mail.gmail.com> (raw)

Hi Hackers,

Attached patch fixes the SQL panel blank screen issue with a minimal change.
I've also reverted all other existing code changes done for this.

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] RM6334.patch (4.5K, 3-RM6334.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 4358577af..4ffb5ee5a 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -489,12 +489,6 @@ define('pgadmin.browser', [
       setTimeout(function() {
         obj.editor.setValue('-- ' + select_object_msg);
         obj.editor.refresh();
-        /* In case of Runtime we need to make height of sql_textarea
-         * to 101% to fix the black screen issue with NWjs.
-         */
-        if (pgAdmin['pgadmim_runtime'] === 'True') {
-          $('.pg-panel-content .sql_textarea').addClass('runtime_sql_textarea');
-        }
       }, 10);
 
       // Initialise the treeview
diff --git a/web/pgadmin/browser/templates/browser/js/utils.js b/web/pgadmin/browser/templates/browser/js/utils.js
index 6ae43e49f..8597df483 100644
--- a/web/pgadmin/browser/templates/browser/js/utils.js
+++ b/web/pgadmin/browser/templates/browser/js/utils.js
@@ -47,7 +47,6 @@ define('pgadmin.browser.utils',
   pgAdmin['csrf_token_header'] = '{{ current_app.config.get('WTF_CSRF_HEADERS')[0] }}';
   pgAdmin['csrf_token'] = '{{ csrf_token() }}';
   pgAdmin['server_mode'] = '{{ current_app.config.get('SERVER_MODE') }}';
-  pgAdmin['pgadmim_runtime'] = '{{ current_app.PGADMIN_RUNTIME }}';
 
   /* Get the inactivity related config */
   pgAdmin['user_inactivity_timeout'] = {{ current_app.config.get('USER_INACTIVITY_TIMEOUT') }};
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 4ec5d78cc..8f70fd3c0 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1868,7 +1868,6 @@ define([
             }).done(function(res) {
               self.sqlCtrl.clearHistory();
               self.sqlCtrl.setValue(res.data);
-              self.setCodeMirrorHeight(obj);
             }).fail(function() {
               self.model.trigger('pgadmin-view:msql:error', self.method, node, arguments);
             }).always(function() {
@@ -1884,7 +1883,6 @@ define([
         }
         this.sqlCtrl.refresh.apply(this.sqlCtrl);
       }
-      this.setCodeMirrorHeight(obj);
     },
     onPanelResized: function(o) {
       if (o && o.container) {
@@ -1900,7 +1898,6 @@ define([
             'height: ' + ($tabContent.height() + 8) + 'px !important;'
           );
         }
-        this.sqlCtrl.setSize($tabContent.width() + 'px', $tabContent.height() + 'px');
       }
     },
     remove: function() {
@@ -1916,26 +1913,6 @@ define([
 
       Backform.Control.__super__.remove.apply(this, arguments);
     },
-    setCodeMirrorHeight: function(obj) {
-      // Fix for mac os code-mirror showing black screen.
-      var txtArea = $('.pgadmin-controls .pg-el-sm-12 .SQL > .CodeMirror > div > textarea').first();
-      txtArea.css('z-index', -1);
-      var $tabContent = $('.backform-tab > .tab-content').first();
-      var $sqlPane = $tabContent.find('.CodeMirror > div > textarea');
-      for(let i=0; i<$sqlPane.length; i++) {$($sqlPane[i]).css('z-index', -1);}
-
-      $tabContent = $('.backform-tab > .tab-content').first();
-      $sqlPane = $tabContent.find('div[role=tabpanel].tab-pane.' + obj.tab.innerText);
-      // Set height to CodeMirror.
-      if ($sqlPane.hasClass('active')) {
-        $sqlPane.find('.CodeMirror').css(
-          'cssText',
-          'height: ' + ($tabContent.height()) + 'px !important;'
-        );
-        $sqlPane.find('.CodeMirror').css('z-index', 99);
-      }
-    }
-
   });
   /*
    * Numeric input Control functionality just like backgrid
diff --git a/web/pgadmin/static/scss/_webcabin.pgadmin.scss b/web/pgadmin/static/scss/_webcabin.pgadmin.scss
index 0cbc86fd7..c917c531d 100644
--- a/web/pgadmin/static/scss/_webcabin.pgadmin.scss
+++ b/web/pgadmin/static/scss/_webcabin.pgadmin.scss
@@ -88,8 +88,6 @@
   z-index: 1050 !important;
 
   &.wcFrame, & .wcPanelBackground {
-    border-bottom-left-radius: $card-border-radius;
-    border-bottom-right-radius: $card-border-radius;
     max-width: 100%;
     max-height: 100%;
   }
diff --git a/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss b/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
index e9d9a53c0..8ba3e5ebd 100644
--- a/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
+++ b/web/pgadmin/tools/sqleditor/static/scss/_sqleditor.scss
@@ -14,12 +14,6 @@
   height: 100%;
 }
 
-.wcFloating {
-  & .runtime_sql_textarea {
-    height: 101% !important;
-  }
-}
-
 .sql_textarea .CodeMirror-scroll {
   z-index: 0;
 }


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]RM6334] SQL panel show blank screen when detach panel.
  In-Reply-To: <CAM9w-_nDug_qA7U9Gway29fe6xJESDFC2eO+kq=qSxzUXHR2fA@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