Sorting tasks by assignee does not work #515
This commit is contained in:
parent
7a69d8dd88
commit
71eb83cc15
|
|
@ -77,6 +77,8 @@ class TaskFields {
|
||||||
static const String status = 'status';
|
static const String status = 'status';
|
||||||
static const String isInvoiced = 'is_invoiced';
|
static const String isInvoiced = 'is_invoiced';
|
||||||
static const String date = 'date';
|
static const String date = 'date';
|
||||||
|
static const String assignedTo = 'assigned_to';
|
||||||
|
static const String createdBy = 'created_by';
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class TaskTime implements Built<TaskTime, TaskTimeBuilder> {
|
abstract class TaskTime implements Built<TaskTime, TaskTimeBuilder> {
|
||||||
|
|
@ -719,6 +721,20 @@ abstract class TaskEntity extends Object
|
||||||
response = compareNatural(
|
response = compareNatural(
|
||||||
taskA.number.toLowerCase(), taskB.number.toLowerCase());
|
taskA.number.toLowerCase(), taskB.number.toLowerCase());
|
||||||
break;
|
break;
|
||||||
|
case TaskFields.createdBy:
|
||||||
|
final userA = userMap[taskA.createdUserId] ?? UserEntity();
|
||||||
|
final userB = userMap[taskB.createdUserId] ?? UserEntity();
|
||||||
|
response = userA.fullName
|
||||||
|
.toLowerCase()
|
||||||
|
.compareTo(userB.fullName.toLowerCase());
|
||||||
|
break;
|
||||||
|
case TaskFields.assignedTo:
|
||||||
|
final userA = userMap[taskA.assignedUserId] ?? UserEntity();
|
||||||
|
final userB = userMap[taskB.assignedUserId] ?? UserEntity();
|
||||||
|
response = userA.fullName
|
||||||
|
.toLowerCase()
|
||||||
|
.compareTo(userB.fullName.toLowerCase());
|
||||||
|
break;
|
||||||
case TaskFields.status:
|
case TaskFields.status:
|
||||||
final taskAStatus = taskA.isRunning
|
final taskAStatus = taskA.isRunning
|
||||||
? -1
|
? -1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue