public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin]RM6334] SQL panel show blank screen when detach panel.
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin]RM6334] SQL panel show blank screen when detach panel.
@ 2021-04-15 11:41  Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Aditya Toshniwal @ 2021-04-15 11:41 UTC (permalink / raw)
  To: pgadmin-hackers

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;
 }


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

* Re: [pgAdmin]RM6334] SQL panel show blank screen when detach panel.
@ 2021-04-16 12:58  Akshay Joshi <[email protected]>
  parent: Aditya Toshniwal <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-04-16 12:58 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Thu, Apr 15, 2021 at 5:12 PM Aditya Toshniwal <
[email protected]> wrote:

> 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"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


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


end of thread, other threads:[~2021-04-16 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 11:41 [pgAdmin]RM6334] SQL panel show blank screen when detach panel. Aditya Toshniwal <[email protected]>
2021-04-16 12:58 ` 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