From 58b622852f37de95b9e92d20775ed2757928afde Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 6 Aug 2015 18:44:54 -0700 Subject: [PATCH] Fix Up Paste transactions Summary: We're using the wrong constants here, bad copy and paste job. Also add colors, icons. Test Plan: Archive a Paste, check transactions. Reviewers: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13817 --- .../storage/PhabricatorPasteTransaction.php | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/applications/paste/storage/PhabricatorPasteTransaction.php b/src/applications/paste/storage/PhabricatorPasteTransaction.php index 54b712ebee..d6b962298b 100644 --- a/src/applications/paste/storage/PhabricatorPasteTransaction.php +++ b/src/applications/paste/storage/PhabricatorPasteTransaction.php @@ -55,6 +55,15 @@ final class PhabricatorPasteTransaction case self::TYPE_LANGUAGE: return 'fa-pencil'; break; + case self::TYPE_STATUS: + $new = $this->getNewValue(); + switch ($new) { + case PhabricatorPaste::STATUS_ACTIVE: + return 'fa-check'; + case PhabricatorPaste::STATUS_ARCHIVED: + return 'fa-ban'; + } + break; } return parent::getIcon(); } @@ -91,9 +100,16 @@ final class PhabricatorPasteTransaction $this->renderHandleLink($author_phid)); break; case self::TYPE_STATUS: - return pht( - "%s updated the paste's status.", - $this->renderHandleLink($author_phid)); + switch ($new) { + case PhabricatorPaste::STATUS_ACTIVE: + return pht( + '%s activated this paste.', + $this->renderHandleLink($author_phid)); + case PhabricatorPaste::STATUS_ARCHIVED: + return pht( + '%s archived this paste.', + $this->renderHandleLink($author_phid)); + } break; } @@ -161,6 +177,14 @@ final class PhabricatorPasteTransaction switch ($this->getTransactionType()) { case self::TYPE_CONTENT: return PhabricatorTransactions::COLOR_GREEN; + case self::TYPE_STATUS: + switch ($new) { + case PhabricatorPaste::STATUS_ACTIVE: + return 'green'; + case PhabricatorPaste::STATUS_ARCHIVED: + return 'indigo'; + } + break; } return parent::getColor(); -- 2.51.2