mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where clicking on the 'Generate script' button shows a forever spinner due to pop up blocker. Fixes #5815
This commit is contained in:
parent
62e6848dc8
commit
d0310b669e
@ -39,4 +39,5 @@ Bug fixes
|
|||||||
| `Issue #5773 <https://redmine.postgresql.org/issues/5773>`_ - Fixed an issue where the application ignores the fixed port configuration value.
|
| `Issue #5773 <https://redmine.postgresql.org/issues/5773>`_ - Fixed an issue where the application ignores the fixed port configuration value.
|
||||||
| `Issue #5775 <https://redmine.postgresql.org/issues/5775>`_ - Ensure that 'setup-web.sh' should work in Debian 10.
|
| `Issue #5775 <https://redmine.postgresql.org/issues/5775>`_ - Ensure that 'setup-web.sh' should work in Debian 10.
|
||||||
| `Issue #5794 <https://redmine.postgresql.org/issues/5794>`_ - Fixed excessive CPU usage by stopping the indefinite growth of the graph dataset.
|
| `Issue #5794 <https://redmine.postgresql.org/issues/5794>`_ - Fixed excessive CPU usage by stopping the indefinite growth of the graph dataset.
|
||||||
|
| `Issue #5815 <https://redmine.postgresql.org/issues/5815>`_ - Fixed an issue where clicking on the 'Generate script' button shows a forever spinner due to pop up blocker.
|
||||||
| `Issue #5820 <https://redmine.postgresql.org/issues/5820>`_ - Fixed an issue while refreshing Resource Group.
|
| `Issue #5820 <https://redmine.postgresql.org/issues/5820>`_ - Fixed an issue while refreshing Resource Group.
|
@ -234,8 +234,12 @@ define('pgadmin.datagrid', [
|
|||||||
|
|
||||||
if (self.preferences.new_browser_tab) {
|
if (self.preferences.new_browser_tab) {
|
||||||
var newWin = window.open('', '_blank');
|
var newWin = window.open('', '_blank');
|
||||||
newWin.document.write(queryToolForm);
|
if(newWin) {
|
||||||
newWin.document.title = panel_title;
|
newWin.document.write(queryToolForm);
|
||||||
|
newWin.document.title = panel_title;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* On successfully initialization find the dashboard panel,
|
/* On successfully initialization find the dashboard panel,
|
||||||
* create new panel and add it to the dashboard panel.
|
* create new panel and add it to the dashboard panel.
|
||||||
@ -283,6 +287,7 @@ define('pgadmin.datagrid', [
|
|||||||
|
|
||||||
openQueryToolURL(queryToolPanel);
|
openQueryToolURL(queryToolPanel);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Backbone.Events);
|
Backbone.Events);
|
||||||
|
@ -64,19 +64,10 @@ export function showQueryTool(datagrid, pgBrowser, alertify, url, aciTreeIdentif
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gridUrl = generateUrl(transId, queryToolTitle, parentData);
|
const gridUrl = generateUrl(transId, queryToolTitle, parentData);
|
||||||
|
launchDataGrid(datagrid, transId, gridUrl, queryToolTitle, sURL, alertify);
|
||||||
let retVal = datagrid.launch_grid(transId, gridUrl, true, queryToolTitle, sURL);
|
|
||||||
if(!retVal) {
|
|
||||||
alertify.alert(
|
|
||||||
gettext('Query tool launch error'),
|
|
||||||
gettext(
|
|
||||||
'Please allow the pop-ups for this site to perform the desired action. If the main window of pgAdmin is closed then close this window and open a new pgAdmin session.'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateScript(parentData, datagrid) {
|
export function generateScript(parentData, datagrid, alertify) {
|
||||||
const queryToolTitle = `${parentData.database}/${parentData.user}@${parentData.server}`;
|
const queryToolTitle = `${parentData.database}/${parentData.user}@${parentData.server}`;
|
||||||
const transId = getRandomInt(1, 9999999);
|
const transId = getRandomInt(1, 9999999);
|
||||||
|
|
||||||
@ -90,6 +81,18 @@ export function generateScript(parentData, datagrid) {
|
|||||||
+`&server_type=${parentData.stype}`
|
+`&server_type=${parentData.stype}`
|
||||||
+`&did=${parentData.did}`;
|
+`&did=${parentData.did}`;
|
||||||
|
|
||||||
datagrid.launch_grid(transId, url_endpoint, true, queryToolTitle, '');
|
launchDataGrid(datagrid, transId, url_endpoint, queryToolTitle, '', alertify);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function launchDataGrid(datagrid, transId, gridUrl, queryToolTitle, sURL, alertify) {
|
||||||
|
let retVal = datagrid.launch_grid(transId, gridUrl, true, queryToolTitle, sURL);
|
||||||
|
|
||||||
|
if(!retVal) {
|
||||||
|
alertify.alert(
|
||||||
|
gettext('Query tool launch error'),
|
||||||
|
gettext(
|
||||||
|
'Please allow the pop-ups for this site to perform the desired action. If the main window of pgAdmin is closed then close this window and open a new pgAdmin session.'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ export default class SchemaDiffUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pgWindow.pgAdmin.ddl_diff = generated_script;
|
pgWindow.pgAdmin.ddl_diff = generated_script;
|
||||||
generateScript(server_data, pgWindow.pgAdmin.DataGrid);
|
generateScript(server_data, pgWindow.pgAdmin.DataGrid, Alertify);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#diff_fetching_data').find('.schema-diff-busy-text').text('');
|
$('#diff_fetching_data').find('.schema-diff-busy-text').text('');
|
||||||
@ -485,7 +485,7 @@ export default class SchemaDiffUI {
|
|||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
})
|
})
|
||||||
.done(function (res) {
|
.done(function (res) {
|
||||||
let msg = res.data.compare_msg;
|
let msg = _.escape(res.data.compare_msg);
|
||||||
if (res.data.diff_percentage != 100) {
|
if (res.data.diff_percentage != 100) {
|
||||||
msg = msg + gettext(' (this may take a few minutes)...');
|
msg = msg + gettext(' (this may take a few minutes)...');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user