1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 13:00:56 +01:00

Remove some unused Releeph field methods

Summary: Ref T3718. Remove `bulkLoad()` and header-view rendering wrappers.

Test Plan: Viewed a request, looked the same. `grep`'d for stuff.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3718

Differential Revision: https://secure.phabricator.com/D8809
This commit is contained in:
epriestley 2014-04-18 17:52:22 -07:00
parent 71ef48b3e5
commit c7f5dc0208
13 changed files with 14 additions and 59 deletions

View file

@ -3,27 +3,15 @@
final class ReleephAuthorFieldSpecification
extends ReleephFieldSpecification {
private static $authorMap = array();
public function getFieldKey() {
return 'author';
}
public function bulkLoad(array $releeph_requests) {
foreach ($releeph_requests as $releeph_request) {
$commit = $releeph_request->loadPhabricatorRepositoryCommit();
if ($commit) {
$author_phid = $commit->getAuthorPHID();
self::$authorMap[$releeph_request->getPHID()] = $author_phid;
}
}
}
public function getName() {
return 'Author';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$pull = $this->getReleephRequest();
$commit = $pull->loadPhabricatorRepositoryCommit();
if (!$commit) {

View file

@ -11,7 +11,7 @@ final class ReleephBranchCommitFieldSpecification
return 'Commit';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$rr = $this->getReleephRequest();
if (!$rr->getInBranch()) {
return null;

View file

@ -10,7 +10,7 @@ final class ReleephDependsOnFieldSpecification
return pht('Depends On');
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$revision_phids = $this->getDependentRevisionPHIDs();
if (!$revision_phids) {
return null;

View file

@ -16,7 +16,7 @@ final class ReleephDiffChurnFieldSpecification
return 'Churn';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
if (!$diff_rev) {
return null;

View file

@ -11,15 +11,11 @@ final class ReleephDiffMessageFieldSpecification
return 'Message';
}
public function renderLabelForHeaderView() {
return null;
}
public function getStyleForPropertyView() {
return 'block';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
return phutil_tag(
'div',
array(

View file

@ -1,9 +1,5 @@
<?php
/**
* While this class could take advantage of bulkLoad(), in practice
* loadRelatives fixes all that for us.
*/
final class ReleephDiffSizeFieldSpecification
extends ReleephFieldSpecification {
@ -19,7 +15,7 @@ final class ReleephDiffSizeFieldSpecification
return 'Size';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
if (!$diff_rev) {
return '';

View file

@ -22,7 +22,8 @@ abstract class ReleephFieldSpecification
}
public function renderPropertyViewValue(array $handles) {
$value = $this->renderValueForHeaderView();
$key = $this->getRequiredStorageKey();
$value = $this->getReleephRequest()->getDetail($key);
if ($value === '') {
return null;
}
@ -102,22 +103,6 @@ abstract class ReleephFieldSpecification
}
/* -( Header View )-------------------------------------------------------- */
/**
* Return a label for use in rendering the fields table. If you return null,
* the renderLabelForHeaderView data will span both columns.
*/
public function renderLabelForHeaderView() {
return $this->getName();
}
public function renderValueForHeaderView() {
$key = $this->getRequiredStorageKey();
return $this->getReleephRequest()->getDetail($key);
}
/* -( Conduit )------------------------------------------------------------ */
public function getKeyForConduit() {
@ -199,12 +184,6 @@ abstract class ReleephFieldSpecification
return $this->user;
}
/* -( Bulk loading )------------------------------------------------------- */
public function bulkLoad(array $releeph_requests) {
}
/* -( Commit Messages )---------------------------------------------------- */
public function shouldAppearOnCommitMessage() {

View file

@ -11,7 +11,7 @@ final class ReleephIntentFieldSpecification
return 'Intent';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$pull = $this->getReleephRequest();
$intents = $pull->getUserIntents();

View file

@ -23,7 +23,7 @@ abstract class ReleephLevelFieldSpecification
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
return $this->getNameForLevel($this->getValue());
}

View file

@ -11,7 +11,7 @@ final class ReleephOriginalCommitFieldSpecification
return 'Commit';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$pull = $this->getReleephRequest();
return $this->slowlyLoadHandle($pull->getRequestCommitPHID())->renderLink();
}

View file

@ -19,15 +19,11 @@ final class ReleephReasonFieldSpecification
return 'block';
}
public function renderLabelForHeaderView() {
return null;
}
public function getIconForPropertyView() {
return PHUIPropertyListView::ICON_SUMMARY;
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
return phutil_tag(
'div',
array(

View file

@ -11,7 +11,7 @@ final class ReleephRequestorFieldSpecification
return 'Requestor';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$phid = $this->getReleephRequest()->getRequestUserPHID();
$handle = id(new PhabricatorHandleQuery())
->setViewer($this->getUser())

View file

@ -11,7 +11,7 @@ final class ReleephRevisionFieldSpecification
return 'Revision';
}
public function renderValueForHeaderView() {
public function renderPropertyViewValue(array $handles) {
$phid = $this
->getReleephRequest()
->loadRequestCommitDiffPHID();