From 5e606504b7f5ba38f3abec95c8761f728b2f1f8b Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 16 Dec 2016 07:25:47 -0800 Subject: [PATCH] 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 --- src/__phutil_library_map__.php | 2 - .../PhabricatorDifferentialConfigOptions.php | 1 - .../customfield/DifferentialProjectsField.php | 110 ------------------ 3 files changed, 113 deletions(-) delete mode 100644 src/applications/differential/customfield/DifferentialProjectsField.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 540f7a20d7..4a8e92ffbc 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index 374b572f87..9872ac3ef3 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -33,7 +33,6 @@ final class PhabricatorDifferentialConfigOptions new DifferentialReviewedByField(), new DifferentialSubscribersField(), new DifferentialRepositoryField(), - new DifferentialProjectsField(), new DifferentialViewPolicyField(), new DifferentialManiphestTasksField(), diff --git a/src/applications/differential/customfield/DifferentialProjectsField.php b/src/applications/differential/customfield/DifferentialProjectsField.php deleted file mode 100644 index dc126ef8dc..0000000000 --- a/src/applications/differential/customfield/DifferentialProjectsField.php +++ /dev/null @@ -1,110 +0,0 @@ -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, - )); - } - -}