Index: src/applications/maniphest/controller/ManiphestTransactionPreviewController.php =================================================================== --- src/applications/maniphest/controller/ManiphestTransactionPreviewController.php +++ src/applications/maniphest/controller/ManiphestTransactionPreviewController.php @@ -97,7 +97,7 @@ break; case ManiphestTransaction::TYPE_STATUS: $phids = array(); - $transaction->setOldvalue($task->getStatus()); + $transaction->setOldValue($task->getStatus()); $transaction->setNewValue($value); break; default: @@ -126,8 +126,7 @@ $view = id(new PhabricatorApplicationTransactionView()) ->setUser($user) ->setTransactions($transactions) - ->setIsPreview(true) - ->setIsDetailView(true); + ->setIsPreview(true); return id(new AphrontAjaxResponse()) ->setContent((string)phutil_implode_html('', $view->buildEvents())); Index: src/applications/maniphest/storage/ManiphestTransaction.php =================================================================== --- src/applications/maniphest/storage/ManiphestTransaction.php +++ src/applications/maniphest/storage/ManiphestTransaction.php @@ -634,6 +634,8 @@ $old = $this->getOldValue(); $new = $this->getNewValue(); + require_celerity_resource('differential-changeset-view-css'); + $view = id(new PhabricatorApplicationTransactionTextDiffDetailView()) ->setUser($viewer) ->setOldText($old) Index: src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php =================================================================== --- src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php +++ src/applications/transactions/controller/PhabricatorApplicationTransactionDetailController.php @@ -11,23 +11,40 @@ public function processRequest() { $request = $this->getRequest(); - $user = $request->getUser(); + $viewer = $request->getUser(); $xaction = id(new PhabricatorObjectQuery()) ->withPHIDs(array($this->phid)) - ->setViewer($user) + ->setViewer($viewer) ->executeOne(); - if (!$xaction) { - // future proofing for the day visibility of transactions can change return new Aphront404Response(); } - return id(new PhabricatorApplicationTransactionResponse()) - ->setViewer($user) - ->setTransactions(array($xaction)) - ->setIsDetailView(true) - ->setAnchorOffset($request->getStr('anchor')); + $details = $xaction->renderChangeDetails($viewer); + + // Take an educated guess at the URI where the transactions appear so we + // can send the cancel button somewhere sensible. This won't always get the + // best answer (for example, Diffusion's history is visible on a page other + // than the main object view page) but should always get a reasonable one. + + $cancel_uri = '/'; + $handle = id(new PhabricatorHandleQuery()) + ->setViewer($viewer) + ->withPHIDs(array($xaction->getObjectPHID())) + ->executeOne(); + if ($handle) { + $cancel_uri = $handle->getURI(); + } + + $dialog = id(new AphrontDialogView()) + ->setUser($viewer) + ->setTitle(pht('Change Details')) + ->setWidth(AphrontDialogView::WIDTH_FULL) + ->appendChild($details) + ->addCancelButton($cancel_uri); + + return id(new AphrontDialogResponse())->setDialog($dialog); } } Index: src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php =================================================================== --- src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php +++ src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php @@ -7,7 +7,6 @@ private $transactions; private $anchorOffset; private $isPreview; - private $isDetailView; protected function buildProxy() { return new AphrontAjaxResponse(); @@ -47,11 +46,6 @@ return $this; } - public function setIsDetailView($is_detail_view) { - $this->isDetailView = $is_detail_view; - return $this; - } - public function reduceProxyResponse() { if ($this->getTransactions()) { $view = head($this->getTransactions()) @@ -63,8 +57,7 @@ $view ->setUser($this->getViewer()) ->setTransactions($this->getTransactions()) - ->setIsPreview($this->isPreview) - ->setIsDetailView($this->isDetailView); + ->setIsPreview($this->isPreview); if ($this->getAnchorOffset()) { $view->setAnchorOffset($this->getAnchorOffset()); Index: src/applications/transactions/view/PhabricatorApplicationTransactionView.php =================================================================== --- src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -11,12 +11,6 @@ private $showEditActions = true; private $isPreview; private $objectPHID; - private $isDetailView; - - public function setIsDetailView($is_detail_view) { - $this->isDetailView = $is_detail_view; - return $this; - } public function setObjectPHID($object_phid) { $this->objectPHID = $object_phid; @@ -134,59 +128,6 @@ return $engine; } - private function buildChangeDetails( - PhabricatorApplicationTransaction $xaction) { - - Javelin::initBehavior('phabricator-reveal-content'); - - $show_id = celerity_generate_unique_node_id(); - $hide_id = celerity_generate_unique_node_id(); - $content_id = celerity_generate_unique_node_id(); - - $show_more = javelin_tag( - 'a', - array( - 'href' => '#', - 'sigil' => 'reveal-content', - 'mustcapture' => true, - 'id' => $show_id, - 'style' => 'display: none', - 'meta' => array( - 'hideIDs' => array($show_id), - 'showIDs' => array($hide_id, $content_id), - ), - ), - pht('(Show Details)')); - - $hide_more = javelin_tag( - 'a', - array( - 'href' => '#', - 'sigil' => 'reveal-content', - 'mustcapture' => true, - 'id' => $hide_id, - 'meta' => array( - 'hideIDs' => array($hide_id, $content_id), - 'showIDs' => array($show_id), - ), - ), - pht('(Hide Details)')); - - $content = phutil_tag( - 'div', - array( - 'id' => $content_id, - 'class' => 'phui-timeline-change-details', - ), - $xaction->renderChangeDetails($this->getUser())); - - return array( - $show_more, - $hide_more, - $content, - ); - } - private function buildChangeDetailsLink( PhabricatorApplicationTransaction $xaction) { @@ -303,16 +244,14 @@ if (!$this->shouldSuppressTitle($xaction, $group)) { $title = $xaction->getTitle(); if ($xaction->hasChangeDetails()) { - if ($this->isPreview || $this->isDetailView) { - $details = $this->buildChangeDetails($xaction); - } else { + if (!$this->isPreview) { $details = $this->buildChangeDetailsLink($xaction); + $title = array( + $title, + ' ', + $details, + ); } - $title = array( - $title, - ' ', - $details, - ); } $event->setTitle($title); }