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

Remove the "Graph" view as a dedicated repository view

Summary:
Ref T13552. Currently, Diffusion has two effectively identical history views, the "Graph" view and the "History" view.

These arose out of product uncertainty about the importance of the graph, but I think we can just put the graph on the "object item list" view and merge these views.

Test Plan: Looked at repositories in Diffusion, no longer saw a "Graph" tab. Grepped for "graph"-related symbols.

Maniphest Tasks: T13552

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

-129
-2
src/__phutil_library_map__.php
··· 861 861 'DiffusionGitWireProtocolCapabilities' => 'applications/diffusion/protocol/DiffusionGitWireProtocolCapabilities.php', 862 862 'DiffusionGitWireProtocolRef' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRef.php', 863 863 'DiffusionGitWireProtocolRefList' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRefList.php', 864 - 'DiffusionGraphController' => 'applications/diffusion/controller/DiffusionGraphController.php', 865 864 'DiffusionHistoryController' => 'applications/diffusion/controller/DiffusionHistoryController.php', 866 865 'DiffusionHistoryListView' => 'applications/diffusion/view/DiffusionHistoryListView.php', 867 866 'DiffusionHistoryQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php', ··· 6955 6954 'DiffusionGitWireProtocolCapabilities' => 'Phobject', 6956 6955 'DiffusionGitWireProtocolRef' => 'Phobject', 6957 6956 'DiffusionGitWireProtocolRefList' => 'Phobject', 6958 - 'DiffusionGraphController' => 'DiffusionController', 6959 6957 'DiffusionHistoryController' => 'DiffusionController', 6960 6958 'DiffusionHistoryListView' => 'DiffusionHistoryView', 6961 6959 'DiffusionHistoryQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
-1
src/applications/diffusion/application/PhabricatorDiffusionApplication.php
··· 52 52 'change/(?P<dblob>.*)' => 'DiffusionChangeController', 53 53 'clone/' => 'DiffusionCloneController', 54 54 'history/(?P<dblob>.*)' => 'DiffusionHistoryController', 55 - 'graph/(?P<dblob>.*)' => 'DiffusionGraphController', 56 55 'browse/(?P<dblob>.*)' => 'DiffusionBrowseController', 57 56 'document/(?P<dblob>.*)' 58 57 => 'DiffusionDocumentController',
-14
src/applications/diffusion/controller/DiffusionController.php
··· 210 210 case 'history': 211 211 $view_name = pht('History'); 212 212 break; 213 - case 'graph': 214 - $view_name = pht('Graph'); 215 - break; 216 213 case 'browse': 217 214 $view_name = pht('Browse'); 218 215 break; ··· 552 549 'action' => 'history', 553 550 ))) 554 551 ->setSelected($key == 'history')); 555 - 556 - $view->addMenuItem( 557 - id(new PHUIListItemView()) 558 - ->setKey('graph') 559 - ->setName(pht('Graph')) 560 - ->setIcon('fa-code-fork') 561 - ->setHref($drequest->generateURI( 562 - array( 563 - 'action' => 'graph', 564 - ))) 565 - ->setSelected($key == 'graph')); 566 552 567 553 return $view; 568 554
-110
src/applications/diffusion/controller/DiffusionGraphController.php
··· 1 - <?php 2 - 3 - final class DiffusionGraphController extends DiffusionController { 4 - 5 - public function shouldAllowPublic() { 6 - return true; 7 - } 8 - 9 - public function handleRequest(AphrontRequest $request) { 10 - $response = $this->loadDiffusionContext(); 11 - if ($response) { 12 - return $response; 13 - } 14 - require_celerity_resource('diffusion-css'); 15 - 16 - $viewer = $this->getViewer(); 17 - $drequest = $this->getDiffusionRequest(); 18 - $repository = $drequest->getRepository(); 19 - 20 - $pager = id(new PHUIPagerView()) 21 - ->readFromRequest($request); 22 - 23 - $params = array( 24 - 'commit' => $drequest->getCommit(), 25 - 'path' => $drequest->getPath(), 26 - 'offset' => $pager->getOffset(), 27 - 'limit' => $pager->getPageSize() + 1, 28 - ); 29 - 30 - $history_results = $this->callConduitWithDiffusionRequest( 31 - 'diffusion.historyquery', 32 - $params); 33 - $history = DiffusionPathChange::newFromConduit( 34 - $history_results['pathChanges']); 35 - 36 - $history = $pager->sliceResults($history); 37 - 38 - $graph = id(new DiffusionHistoryTableView()) 39 - ->setViewer($viewer) 40 - ->setDiffusionRequest($drequest) 41 - ->setHistory($history); 42 - 43 - $show_graph = !strlen($drequest->getPath()); 44 - if ($show_graph) { 45 - $graph->setParents($history_results['parents']); 46 - $graph->setIsHead(!$pager->getOffset()); 47 - $graph->setIsTail(!$pager->getHasMorePages()); 48 - } 49 - 50 - $header = $this->buildHeader($drequest); 51 - 52 - $crumbs = $this->buildCrumbs( 53 - array( 54 - 'branch' => true, 55 - 'path' => true, 56 - 'view' => 'graph', 57 - )); 58 - $crumbs->setBorder(true); 59 - 60 - $title = array( 61 - pht('Graph'), 62 - $repository->getDisplayName(), 63 - ); 64 - 65 - $graph_view = id(new PHUIObjectBoxView()) 66 - ->setHeaderText(pht('History Graph')) 67 - ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 68 - ->setTable($graph) 69 - ->addClass('diffusion-mobile-view') 70 - ->setPager($pager); 71 - 72 - $tabs = $this->buildTabsView('graph'); 73 - 74 - $view = id(new PHUITwoColumnView()) 75 - ->setHeader($header) 76 - ->setTabs($tabs) 77 - ->setFooter($graph_view); 78 - 79 - return $this->newPage() 80 - ->setTitle($title) 81 - ->setCrumbs($crumbs) 82 - ->appendChild($view); 83 - } 84 - 85 - private function buildHeader(DiffusionRequest $drequest) { 86 - $viewer = $this->getViewer(); 87 - $repository = $drequest->getRepository(); 88 - 89 - $no_path = !strlen($drequest->getPath()); 90 - if ($no_path) { 91 - $header_text = pht('Graph'); 92 - } else { 93 - $header_text = $this->renderPathLinks($drequest, $mode = 'history'); 94 - } 95 - 96 - $header = id(new PHUIHeaderView()) 97 - ->setUser($viewer) 98 - ->setHeader($header_text) 99 - ->setHeaderIcon('fa-code-fork'); 100 - 101 - if (!$repository->isSVN()) { 102 - $branch_tag = $this->renderBranchTag($drequest); 103 - $header->addTag($branch_tag); 104 - } 105 - 106 - return $header; 107 - 108 - } 109 - 110 - }
-2
src/applications/repository/storage/PhabricatorRepository.php
··· 682 682 $action = idx($params, 'action'); 683 683 switch ($action) { 684 684 case 'history': 685 - case 'graph': 686 685 case 'clone': 687 686 case 'blame': 688 687 case 'browse': ··· 763 762 switch ($action) { 764 763 case 'change': 765 764 case 'history': 766 - case 'graph': 767 765 case 'blame': 768 766 case 'browse': 769 767 case 'document':