Improve some column behaviors for Milestone/Subproject columns

Summary:
Ref T10010.

  - Don't allow milestones to be reordered.
  - Hide phantom subproject columns when reodrering.
  - Don't allow subproject/milestone columns to be renamed.
  - Force milestones to be ordered at the end, and in the correct order.
  - Add some missing crumbs.

Test Plan: Reordered columns, renamed columns, made a new column, viewed column details.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D15183
This commit is contained in:
epriestley
2016-02-04 07:50:58 -08:00
parent 42954bc5ac
commit c01f23adfb
5 changed files with 64 additions and 22 deletions

View File

@@ -97,9 +97,20 @@ final class PhabricatorProjectBoardReorderController
->setFlush(true);
foreach ($columns as $column) {
// Don't allow milestone columns to be reordered.
$proxy = $column->getProxy();
if ($proxy && $proxy->isMilestone()) {
continue;
}
// At least for now, don't show subproject column.
if ($proxy) {
continue;
}
$item = id(new PHUIObjectItemView())
->setHeader($column->getDisplayName())
->addIcon('none', $column->getDisplayType());
->addIcon($column->getHeaderIcon(), $column->getDisplayType());
if ($column->isHidden()) {
$item->setDisabled(true);

View File

@@ -22,6 +22,8 @@ final class PhabricatorProjectColumnDetailController
}
$this->setProject($project);
$project_id = $project->getID();
$column = id(new PhabricatorProjectColumnQuery())
->setViewer($viewer)
->withIDs(array($id))
@@ -45,6 +47,10 @@ final class PhabricatorProjectColumnDetailController
$actions = $this->buildActionView($column);
$properties = $this->buildPropertyView($column, $actions);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Workboard'), "/project/board/{$project_id}/");
$crumbs->addTextCrumb(pht('Column: %s', $title));
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);
@@ -54,6 +60,7 @@ final class PhabricatorProjectColumnDetailController
return $this->newPage()
->setTitle($title)
->setNavigation($nav)
->setCrumbs($crumbs)
->appendChild(
array(
$box,

View File

@@ -81,10 +81,12 @@ final class PhabricatorProjectColumnEditController
$xactions = array();
$type_name = PhabricatorProjectColumnTransaction::TYPE_NAME;
$xactions[] = id(new PhabricatorProjectColumnTransaction())
->setTransactionType($type_name)
->setNewValue($v_name);
if (!$column->getProxy()) {
$type_name = PhabricatorProjectColumnTransaction::TYPE_NAME;
$xactions[] = id(new PhabricatorProjectColumnTransaction())
->setTransactionType($type_name)
->setNewValue($v_name);
}
$type_limit = PhabricatorProjectColumnTransaction::TYPE_LIMIT;
$xactions[] = id(new PhabricatorProjectColumnTransaction())
@@ -105,26 +107,26 @@ final class PhabricatorProjectColumnEditController
}
}
$form = new AphrontFormView();
$form
->setUser($request->getUser())
->appendChild(
$form = id(new AphrontFormView())
->setUser($request->getUser());
if (!$column->getProxy()) {
$form->appendChild(
id(new AphrontFormTextControl())
->setValue($v_name)
->setLabel(pht('Name'))
->setName('name')
->setError($e_name)
->setCaption(
pht('This will be displayed as the header of the column.')))
->appendChild(
id(new AphrontFormTextControl())
->setValue($v_limit)
->setLabel(pht('Point Limit'))
->setName('limit')
->setError($e_limit)
->setCaption(
pht('Maximum number of points of tasks allowed in the column.')));
->setError($e_name));
}
$form->appendChild(
id(new AphrontFormTextControl())
->setValue($v_limit)
->setLabel(pht('Point Limit'))
->setName('limit')
->setError($e_limit)
->setCaption(
pht('Maximum number of points of tasks allowed in the column.')));
if ($is_new) {
$title = pht('Create Column');