Replace ProfileMenu bugs with different bugs
Summary: Ref T12174. This fixes more bugs than it creates, I think: - Dashboards now show the whole menu. - Project and home items now show selected state correctly. - The "choose global vs personal" thing is now part of MenuEngine, and the same code builds it for Home and Favorites. - Home now handles defaults correctly, I think. Maybe regression/bad/still buggy?: - Mobile home is now whatever the default thing was, not the menu? - Title for dashboard content or other items that render their own content is incorrectly always "Configure Menu" (this was preexisting). Test Plan: - Created, edited, reordered, disabled, deleted and pinned personal and global items on home, favorites, and projects. - Also checked User profiles. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12174 Differential Revision: https://secure.phabricator.com/D17273
This commit is contained in:
@@ -3,14 +3,21 @@
|
||||
final class PhabricatorHomeMenuItemController
|
||||
extends PhabricatorHomeController {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isGlobalDragAndDropUploadEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
$type = $request->getURIData('type');
|
||||
$custom_phid = null;
|
||||
$menu = PhabricatorProfileMenuEngine::MENU_GLOBAL;
|
||||
if ($type == 'personal') {
|
||||
|
||||
if ($viewer->getPHID()) {
|
||||
$custom_phid = $viewer->getPHID();
|
||||
$menu = PhabricatorProfileMenuEngine::MENU_PERSONAL;
|
||||
} else {
|
||||
$custom_phid = null;
|
||||
}
|
||||
|
||||
$application = 'PhabricatorHomeApplication';
|
||||
@@ -23,7 +30,6 @@ final class PhabricatorHomeMenuItemController
|
||||
$engine = id(new PhabricatorHomeProfileMenuEngine())
|
||||
->setProfileObject($home_app)
|
||||
->setCustomPHID($custom_phid)
|
||||
->setMenuType($menu)
|
||||
->setController($this);
|
||||
|
||||
return $engine->buildResponse();
|
||||
|
||||
Reference in New Issue
Block a user