Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/view/DiffusionHistoryTableView.php
Show All 30 Lines | final class DiffusionHistoryTableView extends DiffusionView { | ||||
} | } | ||||
public function setHandles(array $handles) { | public function setHandles(array $handles) { | ||||
assert_instances_of($handles, 'PhabricatorObjectHandle'); | assert_instances_of($handles, 'PhabricatorObjectHandle'); | ||||
$this->handles = $handles; | $this->handles = $handles; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getRequiredHandlePHIDs() { | private function getRequiredHandlePHIDs() { | ||||
$phids = array(); | $phids = array(); | ||||
foreach ($this->history as $item) { | foreach ($this->history as $item) { | ||||
$data = $item->getCommitData(); | $data = $item->getCommitData(); | ||||
if ($data) { | if ($data) { | ||||
if ($data->getCommitDetail('authorPHID')) { | if ($data->getCommitDetail('authorPHID')) { | ||||
$phids[$data->getCommitDetail('authorPHID')] = true; | $phids[$data->getCommitDetail('authorPHID')] = true; | ||||
} | } | ||||
if ($data->getCommitDetail('committerPHID')) { | if ($data->getCommitDetail('committerPHID')) { | ||||
Show All 34 Lines | public function loadBuildablesOnDemand() { | ||||
$this->buildCache = mpull($buildables, null, 'getBuildablePHID'); | $this->buildCache = mpull($buildables, null, 'getBuildablePHID'); | ||||
return $this->buildCache; | return $this->buildCache; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
$drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
$handles = $this->handles; | $viewer = $this->getUser(); | ||||
$handles = $viewer->loadHandles($this->getRequiredHandlePHIDs()); | |||||
$graph = null; | $graph = null; | ||||
if ($this->parents) { | if ($this->parents) { | ||||
$graph = $this->renderGraph(); | $graph = $this->renderGraph(); | ||||
} | } | ||||
$show_builds = PhabricatorApplication::isClassInstalledForViewer( | $show_builds = PhabricatorApplication::isClassInstalledForViewer( | ||||
'PhabricatorHarbormasterApplication', | 'PhabricatorHarbormasterApplication', | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | foreach ($this->history as $history) { | ||||
$tooltip_view); | $tooltip_view); | ||||
$build = $href_view; | $build = $href_view; | ||||
$has_any_build = true; | $has_any_build = true; | ||||
} | } | ||||
} | } | ||||
$browse = $this->linkBrowse( | |||||
$history->getPath(), | |||||
array( | |||||
'commit' => $history->getCommitIdentifier(), | |||||
'branch' => $drequest->getBranch(), | |||||
'type' => $history->getFileType(), | |||||
)); | |||||
$rows[] = array( | $rows[] = array( | ||||
$graph ? $graph[$ii++] : null, | $graph ? $graph[$ii++] : null, | ||||
$browse, | |||||
self::linkCommit( | self::linkCommit( | ||||
$drequest->getRepository(), | $drequest->getRepository(), | ||||
$history->getCommitIdentifier()), | $history->getCommitIdentifier()), | ||||
$build, | $build, | ||||
($commit ? | ($commit ? | ||||
self::linkRevision(idx($this->revisions, $commit->getPHID())) : | self::linkRevision(idx($this->revisions, $commit->getPHID())) : | ||||
null), | null), | ||||
$author, | $author, | ||||
$summary, | $summary, | ||||
$date, | $date, | ||||
$time, | $time, | ||||
); | ); | ||||
} | } | ||||
$view = new AphrontTableView($rows); | $view = new AphrontTableView($rows); | ||||
$view->setHeaders( | $view->setHeaders( | ||||
array( | array( | ||||
'', | null, | ||||
null, | |||||
pht('Commit'), | pht('Commit'), | ||||
'', | null, | ||||
pht('Revision'), | pht('Revision'), | ||||
pht('Author/Committer'), | pht('Author/Committer'), | ||||
pht('Details'), | pht('Details'), | ||||
pht('Date'), | pht('Date'), | ||||
pht('Time'), | pht('Time'), | ||||
)); | )); | ||||
$view->setColumnClasses( | $view->setColumnClasses( | ||||
array( | array( | ||||
'threads', | 'threads', | ||||
'nudgeright', | |||||
'n', | 'n', | ||||
'icon', | 'icon', | ||||
'n', | 'n', | ||||
'', | '', | ||||
'wide', | 'wide', | ||||
'', | '', | ||||
'right', | 'right', | ||||
)); | )); | ||||
$view->setColumnVisibility( | $view->setColumnVisibility( | ||||
array( | array( | ||||
$graph ? true : false, | $graph ? true : false, | ||||
)); | )); | ||||
$view->setDeviceVisibility( | $view->setDeviceVisibility( | ||||
array( | array( | ||||
$graph ? true : false, | $graph ? true : false, | ||||
true, | true, | ||||
true, | true, | ||||
true, | true, | ||||
true, | |||||
false, | false, | ||||
true, | true, | ||||
false, | false, | ||||
false, | false, | ||||
)); | )); | ||||
return $view->render(); | return $view->render(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |