1) Newly added server/server group is not visible in the tree unless pgAdmin is refreshed. Fixes #6839

2) Internal server error displayed if disconnect the server. Fixes #6852
This commit is contained in:
Khushboo Vashi 2021-10-03 12:12:02 +05:30 committed by Akshay Joshi
parent aaa8ab3856
commit 44e1a405f0
6 changed files with 13 additions and 13 deletions

View File

@ -136,7 +136,7 @@
"path-fx": "^2.0.0",
"pathfinding": "^0.4.18",
"paths-js": "^0.4.9",
"pgadmin4-tree": "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#51d4024780793cdb8c7cea8ec6ec3bb4cf438331",
"pgadmin4-tree": "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#ec58f480f43aa6deb862778d49d6f2fb797a7d13",
"postcss": "^8.2.15",
"raf": "^3.4.1",
"react": "^17.0.1",

View File

@ -469,6 +469,7 @@ define('pgadmin.browser', [
$div = $('<div></div>'),
context_menu = {};
if(item) obj.tree.select(item);
pgAdmin.Browser.MenuCreator(
obj.Nodes, $div, menus, obj.menu_categories, d, item, context_menu
);
@ -1095,7 +1096,6 @@ define('pgadmin.browser', [
} else {
var _append = function() {
var ___ctx = this,
is_parent_loaded_before = ___ctx.t.wasLoad(___ctx.i),
_parent_data = ___ctx.t.itemData(___ctx.i);
___ctx.t.append(___ctx.i, _data).then(
@ -1103,7 +1103,7 @@ define('pgadmin.browser', [
// Open the item path only if its parent is loaded
// or parent type is same as nodes
if(
is_parent_loaded_before &&
___ctx.t.wasLoad(___ctx.i) &&
_parent_data && _parent_data._type.search(
_data._type
) > -1

View File

@ -140,12 +140,12 @@ export class Tree {
await this.tree.toggleDirectory(item);
}
async select(item) {
await this.tree.setActiveFile(item);
async select(item, ensureVisible=false) {
await this.tree.setActiveFile(item, ensureVisible);
}
async selectNode(item) {
this.tree.setActiveFile(item);
async selectNode(item, ensureVisible=false) {
this.tree.setActiveFile(item, ensureVisible);
}
async unload(item) {
@ -194,7 +194,7 @@ export class Tree {
wasLoad(item) {
if (item && item.type === FileType.Directory) {
return item.isExpanded;
return item.isExpanded && item.children != null && item.children.length > 0;
}
return true;
}
@ -270,7 +270,7 @@ export class Tree {
}
itemData(item) {
return (item !== undefined && item.getMetadata('data') !== undefined) ? item._metadata.data : [];
return (item !== undefined && item !== null && item.getMetadata('data') !== undefined) ? item._metadata.data : [];
}
getData(item) {

View File

@ -76,7 +76,7 @@ var initBrowserTree = async (pgBrowser) => {
// Render Browser Tree
await render(
<div>
<FileTreeX height={999} width={'100%'} model={treeModelX}
<FileTreeX height={950} width={'100%'} model={treeModelX}
onReady={itemHandle} create={create} remove={remove} update={update}/>
</div>, document.getElementById('tree'));
}

View File

@ -54,7 +54,7 @@
font-size: 18px;
text-align: center;
height: 21px !important;
width: 20px;
width: 20px !important;
&:before {
height: inherit;
width: inherit;

View File

@ -7582,9 +7582,9 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
"pgadmin4-tree@git+https://github.com/EnterpriseDB/pgadmin4-treeview/#c66e5e0533cfc622915e85eed0adc3ac38305c61":
"pgadmin4-tree@git+https://github.com/EnterpriseDB/pgadmin4-treeview/#ec58f480f43aa6deb862778d49d6f2fb797a7d13":
version "1.0.0"
resolved "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#c66e5e0533cfc622915e85eed0adc3ac38305c61"
resolved "git+https://github.com/EnterpriseDB/pgadmin4-treeview/#ec58f480f43aa6deb862778d49d6f2fb797a7d13"
dependencies:
"@types/classnames" "^2.2.6"
"@types/react" "^16.7.18"