mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Remove "DiffusionTagTableView"
Summary: Ref T13552. This older class has no callers; tag and branch listings were replaced with an "ObjectList" view. Test Plan: Grepped for "DiffusionTagTableView", got no hits. Maniphest Tasks: T13552 Differential Revision: https://secure.phabricator.com/D21407
This commit is contained in:
parent
60e9f64190
commit
c8a279957d
2 changed files with 0 additions and 142 deletions
|
@ -1063,7 +1063,6 @@ phutil_register_library_map(array(
|
|||
'DiffusionSyncLogSearchEngine' => 'applications/diffusion/query/DiffusionSyncLogSearchEngine.php',
|
||||
'DiffusionTagListController' => 'applications/diffusion/controller/DiffusionTagListController.php',
|
||||
'DiffusionTagListView' => 'applications/diffusion/view/DiffusionTagListView.php',
|
||||
'DiffusionTagTableView' => 'applications/diffusion/view/DiffusionTagTableView.php',
|
||||
'DiffusionTaggedRepositoriesFunctionDatasource' => 'applications/diffusion/typeahead/DiffusionTaggedRepositoriesFunctionDatasource.php',
|
||||
'DiffusionTagsQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionTagsQueryConduitAPIMethod.php',
|
||||
'DiffusionURIEditConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionURIEditConduitAPIMethod.php',
|
||||
|
@ -7157,7 +7156,6 @@ phutil_register_library_map(array(
|
|||
'DiffusionSyncLogSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||
'DiffusionTagListController' => 'DiffusionController',
|
||||
'DiffusionTagListView' => 'DiffusionView',
|
||||
'DiffusionTagTableView' => 'DiffusionView',
|
||||
'DiffusionTaggedRepositoriesFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||
'DiffusionTagsQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionURIEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class DiffusionTagTableView extends DiffusionView {
|
||||
|
||||
private $tags;
|
||||
private $commits = array();
|
||||
private $handles = array();
|
||||
|
||||
public function setTags($tags) {
|
||||
$this->tags = $tags;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCommits(array $commits) {
|
||||
$this->commits = mpull($commits, null, 'getCommitIdentifier');
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setHandles(array $handles) {
|
||||
$this->handles = $handles;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDs() {
|
||||
return array_filter(mpull($this->commits, 'getAuthorPHID'));
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$buildables = $this->loadBuildables($this->commits);
|
||||
$has_builds = false;
|
||||
|
||||
$rows = array();
|
||||
foreach ($this->tags as $tag) {
|
||||
$commit = idx($this->commits, $tag->getCommitIdentifier());
|
||||
|
||||
$tag_link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $drequest->generateURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'commit' => $tag->getName(),
|
||||
)),
|
||||
),
|
||||
$tag->getName());
|
||||
|
||||
$commit_link = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $drequest->generateURI(
|
||||
array(
|
||||
'action' => 'commit',
|
||||
'commit' => $tag->getCommitIdentifier(),
|
||||
)),
|
||||
),
|
||||
$repository->formatCommitName(
|
||||
$tag->getCommitIdentifier()));
|
||||
|
||||
$author = null;
|
||||
if ($commit && $commit->getAuthorPHID()) {
|
||||
$author = $this->handles[$commit->getAuthorPHID()]->renderLink();
|
||||
} else if ($commit && $commit->getCommitData()) {
|
||||
$author = self::renderName($commit->getCommitData()->getAuthorName());
|
||||
} else {
|
||||
$author = self::renderName($tag->getAuthor());
|
||||
}
|
||||
|
||||
$description = null;
|
||||
if ($tag->getType() == 'git/tag') {
|
||||
// In Git, a tag may be a "real" tag, or just a reference to a commit.
|
||||
// If it's a real tag, use the message on the tag, since this may be
|
||||
// unique data which isn't otherwise available.
|
||||
$description = $tag->getDescription();
|
||||
} else {
|
||||
if ($commit) {
|
||||
$description = $commit->getSummary();
|
||||
} else {
|
||||
$description = $tag->getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
$build = null;
|
||||
if ($commit) {
|
||||
$buildable = idx($buildables, $commit->getPHID());
|
||||
if ($buildable) {
|
||||
$build = $this->renderBuildable($buildable);
|
||||
$has_builds = true;
|
||||
}
|
||||
}
|
||||
|
||||
$history = $this->linkTagHistory($tag->getName());
|
||||
|
||||
$rows[] = array(
|
||||
$history,
|
||||
$tag_link,
|
||||
$commit_link,
|
||||
$build,
|
||||
$author,
|
||||
$description,
|
||||
$viewer->formatShortDateTime($tag->getEpoch()),
|
||||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
null,
|
||||
pht('Tag'),
|
||||
pht('Commit'),
|
||||
null,
|
||||
pht('Author'),
|
||||
pht('Description'),
|
||||
pht('Created'),
|
||||
))
|
||||
->setColumnClasses(
|
||||
array(
|
||||
'nudgeright',
|
||||
'pri',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'wide',
|
||||
'right',
|
||||
))
|
||||
->setColumnVisibility(
|
||||
array(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
$has_builds,
|
||||
));
|
||||
|
||||
return $table->render();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue