public inbox for [email protected]  
help / color / mirror / Atom feed
From: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch] - RM #6828 - Search object: Issue with focus the searched object in the tree.
Date: Thu, 7 Oct 2021 12:26:56 +0530
Message-ID: <CAFOhELekEeSJz9kzsowg4XZ4p34oHbiSOvuO6cXEewpjRpHGOA@mail.gmail.com> (raw)

Hi,

Please find the attached patch to fix the RM #6828 - Search object: Issue
with focus the searched object in the tree.

Note: Please commit this patch after release.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_6828.patch (1.5K, 3-RM_6828.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/tree/tree_init.tsx b/web/pgadmin/static/js/tree/tree_init.tsx
index 0587f1dc8..823428149 100644
--- a/web/pgadmin/static/js/tree/tree_init.tsx
+++ b/web/pgadmin/static/js/tree/tree_init.tsx
@@ -73,10 +73,11 @@ var initBrowserTree = async (pgBrowser) => {
 
   await treeModelX.root.ensureLoaded()
 
+  let tree_height = window.outerHeight - 300;
   // Render Browser Tree
   await render(
     <div>
-      <FileTreeX height={950} width={'100%'} model={treeModelX}
+      <FileTreeX height={tree_height} width={'100%'} model={treeModelX}
         onReady={itemHandle} create={create} remove={remove} update={update}/>
      </div>, document.getElementById('tree'));
 }
diff --git a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
index 62d37edc1..f8249a892 100644
--- a/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
+++ b/web/pgadmin/tools/search_objects/static/js/search_objects_dialog_wrapper.js
@@ -288,7 +288,9 @@ export default class SearchObjectsDialogWrapper extends DialogWrapper {
       this.showMessage(gettext('Locating...'));
       tree.findNodeWithToggle(rowData.id_path)
         .then((treeItem)=>{
-          tree.select(treeItem, true);
+          setTimeout(() => {
+            tree.select(treeItem, true);
+          }, 100);
           this.showMessage(null);
         })
         .catch((error)=>{


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch] - RM #6828 - Search object: Issue with focus the searched object in the tree.
  In-Reply-To: <CAFOhELekEeSJz9kzsowg4XZ4p34oHbiSOvuO6cXEewpjRpHGOA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox