Properties panel is not updated when any object is added/deleted from the browser tree. Fixes #6833

This commit is contained in:
Khushboo Vashi
2021-09-30 18:21:43 +05:30
committed by Akshay Joshi
parent 8056e7e3e3
commit 5e0c113c7b
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -136,7 +136,7 @@
"path-fx": "^2.0.0", "path-fx": "^2.0.0",
"pathfinding": "^0.4.18", "pathfinding": "^0.4.18",
"paths-js": "^0.4.9", "paths-js": "^0.4.9",
"pgadmin4-tree": "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#c66e5e0533cfc622915e85eed0adc3ac38305c61", "pgadmin4-tree": "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#51d4024780793cdb8c7cea8ec6ec3bb4cf438331",
"postcss": "^8.2.15", "postcss": "^8.2.15",
"raf": "^3.4.1", "raf": "^3.4.1",
"react": "^17.0.1", "react": "^17.0.1",
@@ -299,7 +299,6 @@ define('pgadmin.node.database', [
if (!data.connected && data.allowConn && !data.is_connecting) { if (!data.connected && data.allowConn && !data.is_connecting) {
data.is_connecting = true; data.is_connecting = true;
connect_to_database(this, data, pgBrowser.tree, item, false); connect_to_database(this, data, pgBrowser.tree, item, false);
return false;
} }
return pgBrowser.Node.callbacks.selected.apply(this, arguments); return pgBrowser.Node.callbacks.selected.apply(this, arguments);
+9 -3
View File
@@ -510,7 +510,7 @@ define('pgadmin.browser', [
obj.Events.on('pgadmin:browser:tree:update', obj.onUpdateTreeNode, obj); obj.Events.on('pgadmin:browser:tree:update', obj.onUpdateTreeNode, obj);
obj.Events.on('pgadmin:browser:tree:refresh', obj.onRefreshTreeNodeReact, obj); obj.Events.on('pgadmin:browser:tree:refresh', obj.onRefreshTreeNodeReact, obj);
obj.Events.on('pgadmin-browser:tree:loadfail', obj.onLoadFailNode, obj); obj.Events.on('pgadmin-browser:tree:loadfail', obj.onLoadFailNode, obj);
obj.Events.on('pgadmin-browser:panel-browser:' + wcDocker.EVENT.RESIZE_ENDED, obj.onResizeEnded, obj);
obj.bind_beforeunload(); obj.bind_beforeunload();
/* User UI activity */ /* User UI activity */
@@ -518,6 +518,9 @@ define('pgadmin.browser', [
obj.register_to_activity_listener(document); obj.register_to_activity_listener(document);
obj.start_inactivity_timeout_daemon(); obj.start_inactivity_timeout_daemon();
}, },
onResizeEnded: function() {
if (this.tree) this.tree.resizeTree();
},
check_corrupted_db_file: function() { check_corrupted_db_file: function() {
$.ajax({ $.ajax({
url: url_for('browser.check_corrupted_db_file'), url: url_for('browser.check_corrupted_db_file'),
@@ -1682,8 +1685,10 @@ define('pgadmin.browser', [
} }
}, },
onRefreshTreeNodeReact: function(_i) { onRefreshTreeNodeReact: function(_i, _opts) {
this.tree.refresh(_i); this.tree.refresh(_i).then(() =>{
if (_opts && _opts.success) _opts.success();
});
return; return;
}, },
@@ -2169,5 +2174,6 @@ define('pgadmin.browser', [
setTimeout(function(){ setTimeout(function(){
$('#mnu_about').closest('li').before('<li class="dropdown-divider"></li>'); $('#mnu_about').closest('li').before('<li class="dropdown-divider"></li>');
}, 100); }, 100);
return pgAdmin.Browser; return pgAdmin.Browser;
}); });
+3
View File
@@ -287,6 +287,9 @@ export class Tree {
return this.tree.getActiveFile(); return this.tree.getActiveFile();
} }
resizeTree() {
this.tree.resize();
}
findNodeWithToggle(path) { findNodeWithToggle(path) {
let tree = this; let tree = this;