This is an automated email from the ASF dual-hosted git repository.

cwylie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new f06f0c3  Add created_time as tie breaker when sorting by status in 
task table (#7460)
f06f0c3 is described below

commit f06f0c3ad86cecc7a05b289748609c6c2508f373
Author: Qi Shu <[email protected]>
AuthorDate: Wed Apr 17 23:11:45 2019 -0700

    Add created_time as tie breaker when sorting by status in task table (#7460)
    
    * Add created_time as tie breaker when sorting by status
    
    * Fixed bug
    
    * Fixed created_time tie breaker
    
    * Use locale compare
---
 web-console/src/views/tasks-view.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/web-console/src/views/tasks-view.tsx 
b/web-console/src/views/tasks-view.tsx
index 5cd4dc4..05f82d8 100644
--- a/web-console/src/views/tasks-view.tsx
+++ b/web-console/src/views/tasks-view.tsx
@@ -493,7 +493,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
             Header: 'Status',
             id: 'status',
             width: 110,
-            accessor: 'status',
+            accessor: (row) => { return {status: row.status, created_time: 
row.created_time}; },
             Cell: row => {
               if (row.aggregated) return '';
               const { status, location } = row.original;
@@ -521,9 +521,9 @@ ORDER BY "rank" DESC, "created_time" DESC`);
               const previewCount = countBy(previewValues);
               return <span>{Object.keys(previewCount).sort().map(v => `${v} 
(${previewCount[v]})`).join(', ')}</span>;
             },
-            sortMethod: (status1: string, status2: string) => {
+            sortMethod: (d1, d2) => {
               const statusRanking: any = this.statusRanking;
-              return statusRanking[status1] - statusRanking[status2];
+              return statusRanking[d1.status] - statusRanking[d2.status] || 
d1.created_time.localeCompare(d2.created_time);
             },
             show: taskTableColumnSelectionHandler.showColumn('Status')
           },


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to