Convert workboard column options into a dropdown menu
Summary:
Ref T5024, T4427, T5474, T5523. Instead of separate icons in the column header for "Create Task" and "Edit Column Settings", use a dropdown menu.
- T5024 will likely add a "View Standalone" option.
- T4427 needs header space to show a count.
- T5474 likely needs "Edit Triggers..." (this seems reasonable to separate from editing the name, etc.)
- T5523 likely adds "Move all tasks..." eventually.
Test Plan: {F187414}
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T5523, T5474, T5024, T4427
Differential Revision: https://secure.phabricator.com/D10190
This commit is contained in:
@@ -223,14 +223,8 @@ final class PhabricatorProjectBoardViewController
|
||||
->setHeader($column->getDisplayName())
|
||||
->setHeaderColor($column->getHeaderColor());
|
||||
|
||||
$panel->setEditURI($board_uri.'column/'.$column->getID().'/');
|
||||
|
||||
$panel->setHeaderAction(id(new PHUIIconView())
|
||||
->setIconFont('fa-plus')
|
||||
->setHref('/maniphest/task/create/')
|
||||
->addSigil('column-add-task')
|
||||
->setMetadata(
|
||||
array('columnPHID' => $column->getPHID())));
|
||||
$column_menu = $this->buildColumnMenu($project, $column);
|
||||
$panel->addHeaderAction($column_menu);
|
||||
|
||||
$cards = id(new PHUIObjectItemListView())
|
||||
->setUser($viewer)
|
||||
@@ -511,6 +505,59 @@ final class PhabricatorProjectBoardViewController
|
||||
return $manage_button;
|
||||
}
|
||||
|
||||
private function buildColumnMenu(
|
||||
PhabricatorProject $project,
|
||||
PhabricatorProjectColumn $column) {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$viewer = $request->getUser();
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$project,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$column_items = array();
|
||||
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setIcon('fa-plus')
|
||||
->setName(pht('Create Task...'))
|
||||
->setHref('/maniphest/task/create/')
|
||||
->addSigil('column-add-task')
|
||||
->setMetadata(
|
||||
array(
|
||||
'columnPHID' => $column->getPHID(),
|
||||
))
|
||||
->setDisabled(!$can_edit);
|
||||
|
||||
$edit_uri = $this->getApplicationURI(
|
||||
'board/'.$this->id.'/column/'.$column->getID().'/');
|
||||
|
||||
$column_items[] = id(new PhabricatorActionView())
|
||||
->setIcon('fa-pencil')
|
||||
->setName(pht('Edit Column'))
|
||||
->setHref($edit_uri)
|
||||
->setDisabled(!$can_edit)
|
||||
->setWorkflow(!$can_edit);
|
||||
|
||||
$column_menu = id(new PhabricatorActionListView())
|
||||
->setUser($viewer);
|
||||
foreach ($column_items as $item) {
|
||||
$column_menu->addAction($item);
|
||||
}
|
||||
|
||||
$column_button = id(new PHUIIconView())
|
||||
->setIconFont('fa-caret-down')
|
||||
->setHref('#')
|
||||
->addSigil('boards-dropdown-menu')
|
||||
->setMetadata(
|
||||
array(
|
||||
'items' => hsprintf('%s', $column_menu),
|
||||
));
|
||||
|
||||
return $column_button;
|
||||
}
|
||||
|
||||
private function initializeWorkboardDialog(PhabricatorProject $project) {
|
||||
|
||||
$instructions = pht('This workboard has not been setup yet.');
|
||||
|
||||
Reference in New Issue
Block a user