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

Add status table to Diffusion Branch manage page

Summary: Fixes T12832. Adds a basic table (not paginated?) to view tracking and autoclose status.

Test Plan:
Review a large repository (Krita) with setting various states of tracking and autoclose.

{F5092117}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12832

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

+64 -1
+60 -1
src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
··· 67 67 public function buildManagementPanelContent() { 68 68 $repository = $this->getRepository(); 69 69 $viewer = $this->getViewer(); 70 + $content = array(); 70 71 71 72 $view = id(new PHUIPropertyListView()) 72 73 ->setViewer($viewer); ··· 90 91 } 91 92 92 93 $view->addProperty(pht('Autoclose Only'), $autoclose_only); 94 + $content[] = $this->newBox(pht('Branches'), $view); 93 95 94 - return $this->newBox(pht('Branches'), $view); 96 + // Branch Autoclose Table 97 + if (!$repository->isImporting()) { 98 + $request = $this->getRequest(); 99 + $pager = id(new PHUIPagerView()) 100 + ->readFromRequest($request); 101 + 102 + $params = array( 103 + 'offset' => $pager->getOffset(), 104 + 'limit' => $pager->getPageSize() + 1, 105 + 'repository' => $repository->getID(), 106 + ); 107 + 108 + $branches = id(new ConduitCall('diffusion.branchquery', $params)) 109 + ->setUser($viewer) 110 + ->execute(); 111 + $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches); 112 + $branches = $pager->sliceResults($branches); 113 + 114 + $rows = array(); 115 + foreach ($branches as $branch) { 116 + $branch_name = $branch->getShortName(); 117 + $tracking = $repository->shouldTrackBranch($branch_name); 118 + $autoclosing = $repository->shouldAutocloseBranch($branch_name); 119 + 120 + $rows[] = array( 121 + $branch_name, 122 + $tracking ? pht('Tracking') : pht('Off'), 123 + $autoclosing ? pht('Autoclose On') : pht('Off'), 124 + ); 125 + } 126 + $branch_table = new AphrontTableView($rows); 127 + $branch_table->setHeaders( 128 + array( 129 + pht('Branch'), 130 + pht('Track'), 131 + pht('Autoclose'), 132 + )); 133 + $branch_table->setColumnClasses( 134 + array( 135 + 'pri', 136 + 'narrow', 137 + 'wide', 138 + )); 139 + 140 + $box = id(new PHUIObjectBoxView()) 141 + ->setHeaderText(pht('Branch Status')) 142 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 143 + ->setTable($branch_table) 144 + ->setPager($pager); 145 + $content[] = $box; 146 + } else { 147 + $content[] = id(new PHUIInfoView()) 148 + ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 149 + ->appendChild(pht('Branch status in unavailable while the repository '. 150 + 'is still importing.')); 151 + } 152 + 153 + return $content; 95 154 } 96 155 97 156 }
+4
src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
··· 25 25 return $this->repository; 26 26 } 27 27 28 + final public function getRequest() { 29 + return $this->controller->getRequest(); 30 + } 31 + 28 32 final public function setController(PhabricatorController $controller) { 29 33 $this->controller = $controller; 30 34 return $this;