mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 21:10:56 +01:00
Remove "DifferentialProjectsField" custom field
Summary: Ref T11114. This is entirely obsoleted by EditEngine. Test Plan: Edited projects on a revision. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17078
This commit is contained in:
parent
8bba1eba85
commit
5e606504b7
3 changed files with 0 additions and 113 deletions
|
@ -478,7 +478,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialParseRenderTestCase' => 'applications/differential/__tests__/DifferentialParseRenderTestCase.php',
|
||||
'DifferentialPathField' => 'applications/differential/customfield/DifferentialPathField.php',
|
||||
'DifferentialProjectReviewersField' => 'applications/differential/customfield/DifferentialProjectReviewersField.php',
|
||||
'DifferentialProjectsField' => 'applications/differential/customfield/DifferentialProjectsField.php',
|
||||
'DifferentialQueryConduitAPIMethod' => 'applications/differential/conduit/DifferentialQueryConduitAPIMethod.php',
|
||||
'DifferentialQueryDiffsConduitAPIMethod' => 'applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php',
|
||||
'DifferentialRawDiffRenderer' => 'applications/differential/render/DifferentialRawDiffRenderer.php',
|
||||
|
@ -5131,7 +5130,6 @@ phutil_register_library_map(array(
|
|||
'DifferentialParseRenderTestCase' => 'PhabricatorTestCase',
|
||||
'DifferentialPathField' => 'DifferentialCustomField',
|
||||
'DifferentialProjectReviewersField' => 'DifferentialCustomField',
|
||||
'DifferentialProjectsField' => 'DifferentialCoreCustomField',
|
||||
'DifferentialQueryConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||
'DifferentialQueryDiffsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
|
||||
'DifferentialRawDiffRenderer' => 'Phobject',
|
||||
|
|
|
@ -33,7 +33,6 @@ final class PhabricatorDifferentialConfigOptions
|
|||
new DifferentialReviewedByField(),
|
||||
new DifferentialSubscribersField(),
|
||||
new DifferentialRepositoryField(),
|
||||
new DifferentialProjectsField(),
|
||||
new DifferentialViewPolicyField(),
|
||||
|
||||
new DifferentialManiphestTasksField(),
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialProjectsField
|
||||
extends DifferentialCoreCustomField {
|
||||
|
||||
public function getFieldKey() {
|
||||
return 'phabricator:projects';
|
||||
}
|
||||
|
||||
public function getFieldName() {
|
||||
return pht('Tags');
|
||||
}
|
||||
|
||||
public function getFieldDescription() {
|
||||
return pht('Tag projects.');
|
||||
}
|
||||
|
||||
public function shouldAppearInPropertyView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function shouldAppearInApplicationTransactions() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function readValueFromRevision(
|
||||
DifferentialRevision $revision) {
|
||||
if (!$revision->getPHID()) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||
$revision->getPHID(),
|
||||
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
|
||||
$projects = array_reverse($projects);
|
||||
|
||||
return $projects;
|
||||
}
|
||||
|
||||
public function getNewValueForApplicationTransactions() {
|
||||
return array('=' => array_fuse($this->getValue()));
|
||||
}
|
||||
|
||||
public function readValueFromRequest(AphrontRequest $request) {
|
||||
$this->setValue($request->getArr($this->getFieldKey()));
|
||||
}
|
||||
|
||||
public function renderEditControl(array $handles) {
|
||||
return id(new AphrontFormTokenizerControl())
|
||||
->setUser($this->getViewer())
|
||||
->setName($this->getFieldKey())
|
||||
->setDatasource(new PhabricatorProjectDatasource())
|
||||
->setValue($this->getValue())
|
||||
->setLabel($this->getFieldName());
|
||||
}
|
||||
|
||||
public function getApplicationTransactionType() {
|
||||
return PhabricatorTransactions::TYPE_EDGE;
|
||||
}
|
||||
|
||||
public function shouldAppearInCommitMessage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAllowEditInCommitMessage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldOverwriteWhenCommitMessageIsEdited() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getCommitMessageLabels() {
|
||||
return array(
|
||||
'Tags',
|
||||
'Project',
|
||||
'Projects',
|
||||
);
|
||||
}
|
||||
|
||||
public function getRequiredHandlePHIDsForCommitMessage() {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function renderCommitMessageValue(array $handles) {
|
||||
return $this->renderObjectList($handles);
|
||||
}
|
||||
|
||||
public function shouldAppearInConduitDictionary() {
|
||||
// To improve performance, we exclude this field from Conduit results.
|
||||
// See T11404 for discussion. In modern "differential.revision.search",
|
||||
// this information is available efficiently as an attachment.
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getApplicationTransactionMetadata() {
|
||||
return array(
|
||||
'edge:type' => PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
|
||||
);
|
||||
}
|
||||
|
||||
public function parseValueFromCommitMessage($value) {
|
||||
return $this->parseObjectList(
|
||||
$value,
|
||||
array(
|
||||
PhabricatorProjectProjectPHIDType::TYPECONST,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue