Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15357904
D18386.id44193.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D18386.id44193.diff
View Options
diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
@@ -67,6 +67,7 @@
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
+ $content = array();
$view = id(new PHUIPropertyListView())
->setViewer($viewer);
@@ -90,8 +91,66 @@
}
$view->addProperty(pht('Autoclose Only'), $autoclose_only);
+ $content[] = $this->newBox(pht('Branches'), $view);
+
+ // Branch Autoclose Table
+ if (!$repository->isImporting()) {
+ $request = $this->getRequest();
+ $pager = id(new PHUIPagerView())
+ ->readFromRequest($request);
+
+ $params = array(
+ 'offset' => $pager->getOffset(),
+ 'limit' => $pager->getPageSize() + 1,
+ 'repository' => $repository->getID(),
+ );
+
+ $branches = id(new ConduitCall('diffusion.branchquery', $params))
+ ->setUser($viewer)
+ ->execute();
+ $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
+ $branches = $pager->sliceResults($branches);
+
+ $rows = array();
+ foreach ($branches as $branch) {
+ $branch_name = $branch->getShortName();
+ $tracking = $repository->shouldTrackBranch($branch_name);
+ $autoclosing = $repository->shouldAutocloseBranch($branch_name);
+
+ $rows[] = array(
+ $branch_name,
+ $tracking ? pht('Tracking') : pht('Off'),
+ $autoclosing ? pht('Autoclose On') : pht('Off'),
+ );
+ }
+ $branch_table = new AphrontTableView($rows);
+ $branch_table->setHeaders(
+ array(
+ pht('Branch'),
+ pht('Track'),
+ pht('Autoclose'),
+ ));
+ $branch_table->setColumnClasses(
+ array(
+ 'pri',
+ 'narrow',
+ 'wide',
+ ));
+
+ $box = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Branch Status'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->setTable($branch_table)
+ ->setPager($pager);
+ $content[] = $box;
+ } else {
+ $content[] = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
+ ->appendChild(pht('Branch status in unavailable while the repository '.
+ 'is still importing.'));
+ }
- return $this->newBox(pht('Branches'), $view);
+ return $content;
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
@@ -25,6 +25,10 @@
return $this->repository;
}
+ final public function getRequest() {
+ return $this->controller->getRequest();
+ }
+
final public function setController(PhabricatorController $controller) {
$this->controller = $controller;
return $this;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 7:04 AM (2 h, 2 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7310282
Default Alt Text
D18386.id44193.diff (3 KB)
Attached To
Mode
D18386: Add status table to Diffusion Branch manage page
Attached
Detach File
Event Timeline
Log In to Comment