mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that deleting a database should not automatically connect to the next database. Fixes #6685
This commit is contained in:
committed by
Akshay Joshi
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 #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 #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 #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'],
|
columns: ['name', 'datowner', 'comments'],
|
||||||
hasStatistics: true,
|
hasStatistics: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
canDropCascade: false,
|
selectParentNodeOnDelete: true,
|
||||||
|
canDropCascade: true,
|
||||||
statsPrettifyFields: [gettext('Size'), gettext('Size of temporary files')],
|
statsPrettifyFields: [gettext('Size'), gettext('Size of temporary files')],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -43,6 +44,7 @@ define('pgadmin.node.database', [
|
|||||||
canDrop: function(node) {
|
canDrop: function(node) {
|
||||||
return node.canDrop;
|
return node.canDrop;
|
||||||
},
|
},
|
||||||
|
selectParentNodeOnDelete: true,
|
||||||
label: gettext('Database'),
|
label: gettext('Database'),
|
||||||
node_image: function() {
|
node_image: function() {
|
||||||
return 'pg-icon-database';
|
return 'pg-icon-database';
|
||||||
|
@@ -86,6 +86,7 @@ define([
|
|||||||
hasCollectiveStatistics: true,
|
hasCollectiveStatistics: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
canDropCascade: true,
|
canDropCascade: true,
|
||||||
|
selectParentNodeOnDelete: false,
|
||||||
showProperties: function(item, data, panel) {
|
showProperties: function(item, data, panel) {
|
||||||
var that = this,
|
var that = this,
|
||||||
j = panel.$container.find('.obj_properties').first(),
|
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 is set to 2 by default, override it when change is required
|
||||||
*/
|
*/
|
||||||
dropPriority: 2,
|
dropPriority: 2,
|
||||||
|
/******************************************************************************
|
||||||
|
select collection node on deletion.
|
||||||
|
*/
|
||||||
|
selectParentNodeOnDelete: false,
|
||||||
// List of common callbacks - that can be used for different
|
// List of common callbacks - that can be used for different
|
||||||
// operations!
|
// operations!
|
||||||
callbacks: {
|
callbacks: {
|
||||||
@@ -835,7 +839,16 @@ define('pgadmin.browser.node', [
|
|||||||
if (res.success == 0) {
|
if (res.success == 0) {
|
||||||
pgBrowser.report_error(res.errormsg, res.info);
|
pgBrowser.report_error(res.errormsg, res.info);
|
||||||
} else {
|
} 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;
|
return true;
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user