@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make "Favorites" work more like other customizable menus

Summary:
Depends on D20373. Ref T13272. When you put Dashboards in Favorites, the render without a navigation menu, which is kind of weird.

Instead, make Favorites display a navigation menu. This effectively turns it into a weird cross between the home page and a portal, but so be it.

Also change the icon from "star" to "bookmark" since I think that a clearer hint about how it works.

Test Plan: Viewed dashboards in favorites, got a navigation menu. Edited items from portals, home, favorites.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272

Differential Revision: https://secure.phabricator.com/D20374

+32 -33
+2
src/applications/dashboard/engine/PhabricatorDashboardPortalProfileMenuEngine.php
··· 20 20 protected function getBuiltinProfileItems($object) { 21 21 $items = array(); 22 22 23 + $items[] = $this->newDividerItem('tail'); 24 + 23 25 $items[] = $this->newManageItem(); 24 26 25 27 $items[] = $this->newItem()
+2 -1
src/applications/favorites/application/PhabricatorFavoritesApplication.php
··· 15 15 } 16 16 17 17 public function getIcon() { 18 - return 'fa-star'; 18 + return 'fa-bookmark'; 19 19 } 20 20 21 21 public function getRoutes() { 22 22 return array( 23 23 '/favorites/' => array( 24 + '' => 'PhabricatorFavoritesMenuItemController', 24 25 'menu/' => $this->getProfileMenuRouting( 25 26 'PhabricatorFavoritesMenuItemController'), 26 27 ),
+1 -2
src/applications/favorites/controller/PhabricatorFavoritesMenuItemController.php
··· 16 16 $engine = id(new PhabricatorFavoritesProfileMenuEngine()) 17 17 ->setProfileObject($favorites) 18 18 ->setCustomPHID($viewer->getPHID()) 19 - ->setController($this) 20 - ->setShowNavigation(false); 19 + ->setController($this); 21 20 22 21 return $engine->buildResponse(); 23 22 }
+4
src/applications/favorites/engine/PhabricatorFavoritesProfileMenuEngine.php
··· 35 35 } 36 36 } 37 37 38 + $items[] = $this->newDividerItem('tail'); 39 + $items[] = $this->newManageItem() 40 + ->setMenuItemProperty('name', pht('Edit Favorites')); 41 + 38 42 return $items; 39 43 } 40 44
+2 -11
src/applications/favorites/engineextension/PhabricatorFavoritesMainMenuBarExtension.php
··· 26 26 $favorites_menu = id(new PHUIButtonView()) 27 27 ->setTag('a') 28 28 ->setHref('#') 29 - ->setIcon('fa-star') 29 + ->setIcon('fa-bookmark') 30 30 ->addClass('phabricator-core-user-menu') 31 31 ->setNoCSS(true) 32 32 ->setDropdown(true) ··· 71 71 $action = id(new PhabricatorActionView()) 72 72 ->setName($item->getName()) 73 73 ->setHref($item->getHref()) 74 + ->setIcon($item->getIcon()) 74 75 ->setType($item->getType()); 75 76 $view->addAction($action); 76 - } 77 - 78 - if ($viewer->isLoggedIn()) { 79 - $view->addAction( 80 - id(new PhabricatorActionView()) 81 - ->setType(PhabricatorActionView::TYPE_DIVIDER)); 82 - $view->addAction( 83 - id(new PhabricatorActionView()) 84 - ->setName(pht('Edit Favorites')) 85 - ->setHref('/favorites/menu/configure/')); 86 77 } 87 78 88 79 return $view;
+2 -1
src/applications/home/engine/PhabricatorHomeProfileMenuEngine.php
··· 67 67 ->setMenuItemProperties($properties); 68 68 } 69 69 70 - // Hotlink to More Applications Launcher... 71 70 $items[] = $this->newItem() 72 71 ->setBuiltinKey(PhabricatorHomeConstants::ITEM_LAUNCHER) 73 72 ->setMenuItemKey(PhabricatorHomeLauncherProfileMenuItem::MENUITEMKEY); 73 + 74 + $items[] = $this->newDividerItem('tail'); 74 75 75 76 $items[] = $this->newManageItem(); 76 77
+19 -18
src/applications/search/engine/PhabricatorProfileMenuEngine.php
··· 8 8 private $items; 9 9 private $controller; 10 10 private $navigation; 11 - private $showNavigation = true; 12 11 private $editMode; 13 12 private $pageClasses = array(); 14 13 private $showContentCrumbs = true; ··· 69 68 70 69 public function getController() { 71 70 return $this->controller; 72 - } 73 - 74 - public function setShowNavigation($show) { 75 - $this->showNavigation = $show; 76 - return $this; 77 - } 78 - 79 - public function getShowNavigation() { 80 - return $this->showNavigation; 81 71 } 82 72 83 73 public function addContentPageClass($class) { ··· 181 171 $crumbs = $controller->buildApplicationCrumbsForEditEngine(); 182 172 183 173 if (!$is_view) { 174 + $edit_mode = null; 175 + 184 176 if ($selected_item) { 185 - if ($selected_item->getCustomPHID()) { 186 - $edit_mode = 'custom'; 187 - } else { 188 - $edit_mode = 'global'; 177 + if ($selected_item->getBuiltinKey() !== self::ITEM_MANAGE) { 178 + if ($selected_item->getCustomPHID()) { 179 + $edit_mode = 'custom'; 180 + } else { 181 + $edit_mode = 'global'; 182 + } 189 183 } 190 - } else { 184 + } 185 + 186 + if ($edit_mode === null) { 191 187 $edit_mode = $request->getURIData('itemEditMode'); 192 188 } 193 189 ··· 309 305 $page->setCrumbs($crumbs); 310 306 } 311 307 312 - if ($this->getShowNavigation()) { 313 - $page->setNavigation($navigation); 314 - } 308 + $page->setNavigation($navigation); 315 309 316 310 if ($is_view) { 317 311 foreach ($this->pageClasses as $class) { ··· 1130 1124 return $this->newItem() 1131 1125 ->setBuiltinKey(self::ITEM_MANAGE) 1132 1126 ->setMenuItemKey(PhabricatorManageProfileMenuItem::MENUITEMKEY) 1127 + ->setIsTailItem(true); 1128 + } 1129 + 1130 + protected function newDividerItem($key) { 1131 + return $this->newItem() 1132 + ->setBuiltinKey($key) 1133 + ->setMenuItemKey(PhabricatorDividerProfileMenuItem::MENUITEMKEY) 1133 1134 ->setIsTailItem(true); 1134 1135 } 1135 1136