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

Display noDataString for no commits in DiffusionCommitGraphView

Summary:
When a user has no commits, the view is empty. Instead display an explanation similar to the existing text for no revisions.

Closes T16200

Test Plan:
* Go to http://phorge.localhost/people/commits/1/ for a user who has no commits. See a placeholder text explanation instead of emptiness.
* Go to http://phorge.localhost/people/commits/2/ for a user who has commits. See a blue header "Recent Commits", similar to "Recent Revisions" shown regardless of existing revisions or not.

Reviewers: O1 Blessed Committers, valerio.bozzolan, mainframe98

Reviewed By: O1 Blessed Committers, valerio.bozzolan, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16200

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

+31 -8
+3
src/applications/differential/view/DifferentialRevisionListView.php
··· 53 53 return $this; 54 54 } 55 55 56 + /** 57 + * @return PHUIObjectItemListView 58 + */ 56 59 public function render() { 57 60 $viewer = $this->getViewer(); 58 61
+20 -6
src/applications/diffusion/view/DiffusionCommitGraphView.php
··· 9 9 private $isTail; 10 10 private $parents; 11 11 private $filterParents; 12 + private $noDataString; 12 13 13 14 private $commitMap; 14 15 private $buildableMap; ··· 79 80 80 81 public function getFilterParents() { 81 82 return $this->filterParents; 83 + } 84 + 85 + public function setNoDataString($no_data_string) { 86 + $this->noDataString = $no_data_string; 87 + return $this; 82 88 } 83 89 84 90 private function getRepository() { ··· 215 221 return $views; 216 222 } 217 223 224 + /** 225 + * @return array<PHUIObjectItemListView> 226 + */ 218 227 private function newObjectItemRows() { 219 228 $viewer = $this->getViewer(); 220 229 ··· 276 285 $rows[$idx] = phutil_tag('tr', array(), $cells); 277 286 } 278 287 279 - $table = phutil_tag( 280 - 'table', 281 - array( 282 - 'class' => 'diffusion-commit-graph-table', 283 - ), 284 - $rows); 288 + if ($rows) { 289 + $table = phutil_tag( 290 + 'table', 291 + array( 292 + 'class' => 'diffusion-commit-graph-table', 293 + ), 294 + $rows); 295 + } else { 296 + $table = id(new PHUIObjectItemListView()) 297 + ->setNoDataString($this->noDataString); 298 + } 285 299 286 300 return $table; 287 301 }
+8 -2
src/applications/people/controller/PhabricatorPeopleProfileCommitsController.php
··· 64 64 65 65 $list = id(new DiffusionCommitGraphView()) 66 66 ->setViewer($viewer) 67 - ->setCommits($commits); 67 + ->setCommits($commits) 68 + ->setNoDataString(pht('No recent commits.')); 68 69 69 - return $list; 70 + $view = id(new PHUIObjectBoxView()) 71 + ->setHeaderText(pht('Recent Commits')) 72 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 73 + ->appendChild($list); 74 + 75 + return $view; 70 76 } 71 77 }