diff --git a/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php b/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php index 3974851c0d..63121813bb 100644 --- a/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php +++ b/src/applications/harbormaster/editor/HarbormasterBuildableTransactionEditor.php @@ -1,76 +1,70 @@ getTransactionType()) { - case HarbormasterBuildableTransaction::TYPE_CREATE: case HarbormasterBuildableTransaction::TYPE_COMMAND: return null; } return parent::getCustomTransactionOldValue($object, $xaction); } protected function getCustomTransactionNewValue( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { - case HarbormasterBuildableTransaction::TYPE_CREATE: - return true; case HarbormasterBuildableTransaction::TYPE_COMMAND: return $xaction->getNewValue(); } return parent::getCustomTransactionNewValue($object, $xaction); } protected function applyCustomInternalTransaction( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { - case HarbormasterBuildableTransaction::TYPE_CREATE: case HarbormasterBuildableTransaction::TYPE_COMMAND: return; } return parent::applyCustomInternalTransaction($object, $xaction); } protected function applyCustomExternalTransaction( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { - case HarbormasterBuildableTransaction::TYPE_CREATE: case HarbormasterBuildableTransaction::TYPE_COMMAND: return; } return parent::applyCustomExternalTransaction($object, $xaction); } } diff --git a/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php b/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php index 0d7ab76e19..a4a2f1ab14 100644 --- a/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php +++ b/src/applications/harbormaster/storage/HarbormasterBuildableTransaction.php @@ -1,93 +1,84 @@ getAuthorPHID(); $old = $this->getOldValue(); $new = $this->getNewValue(); switch ($this->getTransactionType()) { - case self::TYPE_CREATE: - return pht( - '%s created this buildable.', - $this->renderHandleLink($author_phid)); case self::TYPE_COMMAND: switch ($new) { case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE: return pht( '%s restarted this buildable.', $this->renderHandleLink($author_phid)); case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE: return pht( '%s resumed this buildable.', $this->renderHandleLink($author_phid)); case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: return pht( '%s paused this buildable.', $this->renderHandleLink($author_phid)); case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE: return pht( '%s aborted this buildable.', $this->renderHandleLink($author_phid)); } } return parent::getTitle(); } public function getIcon() { $author_phid = $this->getAuthorPHID(); $old = $this->getOldValue(); $new = $this->getNewValue(); switch ($this->getTransactionType()) { - case self::TYPE_CREATE: - return 'fa-plus'; case self::TYPE_COMMAND: switch ($new) { case HarbormasterBuildMessageRestartTransaction::MESSAGETYPE: return 'fa-backward'; case HarbormasterBuildMessageResumeTransaction::MESSAGETYPE: return 'fa-play'; case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: return 'fa-pause'; case HarbormasterBuildMessageAbortTransaction::MESSAGETYPE: return 'fa-exclamation-triangle'; } } return parent::getIcon(); } public function getColor() { $author_phid = $this->getAuthorPHID(); $old = $this->getOldValue(); $new = $this->getNewValue(); switch ($this->getTransactionType()) { - case self::TYPE_CREATE: - return 'green'; case self::TYPE_COMMAND: switch ($new) { case HarbormasterBuildMessagePauseTransaction::MESSAGETYPE: return 'red'; } } return parent::getColor(); } }