public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
6+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
@ 2021-11-11 09:35 Nikhil Mohite <[email protected]>
  2021-11-12 06:30 ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Nikhil Mohite @ 2021-11-11 09:35 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch for RM-6988:
<https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if the
layout is in an inconsistent state.


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


Attachments:

  [application/octet-stream] RM-6988.patch (1.2K, 3-RM-6988.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/layout.js b/web/pgadmin/browser/static/js/layout.js
index 9491bfaa..cb741a65 100644
--- a/web/pgadmin/browser/static/js/layout.js
+++ b/web/pgadmin/browser/static/js/layout.js
@@ -61,6 +61,25 @@ _.extend(pgBrowser, {
     if (layout != '') {
       try {
         docker.restore(layout);
+        // Check restore layout is restored pgAdmin 4 layout successfully if not then reset layout to default pgAdmin 4 layout.
+        var reset_layout_to_default = true;
+        for (const [key, value] of Object.entries(this.panels)) {
+          if(value.name !== 'browser' || key !== 'browser') {
+            var _panel = docker.findPanels(value.name);
+            if(_panel.length > 0){
+              reset_layout_to_default = false;
+              break;
+            }
+          }
+        }
+        if(reset_layout_to_default && defaultLayoutCallback) {
+          // clear the wcDocker before reset layout.
+          docker.clear();
+          Alertify.warning(gettext('PgAdmin detected some issues with the UI layout, pgAdmin reset it to the default layout.'), 0);
+          if(defaultLayoutCallback){
+            defaultLayoutCallback(docker);
+          }
+        }
       }
       catch(err) {
         docker.clear();


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

* Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
  2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
@ 2021-11-12 06:30 ` Akshay Joshi <[email protected]>
  2021-11-15 10:06   ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Akshay Joshi @ 2021-11-12 06:30 UTC (permalink / raw)
  To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Thu, Nov 11, 2021 at 3:05 PM Nikhil Mohite <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for RM-6988:
> <https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if the
> layout is in an inconsistent state.
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Senior Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>


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

*Mobile: +91 976-788-8246*


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

* Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
  2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-12 06:30 ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
@ 2021-11-15 10:06   ` Nikhil Mohite <[email protected]>
  2021-11-15 11:08     ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Nikhil Mohite @ 2021-11-15 10:06 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Akshay,

Please find the updated patch for RM-6988.
Resolved the issue where reset layout message showing when open query
tool(or open query tool in new tab).

Regards,
Nikhil Mohite

On Fri, Nov 12, 2021 at 12:00 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Thu, Nov 11, 2021 at 3:05 PM Nikhil Mohite <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for RM-6988:
>> <https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if the
>> layout is in an inconsistent state.
>>
>>
>> --
>> *Thanks & Regards,*
>> *Nikhil Mohite*
>> *Senior Software Engineer.*
>> *EDB Postgres* <https://www.enterprisedb.com/;
>> *Mob.No: +91-7798364578.*
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


Attachments:

  [application/octet-stream] RM-6988_v2.patch (2.7K, 3-RM-6988_v2.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index 6be59dd9..ac7222ea 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -430,7 +430,7 @@ define('pgadmin.browser', [
 
         // Stored layout in database from the previous session
         var layout = pgBrowser.utils.layout;
-        obj.restore_layout(obj.docker, layout, obj.buildDefaultLayout.bind(obj));
+        obj.restore_layout(obj.docker, layout, obj.buildDefaultLayout.bind(obj), true);
 
         obj.docker.on(wcDocker.EVENT.LAYOUT_CHANGED, function() {
           obj.save_current_layout('Browser/Layout', obj.docker);
diff --git a/web/pgadmin/browser/static/js/layout.js b/web/pgadmin/browser/static/js/layout.js
index 90929d42..6fa19e47 100644
--- a/web/pgadmin/browser/static/js/layout.js
+++ b/web/pgadmin/browser/static/js/layout.js
@@ -56,30 +56,23 @@ _.extend(pgBrowser, {
     }
   },
 
-  restore_layout: function(docker, layout, defaultLayoutCallback) {
+  restore_layout: function(docker, layout, defaultLayoutCallback, checkLayout= false) {
     // Try to restore the layout if there is one
     if (layout != '') {
       try {
         docker.restore(layout);
-        // Check restore layout is restored pgAdmin 4 layout successfully if not then reset layout to default pgAdmin 4 layout.
-        var reset_layout_to_default = true;
-        for (const [key, value] of Object.entries(this.panels)) {
-          if(value.name !== 'browser' || key !== 'browser') {
-            var _panel = docker.findPanels(value.name);
-            if(_panel.length > 0){
-              reset_layout_to_default = false;
-              break;
+        if(checkLayout) {
+          // Check restore layout is restored pgAdmin 4 layout successfully if not then reset layout to default pgAdmin 4 layout.
+          var _panel = docker.findPanels('properties');
+          if(_panel.length == 0 && defaultLayoutCallback){
+            // clear the wcDocker before reset layout.
+            docker.clear();
+            Alertify.info(gettext('pgAdmin has detected some issues with the UI layout, so reset it to the default.'), 0);
+            if(defaultLayoutCallback){
+              defaultLayoutCallback(docker);
             }
           }
         }
-        if(reset_layout_to_default && defaultLayoutCallback) {
-          // clear the wcDocker before reset layout.
-          docker.clear();
-          Alertify.info(gettext('pgAdmin has detected some issues with the UI layout, so reset it to the default.'), 0);
-          if(defaultLayoutCallback){
-            defaultLayoutCallback(docker);
-          }
-        }
       }
       catch(err) {
         docker.clear();


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

* Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
  2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-12 06:30 ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  2021-11-15 10:06   ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
@ 2021-11-15 11:08     ` Akshay Joshi <[email protected]>
  2021-11-23 12:58       ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Akshay Joshi @ 2021-11-15 11:08 UTC (permalink / raw)
  To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Mon, Nov 15, 2021 at 3:36 PM Nikhil Mohite <
[email protected]> wrote:

> Hi Akshay,
>
> Please find the updated patch for RM-6988.
> Resolved the issue where reset layout message showing when open query
> tool(or open query tool in new tab).
>
> Regards,
> Nikhil Mohite
>
> On Fri, Nov 12, 2021 at 12:00 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, the patch applied.
>>
>> On Thu, Nov 11, 2021 at 3:05 PM Nikhil Mohite <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for RM-6988:
>>> <https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if
>>> the layout is in an inconsistent state.
>>>
>>>
>>> --
>>> *Thanks & Regards,*
>>> *Nikhil Mohite*
>>> *Senior Software Engineer.*
>>> *EDB Postgres* <https://www.enterprisedb.com/;
>>> *Mob.No: +91-7798364578.*
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>

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

*Mobile: +91 976-788-8246*


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

* Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
  2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-12 06:30 ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  2021-11-15 10:06   ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-15 11:08     ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
@ 2021-11-23 12:58       ` Nikhil Mohite <[email protected]>
  2021-11-24 05:31         ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Nikhil Mohite @ 2021-11-23 12:58 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

Hi Akshay,

Please find the updated patch for RM-6988.
1. Updated notification message for the reset layout.
2. Added notification type in alertify which was missing.

On Mon, Nov 15, 2021 at 4:38 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, the patch applied.
>
> On Mon, Nov 15, 2021 at 3:36 PM Nikhil Mohite <
> [email protected]> wrote:
>
>> Hi Akshay,
>>
>> Please find the updated patch for RM-6988.
>> Resolved the issue where reset layout message showing when open query
>> tool(or open query tool in new tab).
>>
>> Regards,
>> Nikhil Mohite
>>
>> On Fri, Nov 12, 2021 at 12:00 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Thu, Nov 11, 2021 at 3:05 PM Nikhil Mohite <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Please find the attached patch for RM-6988:
>>>> <https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if
>>>> the layout is in an inconsistent state.
>>>>
>>>>
>>>> --
>>>> *Thanks & Regards,*
>>>> *Nikhil Mohite*
>>>> *Senior Software Engineer.*
>>>> *EDB Postgres* <https://www.enterprisedb.com/;
>>>> *Mob.No: +91-7798364578.*
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


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


Attachments:

  [application/octet-stream] RM-6988_v3.patch (1.3K, 3-RM-6988_v3.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/layout.js b/web/pgadmin/browser/static/js/layout.js
index 6fa19e47..fa482f51 100644
--- a/web/pgadmin/browser/static/js/layout.js
+++ b/web/pgadmin/browser/static/js/layout.js
@@ -67,7 +67,7 @@ _.extend(pgBrowser, {
           if(_panel.length == 0 && defaultLayoutCallback){
             // clear the wcDocker before reset layout.
             docker.clear();
-            Alertify.info(gettext('pgAdmin has detected some issues with the UI layout, so reset it to the default.'), 0);
+            Alertify.info(gettext('pgAdmin has reset the layout because the previously saved layout is invalid.'), 0);
             if(defaultLayoutCallback){
               defaultLayoutCallback(docker);
             }
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index d38bfff9..6c0a0054 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -466,7 +466,7 @@ define([
         </div>
         <div class="alert-text-body" role="status">${message}</div>
       </div>`;
-      var alert = alertify.notify(alertMessage, timeout);
+      var alert = alertify.notify(alertMessage, 'custom', timeout);
       return alert;
     },
     warning: function(message, timeout) {


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

* Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state.
  2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-12 06:30 ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  2021-11-15 10:06   ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
  2021-11-15 11:08     ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Akshay Joshi <[email protected]>
  2021-11-23 12:58       ` Re: [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
@ 2021-11-24 05:31         ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Akshay Joshi @ 2021-11-24 05:31 UTC (permalink / raw)
  To: Nikhil Mohite <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Tue, Nov 23, 2021 at 6:28 PM Nikhil Mohite <
[email protected]> wrote:

> Hi Akshay,
>
> Please find the updated patch for RM-6988.
> 1. Updated notification message for the reset layout.
> 2. Added notification type in alertify which was missing.
>
> On Mon, Nov 15, 2021 at 4:38 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Nov 15, 2021 at 3:36 PM Nikhil Mohite <
>> [email protected]> wrote:
>>
>>> Hi Akshay,
>>>
>>> Please find the updated patch for RM-6988.
>>> Resolved the issue where reset layout message showing when open query
>>> tool(or open query tool in new tab).
>>>
>>> Regards,
>>> Nikhil Mohite
>>>
>>> On Fri, Nov 12, 2021 at 12:00 PM Akshay Joshi <
>>> [email protected]> wrote:
>>>
>>>> Thanks, the patch applied.
>>>>
>>>> On Thu, Nov 11, 2021 at 3:05 PM Nikhil Mohite <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Hackers,
>>>>>
>>>>> Please find the attached patch for RM-6988:
>>>>> <https://redmine.postgresql.org/issues/6988; Reset pgAdmin layout if
>>>>> the layout is in an inconsistent state.
>>>>>
>>>>>
>>>>> --
>>>>> *Thanks & Regards,*
>>>>> *Nikhil Mohite*
>>>>> *Senior Software Engineer.*
>>>>> *EDB Postgres* <https://www.enterprisedb.com/;
>>>>> *Mob.No: +91-7798364578.*
>>>>>
>>>>
>>>>
>>>> --
>>>> *Thanks & Regards*
>>>> *Akshay Joshi*
>>>> *pgAdmin Hacker | Principal Software Architect*
>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>
>>>> *Mobile: +91 976-788-8246*
>>>>
>>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Senior Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/;
> *Mob.No: +91-7798364578.*
>


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

*Mobile: +91 976-788-8246*


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


end of thread, other threads:[~2021-11-24 05:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 09:35 [pgAdmin][RM-6988]: Reset pgAdmin layout if the layout is in an inconsistent state. Nikhil Mohite <[email protected]>
2021-11-12 06:30 ` Akshay Joshi <[email protected]>
2021-11-15 10:06   ` Nikhil Mohite <[email protected]>
2021-11-15 11:08     ` Akshay Joshi <[email protected]>
2021-11-23 12:58       ` Nikhil Mohite <[email protected]>
2021-11-24 05:31         ` 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