Give profile menus more straightforward hide/disable/delete/default interactions

Summary:
Ref T10054.

  - Just let users delete non-builtin items.
  - Let users choose a default item explicitly.
  - Do a better job of cleaning up items which no longer exist or belong to uninstalled applications.

(NOTE) This has one user-facing change: workboards are no longer the default on projects with workboards. I think this is probably OK since we're giving users a ton of new toys at the same time, but I'll write some docs at least.

Test Plan:
  - Deleted custom items.
  - Disabled/enabled builtin items.
  - Made various things defaults.
  - Uninstalled Maniphest, saw Workboards tab disappear entirely.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10054

Differential Revision: https://secure.phabricator.com/D15089
This commit is contained in:
epriestley
2016-01-22 05:33:21 -08:00
parent c25de5e02f
commit 51ed95c00b
8 changed files with 251 additions and 48 deletions

View File

@@ -17,21 +17,14 @@ final class PhabricatorProjectViewController
}
$project = $this->getProject();
$columns = id(new PhabricatorProjectColumnQuery())
->setViewer($viewer)
->withProjectPHIDs(array($project->getPHID()))
->execute();
if ($columns) {
$controller = 'board';
} else {
$controller = 'profile';
}
$engine = $this->getProfilePanelEngine();
$default = $engine->getDefaultPanel();
switch ($controller) {
case 'board':
switch ($default->getBuiltinKey()) {
case PhabricatorProject::PANEL_WORKBOARD:
$controller_object = new PhabricatorProjectBoardViewController();
break;
case 'profile':
case PhabricatorProject::PANEL_PROFILE:
default:
$controller_object = new PhabricatorProjectProfileController();
break;