mirror of https://github.com/apache/druid.git
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
This commit is contained in:
parent
c8bffd9351
commit
f06f0c3ad8
|
@ -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')
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue