Implement "Sort by Points" on workboards

Summary: Depends on D20275. Fixes T10578. This is a static sorting (like "By Date Created") where you can't change point values by dragging. You can still drag cards between columns, or use the "Edit" icon to change point values.

Test Plan: {F6265191}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T10578

Differential Revision: https://secure.phabricator.com/D20276
This commit is contained in:
epriestley
2019-03-11 09:38:55 -07:00
parent c020f027bb
commit 03b7aca019
8 changed files with 106 additions and 5 deletions

View File

@@ -616,7 +616,7 @@ final class PhabricatorProjectBoardViewController
$order_key = $this->sortKey;
$ordering_map = PhabricatorProjectColumnOrder::getAllOrders();
$ordering_map = PhabricatorProjectColumnOrder::getEnabledOrders();
$ordering = id(clone $ordering_map[$order_key])
->setViewer($viewer);
@@ -635,6 +635,12 @@ final class PhabricatorProjectBoardViewController
$order_maps[] = $ordering->toDictionary();
$properties = array();
foreach ($all_tasks as $task) {
$properties[$task->getPHID()] = array(
'points' => (double)$task->getPoints(),
'status' => $task->getStatus(),
);
}
$behavior_config = array(
'moveURI' => $this->getApplicationURI('move/'.$project->getID().'/'),
@@ -771,7 +777,7 @@ final class PhabricatorProjectBoardViewController
}
private function isValidSort($sort) {
$map = PhabricatorProjectColumnOrder::getAllOrders();
$map = PhabricatorProjectColumnOrder::getEnabledOrders();
return isset($map[$sort]);
}
@@ -820,6 +826,9 @@ final class PhabricatorProjectBoardViewController
$project,
PhabricatorPolicyCapability::CAN_EDIT);
$items[] = id(new PhabricatorActionView())
->setType(PhabricatorActionView::TYPE_DIVIDER);
$items[] = id(new PhabricatorActionView())
->setIcon('fa-floppy-o')
->setName(pht('Save as Default'))
@@ -918,6 +927,9 @@ final class PhabricatorProjectBoardViewController
$project,
PhabricatorPolicyCapability::CAN_EDIT);
$items[] = id(new PhabricatorActionView())
->setType(PhabricatorActionView::TYPE_DIVIDER);
$items[] = id(new PhabricatorActionView())
->setIcon('fa-floppy-o')
->setName(pht('Save as Default'))