* taurus prio added
* order by taurus prio
This commit is contained in:
@@ -6,19 +6,19 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class KanbanBoard implements \JsonSerializable
|
||||
{
|
||||
const PRIO_TRIVIAL = 0;
|
||||
const PRIO_MINOR = 1;
|
||||
const PRIO_MAJOR = 2;
|
||||
const PRIO_CRITICAL = 3;
|
||||
const PRIO_BLOCKER = 4;
|
||||
// const PRIO_TRIVIAL = 0;
|
||||
// const PRIO_MINOR = 1;
|
||||
// const PRIO_MAJOR = 2;
|
||||
// const PRIO_CRITICAL = 3;
|
||||
// const PRIO_BLOCKER = 4;
|
||||
|
||||
private $priorityMap = [
|
||||
'Trivial' => self::PRIO_TRIVIAL,
|
||||
'Minor' => self::PRIO_MINOR,
|
||||
'Major' => self::PRIO_MAJOR,
|
||||
'Critical' => self::PRIO_CRITICAL,
|
||||
'Blocker' => self::PRIO_BLOCKER,
|
||||
];
|
||||
// private $priorityMap = [
|
||||
// 'Trivial' => self::PRIO_TRIVIAL,
|
||||
// 'Minor' => self::PRIO_MINOR,
|
||||
// 'Major' => self::PRIO_MAJOR,
|
||||
// 'Critical' => self::PRIO_CRITICAL,
|
||||
// 'Blocker' => self::PRIO_BLOCKER,
|
||||
// ];
|
||||
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
@@ -222,8 +222,9 @@ class KanbanBoard implements \JsonSerializable
|
||||
*/
|
||||
private function prioSort(array $toSort): array
|
||||
{
|
||||
usort($toSort, function(KanbanEntry $a, KanbanEntry $b){
|
||||
return $this->priorityMap[$b->getIssuePriority()] <=> $this->priorityMap[$a->getIssuePriority()];
|
||||
usort($toSort, function (KanbanEntry $a, KanbanEntry $b) {
|
||||
return $a->getTaurusPrio() <=> $b->getTaurusPrio();
|
||||
// return $this->priorityMap[$b->getIssuePriority()] <=> $this->priorityMap[$a->getIssuePriority()];
|
||||
});
|
||||
return $toSort;
|
||||
}
|
||||
@@ -234,10 +235,10 @@ class KanbanBoard implements \JsonSerializable
|
||||
*/
|
||||
private function updatedAtReverseSort(array $toSort): array
|
||||
{
|
||||
$toSort = array_filter($toSort, function(KanbanEntry $item){
|
||||
$toSort = array_filter($toSort, function (KanbanEntry $item) {
|
||||
return $item->getAssignee() != null && empty($item->getFixVersions());
|
||||
});
|
||||
usort($toSort, function(KanbanEntry $a, KanbanEntry $b){
|
||||
usort($toSort, function (KanbanEntry $a, KanbanEntry $b) {
|
||||
return $b->getUpdatedAt() <=> $a->getUpdatedAt();
|
||||
});
|
||||
return $toSort;
|
||||
|
||||
Reference in New Issue
Block a user