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

Fix getIcon calls in PHUIObjectListItem

Summary: Fixes T11501. Let's you pass in a full PHUIIconView or just the icon name to give ObjectListItem a large icon.

Test Plan: Alamanac, Applications, Drydock, Settings, Search Typeahead, Config page...

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T11501

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

+17 -30
+5 -5
src/applications/almanac/controller/AlmanacConsoleController.php
··· 16 16 id(new PHUIObjectItemView()) 17 17 ->setHeader(pht('Devices')) 18 18 ->setHref($this->getApplicationURI('device/')) 19 - ->setIcon('fa-server') 19 + ->setImageIcon('fa-server') 20 20 ->addAttribute( 21 21 pht( 22 22 'Create an inventory of physical and virtual hosts and '. ··· 26 26 id(new PHUIObjectItemView()) 27 27 ->setHeader(pht('Services')) 28 28 ->setHref($this->getApplicationURI('service/')) 29 - ->setIcon('fa-plug') 29 + ->setImageIcon('fa-plug') 30 30 ->addAttribute( 31 31 pht( 32 32 'Create and update services, and map them to interfaces on '. ··· 36 36 id(new PHUIObjectItemView()) 37 37 ->setHeader(pht('Networks')) 38 38 ->setHref($this->getApplicationURI('network/')) 39 - ->setIcon('fa-globe') 39 + ->setImageIcon('fa-globe') 40 40 ->addAttribute( 41 41 pht( 42 42 'Manage public and private networks.'))); ··· 45 45 id(new PHUIObjectItemView()) 46 46 ->setHeader(pht('Namespaces')) 47 47 ->setHref($this->getApplicationURI('namespace/')) 48 - ->setIcon('fa-asterisk') 48 + ->setImageIcon('fa-asterisk') 49 49 ->addAttribute( 50 50 pht('Control who can create new named services and devices.'))); 51 51 ··· 56 56 id(new PHUIObjectItemView()) 57 57 ->setHeader(pht('Documentation')) 58 58 ->setHref($docs_uri) 59 - ->setIcon('fa-book') 59 + ->setImageIcon('fa-book') 60 60 ->addAttribute(pht('Browse documentation for Almanac.'))); 61 61 62 62 $crumbs = $this->buildApplicationCrumbs();
+1 -1
src/applications/config/controller/PhabricatorConfigListController.php
··· 51 51 ->setHeader($group->getName()) 52 52 ->setHref('/config/group/'.$group->getKey().'/') 53 53 ->addAttribute($group->getDescription()) 54 - ->setIcon($group->getIcon()); 54 + ->setImageIcon($group->getIcon()); 55 55 $list->addItem($item); 56 56 } 57 57 }
+4 -4
src/applications/drydock/controller/DrydockConsoleController.php
··· 31 31 $menu->addItem( 32 32 id(new PHUIObjectItemView()) 33 33 ->setHeader(pht('Blueprints')) 34 - ->setIcon('fa-map-o') 34 + ->setImageIcon('fa-map-o') 35 35 ->setHref($this->getApplicationURI('blueprint/')) 36 36 ->addAttribute( 37 37 pht( ··· 41 41 $menu->addItem( 42 42 id(new PHUIObjectItemView()) 43 43 ->setHeader(pht('Resources')) 44 - ->setIcon('fa-map') 44 + ->setImageIcon('fa-map') 45 45 ->setHref($this->getApplicationURI('resource/')) 46 46 ->addAttribute( 47 47 pht('View and manage resources Drydock has built, like hosts.'))); ··· 49 49 $menu->addItem( 50 50 id(new PHUIObjectItemView()) 51 51 ->setHeader(pht('Leases')) 52 - ->setIcon('fa-link') 52 + ->setImageIcon('fa-link') 53 53 ->setHref($this->getApplicationURI('lease/')) 54 54 ->addAttribute(pht('Manage leases on resources.'))); 55 55 56 56 $menu->addItem( 57 57 id(new PHUIObjectItemView()) 58 58 ->setHeader(pht('Repository Operations')) 59 - ->setIcon('fa-fighter-jet') 59 + ->setImageIcon('fa-fighter-jet') 60 60 ->setHref($this->getApplicationURI('operation/')) 61 61 ->addAttribute(pht('Review the repository operation queue.'))); 62 62
+1 -13
src/applications/meta/query/PhabricatorAppSearchEngine.php
··· 214 214 $icon = 'application'; 215 215 } 216 216 217 - // TODO: This sheet doesn't work the same way other sheets do so it 218 - // ends up with the wrong classes if we try to use PHUIIconView. This 219 - // is probably all changing in the redesign anyway. 220 - 221 - $icon_view = javelin_tag( 222 - 'span', 223 - array( 224 - 'class' => 'phui-icon-view phui-font-fa '.$icon, 225 - 'aural' => false, 226 - ), 227 - ''); 228 - 229 217 $description = $application->getShortDescription(); 230 218 231 219 $configure = id(new PHUIButtonView()) ··· 241 229 242 230 $item = id(new PHUIObjectItemView()) 243 231 ->setHeader($name) 244 - ->setImageIcon($icon_view) 232 + ->setImageIcon($icon) 245 233 ->setSubhead($description) 246 234 ->setLaunchButton($configure); 247 235
+2 -2
src/applications/settings/query/PhabricatorUserPreferencesSearchEngine.php
··· 65 65 $item = id(new PHUIObjectItemView()) 66 66 ->setHeader($setting->getDisplayName()) 67 67 ->setHref($setting->getEditURI()) 68 - ->setImageURI(PhabricatorUser::getDefaultProfileImageURI()) 69 - ->setIcon('fa-globe') 68 + // TODO: Replace this with NUX Style bg / white icon when built 69 + ->setImageIcon('fa-globe') 70 70 ->addAttribute(pht('Edit global default settings for all users.')); 71 71 72 72 $list->addItem($item);
+4 -5
src/view/phui/PHUIObjectItemView.php
··· 131 131 } 132 132 133 133 public function setImageIcon($image_icon) { 134 + if (!$image_icon instanceof PHUIIconView) { 135 + $image_icon = id(new PHUIIconView()) 136 + ->setIcon($image_icon); 137 + } 134 138 $this->imageIcon = $image_icon; 135 139 return $this; 136 140 } ··· 165 169 'attributes' => $attributes, 166 170 ); 167 171 return $this; 168 - } 169 - 170 - public function setIcon($icon) { 171 - // TODO: Remove this in favor of setStatusIcon()? 172 - return $this->setStatusIcon($icon); 173 172 } 174 173 175 174 public function setStatusIcon($icon, $label = null) {