From 3a2145e5fa8632c92a4f4c701d6dab36daf22e0b Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Mon, 3 May 2021 12:52:28 +0530 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=C2=A0query=20editor?= =?UTF-8?q?=20is=20not=20being=20closed=20if=20the=20user=C2=A0clicks=20on?= =?UTF-8?q?=20the=20'Don't=20Save'=20button.=20Fixes=20#6417?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en_US/release_notes_5_3.rst | 1 + web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_5_3.rst b/docs/en_US/release_notes_5_3.rst index fc30a094c..fb0637dc0 100644 --- a/docs/en_US/release_notes_5_3.rst +++ b/docs/en_US/release_notes_5_3.rst @@ -26,3 +26,4 @@ Bug fixes | `Issue #6385 `_ - Ensure that Backup and Restore should work on shared servers. | `Issue #6408 `_ - Fixed ModuleNotFoundError when running setup.py from outside of the root. | `Issue #6416 `_ - Added comment column in the properties panel for View and Materialized View collection node. +| `Issue #6417 `_ - Fixed an issue where query editor is not being closed if the user clicks on the 'Don't Save' button. diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index d44d4ea47..1ef690e55 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -4965,6 +4965,7 @@ define('tools.querytool', [ break; case 1: // Don't Save self.close_on_save = false; + self.is_unsaved_data = this.is_unsaved_data; $.ajax({ url: url_for('sqleditor._check_server_connection_status', { 'sid': self.url_params.sid, @@ -4977,7 +4978,7 @@ define('tools.querytool', [ let response = res.data.result.server; if (response) { closeEvent.cancel = true; - if (this.is_unsaved_data) + if (self.is_unsaved_data) self.ignore_on_close.unsaved_data = true; else self.ignore_on_close.unsaved_query = true;