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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user