mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 21:10: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:
parent
71ef48b3e5
commit
c7f5dc0208
13 changed files with 14 additions and 59 deletions
|
@ -3,27 +3,15 @@
|
||||||
final class ReleephAuthorFieldSpecification
|
final class ReleephAuthorFieldSpecification
|
||||||
extends ReleephFieldSpecification {
|
extends ReleephFieldSpecification {
|
||||||
|
|
||||||
private static $authorMap = array();
|
|
||||||
|
|
||||||
public function getFieldKey() {
|
public function getFieldKey() {
|
||||||
return 'author';
|
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() {
|
public function getName() {
|
||||||
return 'Author';
|
return 'Author';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$pull = $this->getReleephRequest();
|
$pull = $this->getReleephRequest();
|
||||||
$commit = $pull->loadPhabricatorRepositoryCommit();
|
$commit = $pull->loadPhabricatorRepositoryCommit();
|
||||||
if (!$commit) {
|
if (!$commit) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class ReleephBranchCommitFieldSpecification
|
||||||
return 'Commit';
|
return 'Commit';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$rr = $this->getReleephRequest();
|
$rr = $this->getReleephRequest();
|
||||||
if (!$rr->getInBranch()) {
|
if (!$rr->getInBranch()) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -10,7 +10,7 @@ final class ReleephDependsOnFieldSpecification
|
||||||
return pht('Depends On');
|
return pht('Depends On');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$revision_phids = $this->getDependentRevisionPHIDs();
|
$revision_phids = $this->getDependentRevisionPHIDs();
|
||||||
if (!$revision_phids) {
|
if (!$revision_phids) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -16,7 +16,7 @@ final class ReleephDiffChurnFieldSpecification
|
||||||
return 'Churn';
|
return 'Churn';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
|
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
|
||||||
if (!$diff_rev) {
|
if (!$diff_rev) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -11,15 +11,11 @@ final class ReleephDiffMessageFieldSpecification
|
||||||
return 'Message';
|
return 'Message';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForHeaderView() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getStyleForPropertyView() {
|
public function getStyleForPropertyView() {
|
||||||
return 'block';
|
return 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* While this class could take advantage of bulkLoad(), in practice
|
|
||||||
* loadRelatives fixes all that for us.
|
|
||||||
*/
|
|
||||||
final class ReleephDiffSizeFieldSpecification
|
final class ReleephDiffSizeFieldSpecification
|
||||||
extends ReleephFieldSpecification {
|
extends ReleephFieldSpecification {
|
||||||
|
|
||||||
|
@ -19,7 +15,7 @@ final class ReleephDiffSizeFieldSpecification
|
||||||
return 'Size';
|
return 'Size';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
|
$diff_rev = $this->getReleephRequest()->loadDifferentialRevision();
|
||||||
if (!$diff_rev) {
|
if (!$diff_rev) {
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -22,7 +22,8 @@ abstract class ReleephFieldSpecification
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderPropertyViewValue(array $handles) {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$value = $this->renderValueForHeaderView();
|
$key = $this->getRequiredStorageKey();
|
||||||
|
$value = $this->getReleephRequest()->getDetail($key);
|
||||||
if ($value === '') {
|
if ($value === '') {
|
||||||
return null;
|
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 )------------------------------------------------------------ */
|
/* -( Conduit )------------------------------------------------------------ */
|
||||||
|
|
||||||
public function getKeyForConduit() {
|
public function getKeyForConduit() {
|
||||||
|
@ -199,12 +184,6 @@ abstract class ReleephFieldSpecification
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -( Bulk loading )------------------------------------------------------- */
|
|
||||||
|
|
||||||
public function bulkLoad(array $releeph_requests) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -( Commit Messages )---------------------------------------------------- */
|
/* -( Commit Messages )---------------------------------------------------- */
|
||||||
|
|
||||||
public function shouldAppearOnCommitMessage() {
|
public function shouldAppearOnCommitMessage() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class ReleephIntentFieldSpecification
|
||||||
return 'Intent';
|
return 'Intent';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$pull = $this->getReleephRequest();
|
$pull = $this->getReleephRequest();
|
||||||
|
|
||||||
$intents = $pull->getUserIntents();
|
$intents = $pull->getUserIntents();
|
||||||
|
|
|
@ -23,7 +23,7 @@ abstract class ReleephLevelFieldSpecification
|
||||||
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
|
throw new PhabricatorCustomFieldImplementationIncompleteException($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
return $this->getNameForLevel($this->getValue());
|
return $this->getNameForLevel($this->getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class ReleephOriginalCommitFieldSpecification
|
||||||
return 'Commit';
|
return 'Commit';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$pull = $this->getReleephRequest();
|
$pull = $this->getReleephRequest();
|
||||||
return $this->slowlyLoadHandle($pull->getRequestCommitPHID())->renderLink();
|
return $this->slowlyLoadHandle($pull->getRequestCommitPHID())->renderLink();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,15 +19,11 @@ final class ReleephReasonFieldSpecification
|
||||||
return 'block';
|
return 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderLabelForHeaderView() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIconForPropertyView() {
|
public function getIconForPropertyView() {
|
||||||
return PHUIPropertyListView::ICON_SUMMARY;
|
return PHUIPropertyListView::ICON_SUMMARY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
return phutil_tag(
|
return phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class ReleephRequestorFieldSpecification
|
||||||
return 'Requestor';
|
return 'Requestor';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$phid = $this->getReleephRequest()->getRequestUserPHID();
|
$phid = $this->getReleephRequest()->getRequestUserPHID();
|
||||||
$handle = id(new PhabricatorHandleQuery())
|
$handle = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->getUser())
|
->setViewer($this->getUser())
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class ReleephRevisionFieldSpecification
|
||||||
return 'Revision';
|
return 'Revision';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderValueForHeaderView() {
|
public function renderPropertyViewValue(array $handles) {
|
||||||
$phid = $this
|
$phid = $this
|
||||||
->getReleephRequest()
|
->getReleephRequest()
|
||||||
->loadRequestCommitDiffPHID();
|
->loadRequestCommitDiffPHID();
|
||||||
|
|
Loading…
Reference in a new issue