From ed0a596286a7f0fef741f91633e76b39e1ca338f Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Wed, 15 Apr 2020 16:23:54 +0530 Subject: [PATCH] Added alert message to Reset Layout if any of the panels from Query Tool failed to load. Fixes #5366 --- docs/en_US/release_notes_4_21.rst | 1 + .../static/js/sqleditor/query_tool_notifications.js | 2 +- web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_21.rst b/docs/en_US/release_notes_4_21.rst index 95f807921..fd57078c5 100644 --- a/docs/en_US/release_notes_4_21.rst +++ b/docs/en_US/release_notes_4_21.rst @@ -50,6 +50,7 @@ Bug fixes | `Issue #5351 `_ - Fixed compilation warnings while building pgAdmin. | `Issue #5361 `_ - Fixes an issue where pgAdmin4 GUI does not display properly in IE 11. | `Issue #5362 `_ - Fixed an issue where the identical packages and sequences visible as different in the schema diff tool. +| `Issue #5366 `_ - Added alert message to Reset Layout if any of the panels from Query Tool failed to load. | `Issue #5371 `_ - Fixed tab key navigation for some dialogs. | `Issue #5383 `_ - Fixed syntax error while refreshing the existing synonyms. | `Issue #5387 `_ - Fixed an issue where the mode is not shown in the properties dialog of functions/procedures if all the arguments are "IN" arguments. \ No newline at end of file diff --git a/web/pgadmin/static/js/sqleditor/query_tool_notifications.js b/web/pgadmin/static/js/sqleditor/query_tool_notifications.js index 181e58d58..37ab6d9bc 100644 --- a/web/pgadmin/static/js/sqleditor/query_tool_notifications.js +++ b/web/pgadmin/static/js/sqleditor/query_tool_notifications.js @@ -104,7 +104,7 @@ let queryToolNotifications = { }); // Render the grid - if (notifications_grid) + if (notifications_grid && notifications_panel) notifications_panel.$container.find('.sql-editor-notifications').append(notifications_grid.render().el); }, diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index f5519fcdf..7fda62593 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -330,6 +330,16 @@ define('tools.querytool', [ self.messages_panel = self.docker.findPanels('messages')[0]; self.notifications_panel = self.docker.findPanels('notifications')[0]; + if (_.isUndefined(self.sql_panel_obj) || _.isUndefined(self.history_panel) || + _.isUndefined(self.data_output_panel) || _.isUndefined(self.explain_panel) || + _.isUndefined(self.messages_panel) || _.isUndefined(self.notifications_panel)) { + alertify.alert( + gettext('Panel Loading Error'), + gettext('Something went wrong while loading the panels.' + + ' Please make sure to reset the layout (File > Reset Layout) for the better user experience.') + ); + } + // Refresh Code mirror on SQL panel resize to // display its value properly self.sql_panel_obj.on(wcDocker.EVENT.RESIZE_ENDED, function() {