1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

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
This commit is contained in:
epriestley 2020-07-10 10:52:38 -07:00
parent 9afc5c6287
commit c6de7c66a3
5 changed files with 0 additions and 129 deletions

View file

@ -861,7 +861,6 @@ phutil_register_library_map(array(
'DiffusionGitWireProtocolCapabilities' => 'applications/diffusion/protocol/DiffusionGitWireProtocolCapabilities.php',
'DiffusionGitWireProtocolRef' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRef.php',
'DiffusionGitWireProtocolRefList' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRefList.php',
'DiffusionGraphController' => 'applications/diffusion/controller/DiffusionGraphController.php',
'DiffusionHistoryController' => 'applications/diffusion/controller/DiffusionHistoryController.php',
'DiffusionHistoryListView' => 'applications/diffusion/view/DiffusionHistoryListView.php',
'DiffusionHistoryQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php',
@ -6955,7 +6954,6 @@ phutil_register_library_map(array(
'DiffusionGitWireProtocolCapabilities' => 'Phobject',
'DiffusionGitWireProtocolRef' => 'Phobject',
'DiffusionGitWireProtocolRefList' => 'Phobject',
'DiffusionGraphController' => 'DiffusionController',
'DiffusionHistoryController' => 'DiffusionController',
'DiffusionHistoryListView' => 'DiffusionHistoryView',
'DiffusionHistoryQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',

View file

@ -52,7 +52,6 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
'change/(?P<dblob>.*)' => 'DiffusionChangeController',
'clone/' => 'DiffusionCloneController',
'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
'graph/(?P<dblob>.*)' => 'DiffusionGraphController',
'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
'document/(?P<dblob>.*)'
=> 'DiffusionDocumentController',

View file

@ -210,9 +210,6 @@ abstract class DiffusionController extends PhabricatorController {
case 'history':
$view_name = pht('History');
break;
case 'graph':
$view_name = pht('Graph');
break;
case 'browse':
$view_name = pht('Browse');
break;
@ -553,17 +550,6 @@ abstract class DiffusionController extends PhabricatorController {
)))
->setSelected($key == 'history'));
$view->addMenuItem(
id(new PHUIListItemView())
->setKey('graph')
->setName(pht('Graph'))
->setIcon('fa-code-fork')
->setHref($drequest->generateURI(
array(
'action' => 'graph',
)))
->setSelected($key == 'graph'));
return $view;
}

View file

@ -1,110 +0,0 @@
<?php
final class DiffusionGraphController extends DiffusionController {
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$response = $this->loadDiffusionContext();
if ($response) {
return $response;
}
require_celerity_resource('diffusion-css');
$viewer = $this->getViewer();
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
$pager = id(new PHUIPagerView())
->readFromRequest($request);
$params = array(
'commit' => $drequest->getCommit(),
'path' => $drequest->getPath(),
'offset' => $pager->getOffset(),
'limit' => $pager->getPageSize() + 1,
);
$history_results = $this->callConduitWithDiffusionRequest(
'diffusion.historyquery',
$params);
$history = DiffusionPathChange::newFromConduit(
$history_results['pathChanges']);
$history = $pager->sliceResults($history);
$graph = id(new DiffusionHistoryTableView())
->setViewer($viewer)
->setDiffusionRequest($drequest)
->setHistory($history);
$show_graph = !strlen($drequest->getPath());
if ($show_graph) {
$graph->setParents($history_results['parents']);
$graph->setIsHead(!$pager->getOffset());
$graph->setIsTail(!$pager->getHasMorePages());
}
$header = $this->buildHeader($drequest);
$crumbs = $this->buildCrumbs(
array(
'branch' => true,
'path' => true,
'view' => 'graph',
));
$crumbs->setBorder(true);
$title = array(
pht('Graph'),
$repository->getDisplayName(),
);
$graph_view = id(new PHUIObjectBoxView())
->setHeaderText(pht('History Graph'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($graph)
->addClass('diffusion-mobile-view')
->setPager($pager);
$tabs = $this->buildTabsView('graph');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setTabs($tabs)
->setFooter($graph_view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($view);
}
private function buildHeader(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
$repository = $drequest->getRepository();
$no_path = !strlen($drequest->getPath());
if ($no_path) {
$header_text = pht('Graph');
} else {
$header_text = $this->renderPathLinks($drequest, $mode = 'history');
}
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setHeader($header_text)
->setHeaderIcon('fa-code-fork');
if (!$repository->isSVN()) {
$branch_tag = $this->renderBranchTag($drequest);
$header->addTag($branch_tag);
}
return $header;
}
}

View file

@ -682,7 +682,6 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
$action = idx($params, 'action');
switch ($action) {
case 'history':
case 'graph':
case 'clone':
case 'blame':
case 'browse':
@ -763,7 +762,6 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
switch ($action) {
case 'change':
case 'history':
case 'graph':
case 'blame':
case 'browse':
case 'document':