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

Set icon directly in some PHUIButtonViews; drop PHUIIconView calls

Summary: Replace unneeded explicit `id(new PHUIIconView())` calls within `id(new PHUIButtonView())->setIcon()` by simply passing the FontAwesome icon namely directly.

Test Plan:
* Set up a Dashboard Query Panel and go to it, see that the "View All" header button of the "... Query Panel" box still renders the same icon.
* Set up a Project with a Milestone and a Subproject and go to its project profile page, see that the "View All" header button of the "Recent Activity", "Milestones" and "Subproject" boxes still render the same icon.
* Set up a User and go to their user profile page, see that the "View All" header button of the "Recent Activity" box still renders the same icon.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26333

+17 -46
+1 -4
src/applications/dashboard/paneltype/PhabricatorDashboardChartPanelType.php
··· 57 57 $key = $panel->getProperty('chartKey'); 58 58 $uri = PhabricatorChartRenderingEngine::getChartURI($key); 59 59 60 - $icon = id(new PHUIIconView()) 61 - ->setIcon('fa-area-chart'); 62 - 63 60 $button = id(new PHUIButtonView()) 64 61 ->setTag('a') 65 62 ->setText(pht('View Chart')) 66 - ->setIcon($icon) 63 + ->setIcon('fa-area-chart') 67 64 ->setHref($uri) 68 65 ->setColor(PHUIButtonView::GREY); 69 66
+1 -4
src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
··· 179 179 $key = $panel->getProperty('key'); 180 180 $href = $search_engine->getQueryResultsPageURI($key); 181 181 182 - $icon = id(new PHUIIconView()) 183 - ->setIcon('fa-search'); 184 - 185 182 $button = id(new PHUIButtonView()) 186 183 ->setTag('a') 187 184 ->setText(pht('View All')) 188 - ->setIcon($icon) 185 + ->setIcon('fa-search') 189 186 ->setHref($href) 190 187 ->setColor(PHUIButtonView::GREY); 191 188
+1 -3
src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php
··· 88 88 ->setSubheader($application->getAppEmailBlurb()) 89 89 ->setHeaderIcon('fa-pencil'); 90 90 91 - $icon = id(new PHUIIconView()) 92 - ->setIcon('fa-plus'); 93 91 $button = new PHUIButtonView(); 94 92 $button->setText(pht('Add New Address')); 95 93 $button->setTag('a'); 96 94 $button->setHref($uri->alter('new', 'true')); 97 - $button->setIcon($icon); 95 + $button->setIcon('fa-plus'); 98 96 $button->addSigil('workflow'); 99 97 $header->addActionLink($button); 100 98
+1 -4
src/applications/notification/query/PhabricatorNotificationSearchEngine.php
··· 84 84 85 85 $viewer = $this->requireViewer(); 86 86 87 - $image = id(new PHUIIconView()) 88 - ->setIcon('fa-bell-o'); 89 - 90 87 $button = id(new PHUIButtonView()) 91 88 ->setTag('a') 92 89 ->addSigil('workflow') 93 90 ->setColor(PHUIButtonView::GREY) 94 - ->setIcon($image) 91 + ->setIcon('fa-bell-o') 95 92 ->setText(pht('Mark All Read')); 96 93 97 94 switch ($query->getQueryKey()) {
+1 -3
src/applications/people/controller/PhabricatorPeopleProfileViewController.php
··· 31 31 32 32 $view_all = id(new PHUIButtonView()) 33 33 ->setTag('a') 34 - ->setIcon( 35 - id(new PHUIIconView()) 36 - ->setIcon('fa-list-ul')) 34 + ->setIcon('fa-list-ul') 37 35 ->setText(pht('View All')) 38 36 ->setHref('/feed/?userPHIDs='.$user->getPHID()); 39 37
+3 -12
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 104 104 105 105 $view_all = id(new PHUIButtonView()) 106 106 ->setTag('a') 107 - ->setIcon( 108 - id(new PHUIIconView()) 109 - ->setIcon('fa-list-ul')) 107 + ->setIcon('fa-list-ul') 110 108 ->setText(pht('View All')) 111 109 ->setHref('/feed/?projectPHIDs='.$project->getPHID()); 112 110 ··· 225 223 $watch_disabled = false; 226 224 } 227 225 228 - $watch_icon = id(new PHUIIconView()) 229 - ->setIcon($watch_icon); 230 - 231 226 return id(new PHUIButtonView()) 232 227 ->setTag('a') 233 228 ->setWorkflow(true) ··· 267 262 268 263 $view_all = id(new PHUIButtonView()) 269 264 ->setTag('a') 270 - ->setIcon( 271 - id(new PHUIIconView()) 272 - ->setIcon('fa-list-ul')) 265 + ->setIcon('fa-list-ul') 273 266 ->setText(pht('View All')) 274 267 ->setHref("/project/subprojects/{$id}/"); 275 268 ··· 315 308 316 309 $view_all = id(new PHUIButtonView()) 317 310 ->setTag('a') 318 - ->setIcon( 319 - id(new PHUIIconView()) 320 - ->setIcon('fa-list-ul')) 311 + ->setIcon('fa-list-ul') 321 312 ->setText(pht('View All')) 322 313 ->setHref("/project/subprojects/{$id}/"); 323 314
+1 -4
src/view/control/AphrontTokenizerTemplateView.php
··· 78 78 ), 79 79 $content); 80 80 81 - $icon = id(new PHUIIconView()) 82 - ->setIcon('fa-search'); 83 - 84 81 $browse = id(new PHUIButtonView()) 85 82 ->setTag('a') 86 - ->setIcon($icon) 83 + ->setIcon('fa-search') 87 84 ->addClass('tokenizer-browse-button') 88 85 ->setColor(PHUIButtonView::GREY) 89 86 ->addSigil('tokenizer-browse');
+4
src/view/phui/PHUIButtonView.php
··· 133 133 return $this->auralLabel; 134 134 } 135 135 136 + /** 137 + * @param PHUIIconView|string $icon 138 + * @param ?bool $first 139 + */ 136 140 public function setIcon($icon, $first = true) { 137 141 if (!($icon instanceof PHUIIconView)) { 138 142 $icon = id(new PHUIIconView())
+2 -6
src/view/phui/calendar/PHUICalendarDayView.php
··· 260 260 261 261 $button_bar = new PHUIButtonBarView(); 262 262 263 - $left_icon = id(new PHUIIconView()) 264 - ->setIcon('fa-chevron-left bluegrey'); 265 263 $left = id(new PHUIButtonView()) 266 264 ->setTag('a') 267 265 ->setColor(PHUIButtonView::GREY) 268 266 ->setHref($prev_uri) 269 267 ->setTitle(pht('Previous Day')) 270 - ->setIcon($left_icon); 268 + ->setIcon('fa-chevron-left bluegrey'); 271 269 272 - $right_icon = id(new PHUIIconView()) 273 - ->setIcon('fa-chevron-right bluegrey'); 274 270 $right = id(new PHUIButtonView()) 275 271 ->setTag('a') 276 272 ->setColor(PHUIButtonView::GREY) 277 273 ->setHref($next_uri) 278 274 ->setTitle(pht('Next Day')) 279 - ->setIcon($right_icon); 275 + ->setIcon('fa-chevron-right bluegrey'); 280 276 281 277 $button_bar->addButton($left); 282 278 $button_bar->addButton($right);
+2 -6
src/view/phui/calendar/PHUICalendarMonthView.php
··· 411 411 412 412 $button_bar = new PHUIButtonBarView(); 413 413 414 - $left_icon = id(new PHUIIconView()) 415 - ->setIcon('fa-chevron-left bluegrey'); 416 414 $left = id(new PHUIButtonView()) 417 415 ->setTag('a') 418 416 ->setColor(PHUIButtonView::GREY) 419 417 ->setHref($prev_uri) 420 418 ->setTitle(pht('Previous Month')) 421 - ->setIcon($left_icon); 419 + ->setIcon('fa-chevron-left bluegrey'); 422 420 423 - $right_icon = id(new PHUIIconView()) 424 - ->setIcon('fa-chevron-right bluegrey'); 425 421 $right = id(new PHUIButtonView()) 426 422 ->setTag('a') 427 423 ->setColor(PHUIButtonView::GREY) 428 424 ->setHref($next_uri) 429 425 ->setTitle(pht('Next Month')) 430 - ->setIcon($right_icon); 426 + ->setIcon('fa-chevron-right bluegrey'); 431 427 432 428 $button_bar->addButton($left); 433 429 $button_bar->addButton($right);