Introduce "DiffusionCommitGraphView", which unifies "HistoryListView" and "HistoryTableView"

Summary:
Ref T13552. Currently, commit lists are sometimes rendered as an object list and sometimes rendered as a table. There are two separate views for table rendering.

Add a fourth view ("list, with a graph") with the eventual intent of unifying all the other views. For now, this only replaces "HistoryListView" -- and needs some more work to really be a convincing replacement.

Test Plan:
  - Looked at "History" in Diffusion, saw an ugly view with all the information we want.
  - Grepped for "HistoryListView", no hits.

Maniphest Tasks: T13552

Differential Revision: https://secure.phabricator.com/D21410
This commit is contained in:
epriestley
2020-07-10 11:15:41 -07:00
parent c6de7c66a3
commit 46695c76eb
4 changed files with 440 additions and 176 deletions

View File

@@ -35,10 +35,31 @@ final class DiffusionHistoryController extends DiffusionController {
$history = $pager->sliceResults($history);
$history_list = id(new DiffusionHistoryListView())
$identifiers = array();
foreach ($history as $item) {
$identifiers[] = $item->getCommitIdentifier();
}
if ($identifiers) {
$commits = id(new DiffusionCommitQuery())
->setViewer($viewer)
->withRepositoryPHIDs(array($repository->getPHID()))
->withIdentifiers($identifiers)
->needCommitData(true)
->needIdentities(true)
->execute();
} else {
$commits = array();
}
$history_list = id(new DiffusionCommitGraphView())
->setViewer($viewer)
->setParents($history_results['parents'])
->setIsHead(!$pager->getOffset())
->setIsTail(!$pager->getHasMorePages())
->setDiffusionRequest($drequest)
->setHistory($history);
->setHistory($history)
->setCommits($commits);
$header = $this->buildHeader($drequest);