mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 15:26:46 -06:00
Ensure that deleting a database should not automatically connect to the next database. Fixes #6685
This commit is contained in:
parent
c543930ac4
commit
b30a42ab9e
@ -32,3 +32,4 @@ Bug fixes
|
||||
| `Issue #6671 <https://redmine.postgresql.org/issues/6671>`_ - Fixed UnboundLocalError where local variable 'user_id' referenced before assignment.
|
||||
| `Issue #6682 <https://redmine.postgresql.org/issues/6682>`_ - Renamed 'Auto rollback?' to 'Auto rollback on error?'.
|
||||
| `Issue #6684 <https://redmine.postgresql.org/issues/6684>`_ - Fixed the JSON editor issue of hiding the first record.
|
||||
| `Issue #6685 <https://redmine.postgresql.org/issues/6685>`_ - Ensure that deleting a database should not automatically connect to the next database.
|
||||
|
@ -24,7 +24,8 @@ define('pgadmin.node.database', [
|
||||
columns: ['name', 'datowner', 'comments'],
|
||||
hasStatistics: true,
|
||||
canDrop: true,
|
||||
canDropCascade: false,
|
||||
selectParentNodeOnDelete: true,
|
||||
canDropCascade: true,
|
||||
statsPrettifyFields: [gettext('Size'), gettext('Size of temporary files')],
|
||||
});
|
||||
}
|
||||
@ -43,6 +44,7 @@ define('pgadmin.node.database', [
|
||||
canDrop: function(node) {
|
||||
return node.canDrop;
|
||||
},
|
||||
selectParentNodeOnDelete: true,
|
||||
label: gettext('Database'),
|
||||
node_image: function() {
|
||||
return 'pg-icon-database';
|
||||
|
@ -86,6 +86,7 @@ define([
|
||||
hasCollectiveStatistics: true,
|
||||
canDrop: true,
|
||||
canDropCascade: true,
|
||||
selectParentNodeOnDelete: false,
|
||||
showProperties: function(item, data, panel) {
|
||||
var that = this,
|
||||
j = panel.$container.find('.obj_properties').first(),
|
||||
|
@ -569,6 +569,10 @@ define('pgadmin.browser.node', [
|
||||
dropPriority is set to 2 by default, override it when change is required
|
||||
*/
|
||||
dropPriority: 2,
|
||||
/******************************************************************************
|
||||
select collection node on deletion.
|
||||
*/
|
||||
selectParentNodeOnDelete: false,
|
||||
// List of common callbacks - that can be used for different
|
||||
// operations!
|
||||
callbacks: {
|
||||
@ -835,7 +839,16 @@ define('pgadmin.browser.node', [
|
||||
if (res.success == 0) {
|
||||
pgBrowser.report_error(res.errormsg, res.info);
|
||||
} else {
|
||||
pgBrowser.removeTreeNode(i, true);
|
||||
// Remove the node from tree and set collection node as selected.
|
||||
var selectNextNode = true;
|
||||
if(obj.selectParentNodeOnDelete) {
|
||||
var prv_i = t.parent(i);
|
||||
setTimeout(function() {
|
||||
t.select(prv_i);
|
||||
}, 10);
|
||||
selectNextNode = false;
|
||||
}
|
||||
pgBrowser.removeTreeNode(i, selectNextNode);
|
||||
}
|
||||
return true;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user