From dd0b09a610b39f7fb709c831169a094a7e72824f Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 4 Dec 2015 07:12:12 -0800 Subject: [PATCH] Make "Quote" work with EditEngine in Paste and Maniphest Summary: Ref T9132. This makes the "Quote" action on comments work properly in these applications. Test Plan: Quoted text in each application. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9132 Differential Revision: https://secure.phabricator.com/D14665 --- .../controller/ManiphestTaskDetailController.php | 3 +++ .../maniphest/editor/ManiphestEditEngine.php | 1 - .../controller/PhabricatorPasteViewController.php | 6 +++++- .../PhabricatorApplicationTransactionCommentView.php | 11 ++++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index 3d6c0df65d..886bbbadcf 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -143,6 +143,9 @@ final class ManiphestTaskDetailController extends ManiphestController { ->setViewer($viewer) ->buildEditEngineCommentView($task); + $timeline->setQuoteRef($monogram); + $comment_view->setTransactionTimeline($timeline); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php index a0f235b3a9..ada1eef8d1 100644 --- a/src/applications/maniphest/editor/ManiphestEditEngine.php +++ b/src/applications/maniphest/editor/ManiphestEditEngine.php @@ -73,7 +73,6 @@ final class ManiphestEditEngine // - Don't show "change status" for closed tasks. // - Don't show "change owner" for closed tasks. // - Don't let users change a task status to "Duplicate". - // - Make sure "Quote" works. // - When closing an unassigned task, assign the closing user. // - Make sure implicit CCs on actions are working reasonably. diff --git a/src/applications/paste/controller/PhabricatorPasteViewController.php b/src/applications/paste/controller/PhabricatorPasteViewController.php index 4e291bcade..5f422675b8 100644 --- a/src/applications/paste/controller/PhabricatorPasteViewController.php +++ b/src/applications/paste/controller/PhabricatorPasteViewController.php @@ -64,8 +64,9 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController { ), $source_code); + $monogram = $paste->getMonogram(); $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb('P'.$paste->getID(), '/P'.$paste->getID()); + ->addTextCrumb($monogram, '/'.$monogram); $timeline = $this->buildTransactionTimeline( $paste, @@ -75,6 +76,9 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController { ->setViewer($viewer) ->buildEditEngineCommentView($paste); + $timeline->setQuoteRef($monogram); + $comment_view->setTransactionTimeline($timeline); + return $this->newPage() ->setTitle($paste->getFullName()) ->setCrumbs($crumbs) diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index 15053e8f4a..2c92a2cf1f 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -23,6 +23,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { private $currentVersion; private $versionedDraft; private $editTypes; + private $transactionTimeline; public function setObjectPHID($object_phid) { $this->objectPHID = $object_phid; @@ -110,8 +111,16 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { return $this->editTypes; } - public function render() { + public function setTransactionTimeline( + PhabricatorApplicationTransactionView $timeline) { + $timeline->setQuoteTargetID($this->getCommentID()); + + $this->transactionTimeline = $timeline; + return $this; + } + + public function render() { $user = $this->getUser(); if (!$user->isLoggedIn()) { $uri = id(new PhutilURI('/login/'))