Fixed an issue where pressing the back button will show another instance of the main page inside of the Query Tool tab. Fixes #4892

pull/38/head
Rahul Shirsat 2020-12-24 13:13:57 +05:30 committed by Akshay Joshi
parent 5448de2d3f
commit 4c9853f10d
3 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,7 @@ Housekeeping
Bug fixes
*********
| `Issue #4892 <https://redmine.postgresql.org/issues/4892>`_ - Fixed an issue where pressing the back button will show another instance of the main page inside of the Query Tool tab.
| `Issue #5571 <https://redmine.postgresql.org/issues/5571>`_ - Added support for expression in exclusion constraints.
| `Issue #5875 <https://redmine.postgresql.org/issues/5875>`_ - Ensure that the 'template1' database should not be visible after pg_upgrade.
| `Issue #5965 <https://redmine.postgresql.org/issues/5965>`_ - Ensure that the macro query result should be download properly.

View File

@ -148,7 +148,8 @@ def check_precondition(f):
self.datistemplate = \
self.manager.db_info[kwargs['did']]['datistemplate'] \
if self.manager.db_info is not None and \
kwargs['did'] in self.manager.db_info else False
kwargs['did'] in self.manager.db_info and \
'datistemplate' in self.manager.db_info[kwargs['did']] else False
# Set the template path for the SQL scripts
if self.manager.server_type == 'gpdb':

View File

@ -299,7 +299,7 @@ define('pgadmin.datagrid', [
).set({'title': gettext('Rename Panel')});
});
var openQueryToolURL = function(j) {
var openQueryToolURL = function(j, panel_url) {
// add spinner element
let $spinner_el =
$(`<div class="pg-sp-container">
@ -315,9 +315,20 @@ define('pgadmin.datagrid', [
if (frameInitialized) {
clearInterval(init_poller_id);
var frame = $(j).data('embeddedFrame');
if (frame) {
frame.onLoaded(()=>{
$spinner_el.remove();
// Fix for firefox backspace click causes pgadmin Inception - RM4892
// start of code
var current_browser = pgAdmin.Browser.get_browser();
if (current_browser.name === 'Firefox') {
frame.$iFrame[0].contentWindow.history.pushState(null, null, panel_url);
frame.$iFrame[0].contentWindow.onpopstate = function () {
frame.$iFrame[0].contentWindow.history.go(1);
};
}
// end of code
});
frame.openHTML(queryToolForm);
}
@ -325,7 +336,7 @@ define('pgadmin.datagrid', [
}, 100);
};
openQueryToolURL(queryToolPanel);
openQueryToolURL(queryToolPanel, panel_url);
}
return true;
},