From 16802117021816a7b40df8a5e0ef9ad483fc72ad Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 9 Apr 2018 10:06:42 -0700 Subject: [PATCH] Remove dead "Service Lock" code from Almanac Summary: Depends on D19315. Ref T13120. Ref T12414. See PHI145. See PHI473. I want to move Almanac services to ModularTransactions but ran into this old piece of dead/unused code along the way. Long ago, Almanac services could be individually "locked", but this didn't really work out very well. It was replaced by "Can Manage Cluster Services" in D15339 and prior changes, but not all of the old "Lock" code got cleaned up. I don't expect to restore this feature, so clean it up now. Test Plan: - Grepped for `AlmanacServiceTransaction::TYPE_LOCK`, `TYPE_LOCK`, etc. - Grepped for `updateServiceLock()`, no callsites. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13120, T12414 Differential Revision: https://secure.phabricator.com/D19316 --- .../management/AlmanacManagementWorkflow.php | 16 ---------------- .../storage/AlmanacServiceTransaction.php | 12 ------------ 2 files changed, 28 deletions(-) diff --git a/src/applications/almanac/management/AlmanacManagementWorkflow.php b/src/applications/almanac/management/AlmanacManagementWorkflow.php index 0f1dd6d773..5d466293c4 100644 --- a/src/applications/almanac/management/AlmanacManagementWorkflow.php +++ b/src/applications/almanac/management/AlmanacManagementWorkflow.php @@ -26,20 +26,4 @@ abstract class AlmanacManagementWorkflow return $services; } - protected function updateServiceLock(AlmanacService $service, $lock) { - $almanac_phid = id(new PhabricatorAlmanacApplication())->getPHID(); - - $xaction = id(new AlmanacServiceTransaction()) - ->setTransactionType(AlmanacServiceTransaction::TYPE_LOCK) - ->setNewValue((int)$lock); - - $editor = id(new AlmanacServiceEditor()) - ->setActor($this->getViewer()) - ->setActingAsPHID($almanac_phid) - ->setContentSource($this->newContentSource()) - ->setContinueOnMissingFields(true); - - $editor->applyTransactions($service, array($xaction)); - } - } diff --git a/src/applications/almanac/storage/AlmanacServiceTransaction.php b/src/applications/almanac/storage/AlmanacServiceTransaction.php index a668f860fa..d357641cb6 100644 --- a/src/applications/almanac/storage/AlmanacServiceTransaction.php +++ b/src/applications/almanac/storage/AlmanacServiceTransaction.php @@ -4,7 +4,6 @@ final class AlmanacServiceTransaction extends AlmanacTransaction { const TYPE_NAME = 'almanac:service:name'; - const TYPE_LOCK = 'almanac:service:lock'; public function getApplicationTransactionType() { return AlmanacServicePHIDType::TYPECONST; @@ -30,17 +29,6 @@ final class AlmanacServiceTransaction $new); } break; - case self::TYPE_LOCK: - if ($new) { - return pht( - '%s locked this service.', - $this->renderHandleLink($author_phid)); - } else { - return pht( - '%s unlocked this service.', - $this->renderHandleLink($author_phid)); - } - break; } return parent::getTitle();