public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order
@ 2021-10-12 06:59 Khushboo Vashi <[email protected]>
  2021-10-12 09:34 ` Re: [pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Khushboo Vashi @ 2021-10-12 06:59 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find the attached patch to fix the RM #6882 - Object browser tree
table columns display order.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_6882.patch (1.1K, 3-RM_6882.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 823428149..999d2b955 100644
--- a/web/pgadmin/static/js/tree/tree_init.tsx
+++ b/web/pgadmin/static/js/tree/tree_init.tsx
@@ -14,6 +14,7 @@ import {Tree} from './tree';
 
 import { IBasicFileSystemHost } from 'react-aspen';
 import { ManageTreeNodes } from './tree_nodes'
+import { Directory } from 'react-aspen'
 
 var initBrowserTree = async (pgBrowser) => {
   const MOUNT_POINT = '/browser'
@@ -30,6 +31,19 @@ var initBrowserTree = async (pgBrowser) => {
       let nodes = await mtree.readNode(path);
       return nodes;
     },
+    sortComparator: (a: FileEntry | Directory, b: FileEntry | Directory) => {
+      // No nee to sort columns
+      if (a._metadata && a._metadata.data._type == 'column') return 0;
+      // Sort alphabetically
+      if (a.constructor === b.constructor) {
+        return a.fileName > b.fileName ? 1
+          : a.fileName < b.fileName ? -1
+          : 0
+        }
+        return a.constructor === Directory ? -1
+          : b.constructor === Directory ? 1
+          : 0
+	},
   }
 
   // Create Node


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order
  2021-10-12 06:59 [pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order Khushboo Vashi <[email protected]>
@ 2021-10-12 09:34 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-10-12 09:34 UTC (permalink / raw)
  To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Tue, Oct 12, 2021 at 12:30 PM Khushboo Vashi <
[email protected]> wrote:

> Hi,
>
> Please find the attached patch to fix the RM #6882 - Object browser tree
> table columns display order.
>
> Thanks,
> Khushboo
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-10-12 09:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 06:59 [pgAdmin4][Patch] - RM #6882 - Object browser tree table columns display order Khushboo Vashi <[email protected]>
2021-10-12 09:34 ` Akshay Joshi <[email protected]>

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