public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch] - RM #6912 - pgadmin 6.0: browser tree sort order regression
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch] - RM #6912 - pgadmin 6.0: browser tree sort order regression
@ 2021-10-15 10:39  Khushboo Vashi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Khushboo Vashi @ 2021-10-15 10:39 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find the attached patch to fix the RM #6912 - pgadmin 6.0: browser
tree sort order regression.

Thanks,
Khushboo


Attachments:

  [application/octet-stream] RM_6912.patch (1.3K, 3-RM_6912.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 a9a6892e3..89a25fe2e 100644
--- a/web/pgadmin/static/js/tree/tree_init.tsx
+++ b/web/pgadmin/static/js/tree/tree_init.tsx
@@ -13,8 +13,9 @@ import { FileTreeX, TreeModelX } from 'pgadmin4-tree';
 import {Tree} from './tree';
 
 import { IBasicFileSystemHost } from 'react-aspen';
-import { ManageTreeNodes } from './tree_nodes'
-import { Directory } from 'react-aspen'
+import { ManageTreeNodes } from './tree_nodes';
+import { Directory } from 'react-aspen';
+import pgAdmin from 'sources/pgadmin';
 
 var initBrowserTree = async (pgBrowser) => {
   const MOUNT_POINT = '/browser'
@@ -36,13 +37,11 @@ var initBrowserTree = async (pgBrowser) => {
       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
+        return pgAdmin.natural_sort(a.fileName, b.fileName);
+      }
+      return a.constructor === Directory ? -1
+        : b.constructor === Directory ? 1
+        : 0
 	},
   }
 


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

* Re: [pgAdmin4][Patch] - RM #6912 - pgadmin 6.0: browser tree sort order regression
@ 2021-10-16 07:29  Akshay Joshi <[email protected]>
  parent: Khushboo Vashi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

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

Thanks, the patch applied.

On Fri, Oct 15, 2021 at 4:09 PM Khushboo Vashi <
[email protected]> wrote:

> Hi,
>
> Please find the attached patch to fix the RM #6912 - pgadmin 6.0: browser
> tree sort order regression.
>
> 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-16 07:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 10:39 [pgAdmin4][Patch] - RM #6912 - pgadmin 6.0: browser tree sort order regression Khushboo Vashi <[email protected]>
2021-10-16 07:29 ` 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