From 7a6f4ab75a1fcf9e49b19b9ae4a3614304410f47 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Fri, 9 Jan 2015 06:47:16 -0800 Subject: [PATCH] T6594, Logged out users should see "View Raw" in dropdown of timeline items Summary: Fixes T6594, Logged out users should be able to "View Raw" comments in public objects. Test Plan: Log out, open maniphest task with comments, open dropdown associated with comment, click "View Raw", should be able to see raw comment. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T6594 Differential Revision: https://secure.phabricator.com/D11295 --- ...orApplicationTransactionCommentRawController.php | 4 ++++ .../view/PhabricatorApplicationTransactionView.php | 2 ++ src/view/phui/PHUITimelineEventView.php | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php index 475b0196ca..a4a68259fa 100644 --- a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php +++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php @@ -85,4 +85,8 @@ final class PhabricatorApplicationTransactionCommentRawController return id(new AphrontDialogResponse())->setDialog($dialog); } + public function shouldAllowPublic() { + return true; + } + } diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php index 8cb6e97390..aef52384cc 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -451,6 +451,8 @@ class PhabricatorApplicationTransactionView extends AphrontView { $event->setIsEdited(true); } + $event->setIsNormalComment(true); + // If we have a place for quoted text to go and this is a quotable // comment, pass the quote target ID to the event view. if ($this->getQuoteTargetID()) { diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php index ff53875bac..561fd1e6d8 100644 --- a/src/view/phui/PHUITimelineEventView.php +++ b/src/view/phui/PHUITimelineEventView.php @@ -22,6 +22,7 @@ final class PHUITimelineEventView extends AphrontView { private $token; private $tokenRemoved; private $quoteTargetID; + private $isNormalComment; private $quoteRef; private $reallyMajorEvent; @@ -43,6 +44,15 @@ final class PHUITimelineEventView extends AphrontView { return $this->quoteTargetID; } + public function setIsNormalComment($is_normal_comment) { + $this->isNormalComment = $is_normal_comment; + return $this; + } + + public function getIsNormalComment() { + return $this->isNormalComment; + } + public function setHideByDefault($hide_by_default) { $this->hideByDefault = $hide_by_default; return $this; @@ -547,8 +557,9 @@ final class PHUITimelineEventView extends AphrontView { 'uri' => '/transactions/quote/'.$xaction_phid.'/', 'ref' => $ref, )); + } - // if there is something to quote then there is something to view raw + if ($this->getIsNormalComment()) { $items[] = id(new PhabricatorActionView()) ->setIcon('fa-cutlery') ->setHref('/transactions/raw/'.$xaction_phid.'/')