mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02: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:
parent
9afc5c6287
commit
c6de7c66a3
5 changed files with 0 additions and 129 deletions
|
@ -861,7 +861,6 @@ phutil_register_library_map(array(
|
||||||
'DiffusionGitWireProtocolCapabilities' => 'applications/diffusion/protocol/DiffusionGitWireProtocolCapabilities.php',
|
'DiffusionGitWireProtocolCapabilities' => 'applications/diffusion/protocol/DiffusionGitWireProtocolCapabilities.php',
|
||||||
'DiffusionGitWireProtocolRef' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRef.php',
|
'DiffusionGitWireProtocolRef' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRef.php',
|
||||||
'DiffusionGitWireProtocolRefList' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRefList.php',
|
'DiffusionGitWireProtocolRefList' => 'applications/diffusion/protocol/DiffusionGitWireProtocolRefList.php',
|
||||||
'DiffusionGraphController' => 'applications/diffusion/controller/DiffusionGraphController.php',
|
|
||||||
'DiffusionHistoryController' => 'applications/diffusion/controller/DiffusionHistoryController.php',
|
'DiffusionHistoryController' => 'applications/diffusion/controller/DiffusionHistoryController.php',
|
||||||
'DiffusionHistoryListView' => 'applications/diffusion/view/DiffusionHistoryListView.php',
|
'DiffusionHistoryListView' => 'applications/diffusion/view/DiffusionHistoryListView.php',
|
||||||
'DiffusionHistoryQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php',
|
'DiffusionHistoryQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php',
|
||||||
|
@ -6955,7 +6954,6 @@ phutil_register_library_map(array(
|
||||||
'DiffusionGitWireProtocolCapabilities' => 'Phobject',
|
'DiffusionGitWireProtocolCapabilities' => 'Phobject',
|
||||||
'DiffusionGitWireProtocolRef' => 'Phobject',
|
'DiffusionGitWireProtocolRef' => 'Phobject',
|
||||||
'DiffusionGitWireProtocolRefList' => 'Phobject',
|
'DiffusionGitWireProtocolRefList' => 'Phobject',
|
||||||
'DiffusionGraphController' => 'DiffusionController',
|
|
||||||
'DiffusionHistoryController' => 'DiffusionController',
|
'DiffusionHistoryController' => 'DiffusionController',
|
||||||
'DiffusionHistoryListView' => 'DiffusionHistoryView',
|
'DiffusionHistoryListView' => 'DiffusionHistoryView',
|
||||||
'DiffusionHistoryQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
'DiffusionHistoryQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||||
|
|
|
@ -52,7 +52,6 @@ final class PhabricatorDiffusionApplication extends PhabricatorApplication {
|
||||||
'change/(?P<dblob>.*)' => 'DiffusionChangeController',
|
'change/(?P<dblob>.*)' => 'DiffusionChangeController',
|
||||||
'clone/' => 'DiffusionCloneController',
|
'clone/' => 'DiffusionCloneController',
|
||||||
'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
|
'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
|
||||||
'graph/(?P<dblob>.*)' => 'DiffusionGraphController',
|
|
||||||
'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
|
'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
|
||||||
'document/(?P<dblob>.*)'
|
'document/(?P<dblob>.*)'
|
||||||
=> 'DiffusionDocumentController',
|
=> 'DiffusionDocumentController',
|
||||||
|
|
|
@ -210,9 +210,6 @@ abstract class DiffusionController extends PhabricatorController {
|
||||||
case 'history':
|
case 'history':
|
||||||
$view_name = pht('History');
|
$view_name = pht('History');
|
||||||
break;
|
break;
|
||||||
case 'graph':
|
|
||||||
$view_name = pht('Graph');
|
|
||||||
break;
|
|
||||||
case 'browse':
|
case 'browse':
|
||||||
$view_name = pht('Browse');
|
$view_name = pht('Browse');
|
||||||
break;
|
break;
|
||||||
|
@ -553,17 +550,6 @@ abstract class DiffusionController extends PhabricatorController {
|
||||||
)))
|
)))
|
||||||
->setSelected($key == 'history'));
|
->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;
|
return $view;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -682,7 +682,6 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
||||||
$action = idx($params, 'action');
|
$action = idx($params, 'action');
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'history':
|
case 'history':
|
||||||
case 'graph':
|
|
||||||
case 'clone':
|
case 'clone':
|
||||||
case 'blame':
|
case 'blame':
|
||||||
case 'browse':
|
case 'browse':
|
||||||
|
@ -763,7 +762,6 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'change':
|
case 'change':
|
||||||
case 'history':
|
case 'history':
|
||||||
case 'graph':
|
|
||||||
case 'blame':
|
case 'blame':
|
||||||
case 'browse':
|
case 'browse':
|
||||||
case 'document':
|
case 'document':
|
||||||
|
|
Loading…
Reference in a new issue