From a7bd58c4bb2635c639b8e0c27c2305d5164fd6b9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 3 Feb 2021 15:00:54 -0800 Subject: [PATCH] Remove "AlmanacPropertyInterface" from "AlmanacNamespace" Summary: See . Almanac namespaces have never really had property support, but they implemented the interface in the original implementation. At the time, this had no effect. Later changes integrated properties into the edit flows and broke this no-op integration. Remove the interface for now. They could be given property support later, but need a bit of support code. This feature is very rarely used and primarily useful for Phacility instances. Test Plan: Created new namespaces and edited namespaces, browsed namespace UI. Differential Revision: https://secure.phabricator.com/D21543 --- src/__phutil_library_map__.php | 1 - .../almanac/storage/AlmanacNamespace.php | 53 +------------------ 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 04b483070f..8af718e70b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -6115,7 +6115,6 @@ phutil_register_library_map(array( 'PhabricatorPolicyInterface', 'PhabricatorApplicationTransactionInterface', 'PhabricatorProjectInterface', - 'AlmanacPropertyInterface', 'PhabricatorDestructibleInterface', 'PhabricatorNgramsInterface', 'PhabricatorConduitResultInterface', diff --git a/src/applications/almanac/storage/AlmanacNamespace.php b/src/applications/almanac/storage/AlmanacNamespace.php index 128cfdb72e..f3745b1d29 100644 --- a/src/applications/almanac/storage/AlmanacNamespace.php +++ b/src/applications/almanac/storage/AlmanacNamespace.php @@ -6,7 +6,6 @@ final class AlmanacNamespace PhabricatorPolicyInterface, PhabricatorApplicationTransactionInterface, PhabricatorProjectInterface, - AlmanacPropertyInterface, PhabricatorDestructibleInterface, PhabricatorNgramsInterface, PhabricatorConduitResultInterface { @@ -17,13 +16,10 @@ final class AlmanacNamespace protected $viewPolicy; protected $editPolicy; - private $almanacProperties = self::ATTACHABLE; - public static function initializeNewNamespace() { return id(new self()) ->setViewPolicy(PhabricatorPolicies::POLICY_USER) - ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) - ->attachAlmanacProperties(array()); + ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN); } protected function getConfiguration() { @@ -113,53 +109,6 @@ final class AlmanacNamespace } -/* -( AlmanacPropertyInterface )------------------------------------------- */ - - - public function attachAlmanacProperties(array $properties) { - assert_instances_of($properties, 'AlmanacProperty'); - $this->almanacProperties = mpull($properties, null, 'getFieldName'); - return $this; - } - - public function getAlmanacProperties() { - return $this->assertAttached($this->almanacProperties); - } - - public function hasAlmanacProperty($key) { - $this->assertAttached($this->almanacProperties); - return isset($this->almanacProperties[$key]); - } - - public function getAlmanacProperty($key) { - return $this->assertAttachedKey($this->almanacProperties, $key); - } - - public function getAlmanacPropertyValue($key, $default = null) { - if ($this->hasAlmanacProperty($key)) { - return $this->getAlmanacProperty($key)->getFieldValue(); - } else { - return $default; - } - } - - public function getAlmanacPropertyFieldSpecifications() { - return array(); - } - - public function newAlmanacPropertyEditEngine() { - throw new PhutilMethodNotImplementedException(); - } - - public function getAlmanacPropertySetTransactionType() { - throw new PhutilMethodNotImplementedException(); - } - - public function getAlmanacPropertyDeleteTransactionType() { - throw new PhutilMethodNotImplementedException(); - } - - /* -( PhabricatorPolicyInterface )----------------------------------------- */