Convert projects to EditEngine

Summary: Ref T10010. This is pretty straightforward with a couple of very minor new behaviors, like the icon selector edit field.

Test Plan:
  - Created projects.
  - Edited projects.
  - Saw "Create Project" in quick create menu.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D14896
This commit is contained in:
epriestley
2015-12-27 06:45:53 -08:00
parent e8ddfad6db
commit 6fe882e50a
14 changed files with 288 additions and 317 deletions

View File

@@ -43,8 +43,6 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
'/project/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorProjectListController',
'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController',
'details/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectEditDetailsController',
'archive/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectArchiveController',
'lock/(?P<id>[1-9]\d*)/'
@@ -61,7 +59,8 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
=> 'PhabricatorProjectViewController',
'picture/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectEditPictureController',
'create/' => 'PhabricatorProjectEditDetailsController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorProjectEditController',
'subprojects/(?P<id>[1-9]\d*)/'
=> 'PhabricatorProjectSubprojectsController',
'milestones/(?P<id>[1-9]\d*)/'
@@ -97,21 +96,9 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
}
public function getQuickCreateItems(PhabricatorUser $viewer) {
$can_create = PhabricatorPolicyFilter::hasCapability(
$viewer,
$this,
ProjectCreateProjectsCapability::CAPABILITY);
$items = array();
if ($can_create) {
$item = id(new PHUIListItemView())
->setName(pht('Project'))
->setIcon('fa-briefcase')
->setHref($this->getBaseURI().'create/');
$items[] = $item;
}
return $items;
return id(new PhabricatorProjectEditEngine())
->setViewer($viewer)
->loadQuickCreateItems();
}
protected function getCustomCapabilities() {