@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.

Policy - make sure "quick create" menu doesn't show up if you have nothing you can quick create

Summary: Fixes T7117. The slightly icky part is we just build the menu items up 2x because there's no way to tell you wont be able to make a menu item unless you try to make them all and come up with nada.

Test Plan: created a user and denied them access to every application in the quick create menu. observed the "+" icon disappearing from the nav, correctly. used a different, unrestricted user and the menu showed up and worked

Reviewers: epriestley, chad

Reviewed By: chad

Subscribers: Korvin, epriestley

Maniphest Tasks: T7117

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

+21 -14
+21 -14
src/applications/home/application/PhabricatorHomeApplication.php
··· 46 46 PhabricatorUser $user, 47 47 PhabricatorController $controller = null) { 48 48 49 + $quick_create_items = $this->loadAllQuickCreateItems($user); 49 50 $items = array(); 50 51 51 - if ($user->isLoggedIn() && $user->isUserActivated()) { 52 + if ($user->isLoggedIn() && 53 + $user->isUserActivated() && 54 + $quick_create_items) { 52 55 $create_id = celerity_generate_unique_node_id(); 53 56 Javelin::initBehavior( 54 57 'aphlict-dropdown', ··· 98 101 99 102 $items = $this->loadAllQuickCreateItems($viewer); 100 103 101 - $view = new PHUIListView(); 102 - $view->newLabel(pht('Create New...')); 103 - foreach ($items as $item) { 104 - $view->addMenuItem($item); 105 - } 104 + $view = null; 105 + if ($items) { 106 + $view = new PHUIListView(); 107 + $view->newLabel(pht('Create New...')); 108 + foreach ($items as $item) { 109 + $view->addMenuItem($item); 110 + } 106 111 107 - return phutil_tag( 108 - 'div', 109 - array( 110 - 'id' => 'phabricator-quick-create-menu', 111 - 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav', 112 - 'style' => 'display: none', 113 - ), 114 - $view); 112 + return phutil_tag( 113 + 'div', 114 + array( 115 + 'id' => 'phabricator-quick-create-menu', 116 + 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav', 117 + 'style' => 'display: none', 118 + ), 119 + $view); 120 + } 121 + return $view; 115 122 } 116 123 117 124 }