mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 20:02:40 +01:00
7cab903943
Summary: Modernize Differential edges to subclass `PhabricatorEdgeType`. Largely based on D11045. Test Plan: From previous experience, these changes are fairly trivial and safe. I poked around a little to make sure things looked reasonably okay. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, Krenair, epriestley Differential Revision: https://secure.phabricator.com/D11074
62 lines
1.4 KiB
PHP
62 lines
1.4 KiB
PHP
<?php
|
|
|
|
final class DifferentialDependsOnField
|
|
extends DifferentialCustomField {
|
|
|
|
public function getFieldKey() {
|
|
return 'differential:depends-on';
|
|
}
|
|
|
|
public function getFieldKeyForConduit() {
|
|
return 'phabricator:depends-on';
|
|
}
|
|
|
|
public function getFieldName() {
|
|
return pht('Depends On');
|
|
}
|
|
|
|
public function canDisableField() {
|
|
return false;
|
|
}
|
|
|
|
public function getFieldDescription() {
|
|
return pht('Lists revisions this one depends on.');
|
|
}
|
|
|
|
public function shouldAppearInPropertyView() {
|
|
return true;
|
|
}
|
|
|
|
public function renderPropertyViewLabel() {
|
|
return $this->getFieldName();
|
|
}
|
|
|
|
public function getRequiredHandlePHIDsForPropertyView() {
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
$this->getObject()->getPHID(),
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST);
|
|
}
|
|
|
|
public function renderPropertyViewValue(array $handles) {
|
|
return $this->renderHandleList($handles);
|
|
}
|
|
|
|
public function getProTips() {
|
|
return array(
|
|
pht(
|
|
'Create a dependency between revisions by writing '.
|
|
'"Depends on D123" in your summary.'),
|
|
);
|
|
}
|
|
|
|
public function shouldAppearInConduitDictionary() {
|
|
return true;
|
|
}
|
|
|
|
public function getConduitDictionaryValue() {
|
|
return PhabricatorEdgeQuery::loadDestinationPHIDs(
|
|
$this->getObject()->getPHID(),
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST);
|
|
}
|
|
|
|
}
|