1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +01:00

Hide branch status if repository is not hg

Summary: Better table layouts here for branches view

Test Plan: Test git, hg repositories. See column go away.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18444
This commit is contained in:
Chad Little 2017-08-17 13:28:51 -07:00
parent 60df67af53
commit 295c806219

View file

@ -110,6 +110,7 @@ final class DiffusionRepositoryBranchesManagementPanel
->execute();
$branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
$branches = $pager->sliceResults($branches);
$can_close_branches = ($repository->isHg());
$rows = array();
foreach ($branches as $branch) {
@ -135,9 +136,9 @@ final class DiffusionRepositoryBranchesManagementPanel
$rows[] = array(
$icon,
$branch_name,
$status,
$tracking ? pht('Tracking') : pht('Off'),
$autoclosing ? pht('Autoclose On') : pht('Off'),
$status,
);
}
$branch_table = new AphrontTableView($rows);
@ -145,9 +146,9 @@ final class DiffusionRepositoryBranchesManagementPanel
array(
'',
pht('Branch'),
pht('Status'),
pht('Track'),
pht('Autoclose'),
pht('Status'),
));
$branch_table->setColumnClasses(
array(
@ -157,6 +158,14 @@ final class DiffusionRepositoryBranchesManagementPanel
'narrow',
'wide',
));
$branch_table->setColumnVisibility(
array(
true,
true,
$can_close_branches,
true,
true,
));
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Branch Status'))