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

Separate the repository management UI into sections

Summary: Depends on D19826. Ref T13216. We have a fair number of options here; add some groups so the "Build" stuff can go in a little subcategory and such.

Test Plan: {F6020896}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

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

+146 -14
+10
src/__phutil_library_map__.php
··· 952 952 'DiffusionRepositoryListController' => 'applications/diffusion/controller/DiffusionRepositoryListController.php', 953 953 'DiffusionRepositoryManageController' => 'applications/diffusion/controller/DiffusionRepositoryManageController.php', 954 954 'DiffusionRepositoryManagePanelsController' => 'applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php', 955 + 'DiffusionRepositoryManagementBuildsPanelGroup' => 'applications/diffusion/management/DiffusionRepositoryManagementBuildsPanelGroup.php', 956 + 'DiffusionRepositoryManagementIntegrationsPanelGroup' => 'applications/diffusion/management/DiffusionRepositoryManagementIntegrationsPanelGroup.php', 957 + 'DiffusionRepositoryManagementMainPanelGroup' => 'applications/diffusion/management/DiffusionRepositoryManagementMainPanelGroup.php', 958 + 'DiffusionRepositoryManagementOtherPanelGroup' => 'applications/diffusion/management/DiffusionRepositoryManagementOtherPanelGroup.php', 955 959 'DiffusionRepositoryManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryManagementPanel.php', 960 + 'DiffusionRepositoryManagementPanelGroup' => 'applications/diffusion/management/DiffusionRepositoryManagementPanelGroup.php', 956 961 'DiffusionRepositoryPath' => 'applications/diffusion/data/DiffusionRepositoryPath.php', 957 962 'DiffusionRepositoryPoliciesManagementPanel' => 'applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php', 958 963 'DiffusionRepositoryProfilePictureController' => 'applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php', ··· 6335 6340 'DiffusionRepositoryListController' => 'DiffusionController', 6336 6341 'DiffusionRepositoryManageController' => 'DiffusionController', 6337 6342 'DiffusionRepositoryManagePanelsController' => 'DiffusionRepositoryManageController', 6343 + 'DiffusionRepositoryManagementBuildsPanelGroup' => 'DiffusionRepositoryManagementPanelGroup', 6344 + 'DiffusionRepositoryManagementIntegrationsPanelGroup' => 'DiffusionRepositoryManagementPanelGroup', 6345 + 'DiffusionRepositoryManagementMainPanelGroup' => 'DiffusionRepositoryManagementPanelGroup', 6346 + 'DiffusionRepositoryManagementOtherPanelGroup' => 'DiffusionRepositoryManagementPanelGroup', 6338 6347 'DiffusionRepositoryManagementPanel' => 'Phobject', 6348 + 'DiffusionRepositoryManagementPanelGroup' => 'Phobject', 6339 6349 'DiffusionRepositoryPath' => 'Phobject', 6340 6350 'DiffusionRepositoryPoliciesManagementPanel' => 'DiffusionRepositoryManagementPanel', 6341 6351 'DiffusionRepositoryProfilePictureController' => 'DiffusionController',
+37 -12
src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
··· 93 93 $nav = id(new AphrontSideNavFilterView()) 94 94 ->setBaseURI($base_uri); 95 95 96 - foreach ($panels as $panel) { 97 - $key = $panel->getManagementPanelKey(); 98 - $label = $panel->getManagementPanelLabel(); 99 - $icon = $panel->getManagementPanelIcon(); 100 - $href = $panel->getPanelNavigationURI(); 96 + $groups = DiffusionRepositoryManagementPanelGroup::getAllPanelGroups(); 97 + $panel_groups = mgroup($panels, 'getManagementPanelGroupKey'); 98 + $other_key = DiffusionRepositoryManagementOtherPanelGroup::PANELGROUPKEY; 99 + 100 + foreach ($groups as $group_key => $group) { 101 + // If this is the "Other" group, include everything else that isn't in 102 + // some actual group. 103 + if ($group_key === $other_key) { 104 + $group_panels = array_mergev($panel_groups); 105 + $panel_groups = array(); 106 + } else { 107 + $group_panels = idx($panel_groups, $group_key); 108 + unset($panel_groups[$group_key]); 109 + } 110 + 111 + if (!$group_panels) { 112 + continue; 113 + } 114 + 115 + $label = $group->getManagementPanelGroupLabel(); 116 + if ($label) { 117 + $nav->addLabel($label); 118 + } 119 + 120 + foreach ($group_panels as $panel) { 121 + $key = $panel->getManagementPanelKey(); 122 + $label = $panel->getManagementPanelLabel(); 123 + $icon = $panel->getManagementPanelIcon(); 124 + $href = $panel->getPanelNavigationURI(); 101 125 102 - $item = id(new PHUIListItemView()) 103 - ->setKey($key) 104 - ->setName($label) 105 - ->setType(PHUIListItemView::TYPE_LINK) 106 - ->setHref($href) 107 - ->setIcon($icon); 126 + $item = id(new PHUIListItemView()) 127 + ->setKey($key) 128 + ->setName($label) 129 + ->setType(PHUIListItemView::TYPE_LINK) 130 + ->setHref($href) 131 + ->setIcon($icon); 108 132 109 - $nav->addMenuItem($item); 133 + $nav->addMenuItem($item); 134 + } 110 135 } 111 136 112 137 $nav->selectFilter($selected);
+4
src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
··· 13 13 return 800; 14 14 } 15 15 16 + public function getManagementPanelGroupKey() { 17 + return DiffusionRepositoryManagementBuildsPanelGroup::PANELGROUPKEY; 18 + } 19 + 16 20 public function shouldEnableForRepository( 17 21 PhabricatorRepository $repository) { 18 22 return $repository->isGit();
+16
src/applications/diffusion/management/DiffusionRepositoryManagementBuildsPanelGroup.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositoryManagementBuildsPanelGroup 4 + extends DiffusionRepositoryManagementPanelGroup { 5 + 6 + const PANELGROUPKEY = 'builds'; 7 + 8 + public function getManagementPanelGroupLabel() { 9 + return pht('Builds'); 10 + } 11 + 12 + public function getManagementPanelGroupOrder() { 13 + return 2000; 14 + } 15 + 16 + }
+16
src/applications/diffusion/management/DiffusionRepositoryManagementIntegrationsPanelGroup.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositoryManagementIntegrationsPanelGroup 4 + extends DiffusionRepositoryManagementPanelGroup { 5 + 6 + const PANELGROUPKEY = 'integrations'; 7 + 8 + public function getManagementPanelGroupLabel() { 9 + return pht('Integrations'); 10 + } 11 + 12 + public function getManagementPanelGroupOrder() { 13 + return 4000; 14 + } 15 + 16 + }
+16
src/applications/diffusion/management/DiffusionRepositoryManagementMainPanelGroup.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositoryManagementMainPanelGroup 4 + extends DiffusionRepositoryManagementPanelGroup { 5 + 6 + const PANELGROUPKEY = 'main'; 7 + 8 + public function getManagementPanelGroupLabel() { 9 + return null; 10 + } 11 + 12 + public function getManagementPanelGroupOrder() { 13 + return 1000; 14 + } 15 + 16 + }
+16
src/applications/diffusion/management/DiffusionRepositoryManagementOtherPanelGroup.php
··· 1 + <?php 2 + 3 + final class DiffusionRepositoryManagementOtherPanelGroup 4 + extends DiffusionRepositoryManagementPanelGroup { 5 + 6 + const PANELGROUPKEY = 'other'; 7 + 8 + public function getManagementPanelGroupLabel() { 9 + return pht('Other'); 10 + } 11 + 12 + public function getManagementPanelGroupOrder() { 13 + return 9999; 14 + } 15 + 16 + }
+2 -2
src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
··· 47 47 return 'fa-pencil'; 48 48 } 49 49 50 - protected function buildManagementPanelActions() { 51 - return array(); 50 + public function getManagementPanelGroupKey() { 51 + return DiffusionRepositoryManagementMainPanelGroup::PANELGROUPKEY; 52 52 } 53 53 54 54 public function shouldEnableForRepository(
+21
src/applications/diffusion/management/DiffusionRepositoryManagementPanelGroup.php
··· 1 + <?php 2 + 3 + abstract class DiffusionRepositoryManagementPanelGroup 4 + extends Phobject { 5 + 6 + final public function getManagementPanelGroupKey() { 7 + return $this->getPhobjectClassConstant('PANELGROUPKEY'); 8 + } 9 + 10 + abstract public function getManagementPanelGroupOrder(); 11 + abstract public function getManagementPanelGroupLabel(); 12 + 13 + public static function getAllPanelGroups() { 14 + return id(new PhutilClassMapQuery()) 15 + ->setAncestorClass(__CLASS__) 16 + ->setUniqueMethod('getManagementPanelGroupKey') 17 + ->setSortMethod('getManagementPanelGroupOrder') 18 + ->execute(); 19 + } 20 + 21 + }
+4
src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
··· 13 13 return 700; 14 14 } 15 15 16 + public function getManagementPanelGroupKey() { 17 + return DiffusionRepositoryManagementBuildsPanelGroup::PANELGROUPKEY; 18 + } 19 + 16 20 public function shouldEnableForRepository( 17 21 PhabricatorRepository $repository) { 18 22 return $repository->isGit();
+4
src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php
··· 13 13 return 900; 14 14 } 15 15 16 + public function getManagementPanelGroupKey() { 17 + return DiffusionRepositoryManagementIntegrationsPanelGroup::PANELGROUPKEY; 18 + } 19 + 16 20 public function getManagementPanelIcon() { 17 21 $repository = $this->getRepository(); 18 22