@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make inline comment preview and submission mostly work on EditEngine

Summary: Ref T11114. This comments nearly working on EditEngine. Only significant issue I caught is that the "View" link doesn't render properly because it depends on JS which is tricky to hook up. I'll clean that up in a future diff.

Test Plan: {F2279201}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

Differential Revision: https://secure.phabricator.com/D17116

+195 -215
+22 -22
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '28e8cda8', 14 14 'darkconsole.pkg.js' => 'e7393ebb', 15 15 'differential.pkg.css' => 'a4ba74b5', 16 - 'differential.pkg.js' => '634399e9', 16 + 'differential.pkg.js' => '40b18f35', 17 17 'diffusion.pkg.css' => '91c5d3a6', 18 18 'diffusion.pkg.js' => '84c8f8fd', 19 19 'favicon.ico' => '30672e08', ··· 397 397 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 398 398 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 399 399 'rsrc/js/application/differential/ChangesetViewManager.js' => 'a2828756', 400 - 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f', 400 + 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '2e3f9738', 401 401 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 402 402 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 403 403 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', ··· 453 453 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072', 454 454 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 455 455 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', 456 - 'rsrc/js/application/transactions/behavior-comment-actions.js' => '1be09f3f', 456 + 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'c23ecb0b', 457 457 'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243', 458 458 'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96', 459 459 'rsrc/js/application/transactions/behavior-show-older-transactions.js' => '94c65b72', ··· 575 575 'd3' => 'a11a5ff2', 576 576 'differential-changeset-view-css' => 'b158cc46', 577 577 'differential-core-view-css' => '5b7b8ff4', 578 - 'differential-inline-comment-editor' => '64a5550f', 578 + 'differential-inline-comment-editor' => '2e3f9738', 579 579 'differential-revision-add-comment-css' => 'c47f8c40', 580 580 'differential-revision-comment-css' => '14b8565a', 581 581 'differential-revision-history-css' => '0e8eb855', ··· 609 609 'javelin-behavior-bulk-job-reload' => 'edf8a145', 610 610 'javelin-behavior-calendar-month-view' => 'fe33e256', 611 611 'javelin-behavior-choose-control' => '327a00d1', 612 - 'javelin-behavior-comment-actions' => '1be09f3f', 612 + 'javelin-behavior-comment-actions' => 'c23ecb0b', 613 613 'javelin-behavior-config-reorder-fields' => 'b6993408', 614 614 'javelin-behavior-conpherence-menu' => '7524fcfa', 615 615 'javelin-behavior-conpherence-participant-pane' => '8604caa8', ··· 1083 1083 'javelin-request', 1084 1084 'javelin-uri', 1085 1085 ), 1086 - '1be09f3f' => array( 1087 - 'javelin-behavior', 1088 - 'javelin-stratcom', 1089 - 'javelin-workflow', 1090 - 'javelin-dom', 1091 - 'phuix-form-control-view', 1092 - 'phuix-icon-view', 1093 - 'javelin-behavior-phabricator-gesture', 1094 - ), 1095 1086 '1def2711' => array( 1096 1087 'javelin-install', 1097 1088 'javelin-dom', ··· 1156 1147 'javelin-install', 1157 1148 'javelin-event', 1158 1149 ), 1150 + '2e3f9738' => array( 1151 + 'javelin-dom', 1152 + 'javelin-util', 1153 + 'javelin-stratcom', 1154 + 'javelin-install', 1155 + 'javelin-request', 1156 + 'javelin-workflow', 1157 + ), 1159 1158 '2ee659ce' => array( 1160 1159 'javelin-install', 1161 1160 ), ··· 1420 1419 'javelin-stratcom', 1421 1420 'javelin-workflow', 1422 1421 'javelin-dom', 1423 - ), 1424 - '64a5550f' => array( 1425 - 'javelin-dom', 1426 - 'javelin-util', 1427 - 'javelin-stratcom', 1428 - 'javelin-install', 1429 - 'javelin-request', 1430 - 'javelin-workflow', 1431 1422 ), 1432 1423 '680ea2c8' => array( 1433 1424 'javelin-install', ··· 1955 1946 'bff6884b' => array( 1956 1947 'javelin-install', 1957 1948 'javelin-dom', 1949 + ), 1950 + 'c23ecb0b' => array( 1951 + 'javelin-behavior', 1952 + 'javelin-stratcom', 1953 + 'javelin-workflow', 1954 + 'javelin-dom', 1955 + 'phuix-form-control-view', 1956 + 'phuix-icon-view', 1957 + 'javelin-behavior-phabricator-gesture', 1958 1958 ), 1959 1959 'c587b80f' => array( 1960 1960 'javelin-install',
+2 -4
src/__phutil_library_map__.php
··· 379 379 'DifferentialChangesetTwoUpTestRenderer' => 'applications/differential/render/DifferentialChangesetTwoUpTestRenderer.php', 380 380 'DifferentialChangesetViewController' => 'applications/differential/controller/DifferentialChangesetViewController.php', 381 381 'DifferentialCloseConduitAPIMethod' => 'applications/differential/conduit/DifferentialCloseConduitAPIMethod.php', 382 - 'DifferentialCommentPreviewController' => 'applications/differential/controller/DifferentialCommentPreviewController.php', 383 382 'DifferentialCommitMessageCustomField' => 'applications/differential/field/DifferentialCommitMessageCustomField.php', 384 383 'DifferentialCommitMessageField' => 'applications/differential/field/DifferentialCommitMessageField.php', 385 384 'DifferentialCommitMessageParser' => 'applications/differential/parser/DifferentialCommitMessageParser.php', ··· 457 456 'DifferentialInlineComment' => 'applications/differential/storage/DifferentialInlineComment.php', 458 457 'DifferentialInlineCommentEditController' => 'applications/differential/controller/DifferentialInlineCommentEditController.php', 459 458 'DifferentialInlineCommentMailView' => 'applications/differential/mail/DifferentialInlineCommentMailView.php', 460 - 'DifferentialInlineCommentPreviewController' => 'applications/differential/controller/DifferentialInlineCommentPreviewController.php', 461 459 'DifferentialInlineCommentQuery' => 'applications/differential/query/DifferentialInlineCommentQuery.php', 462 460 'DifferentialJIRAIssuesCommitMessageField' => 'applications/differential/field/DifferentialJIRAIssuesCommitMessageField.php', 463 461 'DifferentialJIRAIssuesField' => 'applications/differential/customfield/DifferentialJIRAIssuesField.php', ··· 1641 1639 'PHUIDiffGraphViewTestCase' => 'infrastructure/diff/view/__tests__/PHUIDiffGraphViewTestCase.php', 1642 1640 'PHUIDiffInlineCommentDetailView' => 'infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php', 1643 1641 'PHUIDiffInlineCommentEditView' => 'infrastructure/diff/view/PHUIDiffInlineCommentEditView.php', 1642 + 'PHUIDiffInlineCommentPreviewListView' => 'infrastructure/diff/view/PHUIDiffInlineCommentPreviewListView.php', 1644 1643 'PHUIDiffInlineCommentRowScaffold' => 'infrastructure/diff/view/PHUIDiffInlineCommentRowScaffold.php', 1645 1644 'PHUIDiffInlineCommentTableScaffold' => 'infrastructure/diff/view/PHUIDiffInlineCommentTableScaffold.php', 1646 1645 'PHUIDiffInlineCommentUndoView' => 'infrastructure/diff/view/PHUIDiffInlineCommentUndoView.php', ··· 5029 5028 'DifferentialChangesetTwoUpTestRenderer' => 'DifferentialChangesetTestRenderer', 5030 5029 'DifferentialChangesetViewController' => 'DifferentialController', 5031 5030 'DifferentialCloseConduitAPIMethod' => 'DifferentialConduitAPIMethod', 5032 - 'DifferentialCommentPreviewController' => 'DifferentialController', 5033 5031 'DifferentialCommitMessageCustomField' => 'DifferentialCommitMessageField', 5034 5032 'DifferentialCommitMessageField' => 'Phobject', 5035 5033 'DifferentialCommitMessageParser' => 'Phobject', ··· 5120 5118 ), 5121 5119 'DifferentialInlineCommentEditController' => 'PhabricatorInlineCommentController', 5122 5120 'DifferentialInlineCommentMailView' => 'DifferentialMailView', 5123 - 'DifferentialInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController', 5124 5121 'DifferentialInlineCommentQuery' => 'PhabricatorOffsetPagedQuery', 5125 5122 'DifferentialJIRAIssuesCommitMessageField' => 'DifferentialCommitMessageCustomField', 5126 5123 'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField', ··· 6484 6481 'PHUIDiffGraphViewTestCase' => 'PhabricatorTestCase', 6485 6482 'PHUIDiffInlineCommentDetailView' => 'PHUIDiffInlineCommentView', 6486 6483 'PHUIDiffInlineCommentEditView' => 'PHUIDiffInlineCommentView', 6484 + 'PHUIDiffInlineCommentPreviewListView' => 'AphrontView', 6487 6485 'PHUIDiffInlineCommentRowScaffold' => 'AphrontView', 6488 6486 'PHUIDiffInlineCommentTableScaffold' => 'AphrontView', 6489 6487 'PHUIDiffInlineCommentUndoView' => 'PHUIDiffInlineCommentView',
-139
src/applications/differential/controller/DifferentialCommentPreviewController.php
··· 1 - <?php 2 - 3 - final class DifferentialCommentPreviewController 4 - extends DifferentialController { 5 - 6 - public function handleRequest(AphrontRequest $request) { 7 - $viewer = $this->getViewer(); 8 - $id = $request->getURIData('id'); 9 - 10 - $revision = id(new DifferentialRevisionQuery()) 11 - ->setViewer($viewer) 12 - ->withIDs(array($id)) 13 - ->executeOne(); 14 - if (!$revision) { 15 - return new Aphront404Response(); 16 - } 17 - 18 - $type_comment = PhabricatorTransactions::TYPE_COMMENT; 19 - $type_action = DifferentialTransaction::TYPE_ACTION; 20 - $type_edge = PhabricatorTransactions::TYPE_EDGE; 21 - $type_subscribers = PhabricatorTransactions::TYPE_SUBSCRIBERS; 22 - 23 - $xactions = array(); 24 - 25 - $action = $request->getStr('action'); 26 - switch ($action) { 27 - case DifferentialAction::ACTION_COMMENT: 28 - case DifferentialAction::ACTION_ADDREVIEWERS: 29 - case DifferentialAction::ACTION_ADDCCS: 30 - break; 31 - default: 32 - $xactions[] = id(new DifferentialTransaction()) 33 - ->setTransactionType($type_action) 34 - ->setNewValue($action); 35 - break; 36 - } 37 - 38 - $edge_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST; 39 - 40 - $reviewers = $request->getStrList('reviewers'); 41 - if (DifferentialAction::allowReviewers($action) && $reviewers) { 42 - $faux_edges = array(); 43 - foreach ($reviewers as $phid) { 44 - $faux_edges[$phid] = array( 45 - 'src' => $revision->getPHID(), 46 - 'type' => $edge_reviewer, 47 - 'dst' => $phid, 48 - ); 49 - } 50 - 51 - $xactions[] = id(new DifferentialTransaction()) 52 - ->setTransactionType($type_edge) 53 - ->setMetadataValue('edge:type', $edge_reviewer) 54 - ->setOldValue(array()) 55 - ->setNewValue($faux_edges); 56 - } 57 - 58 - $ccs = $request->getStrList('ccs'); 59 - if ($ccs) { 60 - $xactions[] = id(new DifferentialTransaction()) 61 - ->setTransactionType($type_subscribers) 62 - ->setOldValue(array()) 63 - ->setNewValue(array_fuse($ccs)); 64 - } 65 - 66 - // Add a comment transaction if there's nothing, so we'll generate a 67 - // nonempty result. 68 - if (strlen($request->getStr('content')) || !$xactions) { 69 - $xactions[] = id(new DifferentialTransaction()) 70 - ->setTransactionType($type_comment) 71 - ->attachComment( 72 - id(new ManiphestTransactionComment()) 73 - ->setContent($request->getStr('content'))); 74 - } 75 - 76 - foreach ($xactions as $xaction) { 77 - $xaction->setAuthorPHID($viewer->getPHID()); 78 - } 79 - 80 - $engine = new PhabricatorMarkupEngine(); 81 - $engine->setViewer($request->getUser()); 82 - foreach ($xactions as $xaction) { 83 - if ($xaction->hasComment()) { 84 - $engine->addObject( 85 - $xaction->getComment(), 86 - PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); 87 - } 88 - } 89 - $engine->process(); 90 - 91 - $phids = mpull($xactions, 'getRequiredHandlePHIDs'); 92 - $phids = array_mergev($phids); 93 - 94 - $handles = id(new PhabricatorHandleQuery()) 95 - ->setViewer($viewer) 96 - ->withPHIDs($phids) 97 - ->execute(); 98 - 99 - foreach ($xactions as $xaction) { 100 - $xaction->setHandles($handles); 101 - } 102 - 103 - $view = id(new DifferentialTransactionView()) 104 - ->setUser($viewer) 105 - ->setTransactions($xactions) 106 - ->setIsPreview(true); 107 - 108 - $metadata = array( 109 - 'reviewers' => $reviewers, 110 - 'ccs' => $ccs, 111 - ); 112 - if ($action != DifferentialAction::ACTION_COMMENT) { 113 - $metadata['action'] = $action; 114 - } 115 - 116 - $draft_key = 'differential-comment-'.$id; 117 - $draft = id(new PhabricatorDraft()) 118 - ->setAuthorPHID($viewer->getPHID()) 119 - ->setDraftKey($draft_key) 120 - ->setDraft($request->getStr('content')) 121 - ->setMetadata($metadata) 122 - ->replaceOrDelete(); 123 - if ($draft->isDeleted()) { 124 - DifferentialDraft::deleteHasDraft( 125 - $viewer->getPHID(), 126 - $revision->getPHID(), 127 - $draft_key); 128 - } else { 129 - DifferentialDraft::markHasDraft( 130 - $viewer->getPHID(), 131 - $revision->getPHID(), 132 - $draft_key); 133 - } 134 - 135 - return id(new AphrontAjaxResponse()) 136 - ->setContent((string)phutil_implode_html('', $view->buildEvents())); 137 - } 138 - 139 - }
-44
src/applications/differential/controller/DifferentialInlineCommentPreviewController.php
··· 1 - <?php 2 - 3 - final class DifferentialInlineCommentPreviewController 4 - extends PhabricatorInlineCommentPreviewController { 5 - 6 - protected function loadInlineComments() { 7 - $viewer = $this->getViewer(); 8 - 9 - $revision = id(new DifferentialRevisionQuery()) 10 - ->setViewer($viewer) 11 - ->withIDs(array($this->getRevisionID())) 12 - ->executeOne(); 13 - if (!$revision) { 14 - return array(); 15 - } 16 - 17 - return id(new DifferentialInlineCommentQuery()) 18 - ->setViewer($this->getViewer()) 19 - ->withDrafts(true) 20 - ->withAuthorPHIDs(array($viewer->getPHID())) 21 - ->withRevisionPHIDs(array($revision->getPHID())) 22 - ->needHidden(true) 23 - ->execute(); 24 - } 25 - 26 - protected function loadObjectOwnerPHID() { 27 - $viewer = $this->getViewer(); 28 - 29 - $revision = id(new DifferentialRevisionQuery()) 30 - ->setViewer($viewer) 31 - ->withIDs(array($this->getRevisionID())) 32 - ->executeOne(); 33 - if (!$revision) { 34 - return null; 35 - } 36 - 37 - return $revision->getAuthorPHID(); 38 - } 39 - 40 - 41 - private function getRevisionID() { 42 - return $this->getRequest()->getURIData('id'); 43 - } 44 - }
+48
src/applications/differential/editor/DifferentialRevisionEditEngine.php
··· 247 247 return isset($fields[$key]); 248 248 } 249 249 250 + protected function newAutomaticCommentTransactions($object) { 251 + $viewer = $this->getViewer(); 252 + $xactions = array(); 253 + 254 + $inlines = DifferentialTransactionQuery::loadUnsubmittedInlineComments( 255 + $viewer, 256 + $object); 257 + $inlines = msort($inlines, 'getID'); 258 + 259 + foreach ($inlines as $inline) { 260 + $xactions[] = id(new DifferentialTransaction()) 261 + ->setTransactionType(DifferentialTransaction::TYPE_INLINE) 262 + ->attachComment($inline); 263 + } 264 + 265 + return $xactions; 266 + } 267 + 268 + protected function newCommentPreviewContent($object, array $xactions) { 269 + $viewer = $this->getViewer(); 270 + $type_inline = DifferentialTransaction::TYPE_INLINE; 271 + 272 + $inlines = array(); 273 + foreach ($xactions as $xaction) { 274 + if ($xaction->getTransactionType() === $type_inline) { 275 + $inlines[] = $xaction->getComment(); 276 + } 277 + } 278 + 279 + $content = array(); 280 + 281 + if ($inlines) { 282 + $inline_preview = id(new PHUIDiffInlineCommentPreviewListView()) 283 + ->setViewer($viewer) 284 + ->setInlineComments($inlines); 285 + 286 + $content[] = phutil_tag( 287 + 'div', 288 + array( 289 + 'id' => 'inline-comment-preview', 290 + ), 291 + $inline_preview); 292 + } 293 + 294 + return $content; 295 + } 296 + 297 + 250 298 }
+1
src/applications/differential/storage/DifferentialTransactionComment.php
··· 14 14 15 15 private $replyToComment = self::ATTACHABLE; 16 16 private $isHidden = self::ATTACHABLE; 17 + private $changeset = self::ATTACHABLE; 17 18 18 19 public function getApplicationTransactionObject() { 19 20 return new DifferentialTransaction();
+8 -1
src/applications/differential/view/DifferentialTransactionView.php
··· 3 3 final class DifferentialTransactionView 4 4 extends PhabricatorApplicationTransactionView { 5 5 6 - private $changesets; 6 + private $changesets = array(); 7 7 private $revision; 8 8 private $rightDiff; 9 9 private $leftDiff; ··· 91 91 array_unshift($group, $xaction); 92 92 } else { 93 93 $out[] = parent::renderTransactionContent($xaction); 94 + } 95 + 96 + // If we're rendering a preview, we show the inline comments in a separate 97 + // section underneath the main transaction preview, so we skip rendering 98 + // them in the preview body. 99 + if ($this->getIsPreview()) { 100 + return $out; 94 101 } 95 102 96 103 if (!$group) {
+17 -1
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 1783 1783 } 1784 1784 } 1785 1785 1786 + $auto_xactions = $this->newAutomaticCommentTransactions($object); 1787 + foreach ($auto_xactions as $xaction) { 1788 + $xactions[] = $xaction; 1789 + } 1790 + 1786 1791 if (strlen($comment_text) || !$xactions) { 1787 1792 $xactions[] = id(clone $template) 1788 1793 ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) ··· 1814 1819 } 1815 1820 1816 1821 if ($request->isAjax() && $is_preview) { 1822 + $preview_content = $this->newCommentPreviewContent($object, $xactions); 1823 + 1817 1824 return id(new PhabricatorApplicationTransactionResponse()) 1818 1825 ->setViewer($viewer) 1819 1826 ->setTransactions($xactions) 1820 - ->setIsPreview($is_preview); 1827 + ->setIsPreview($is_preview) 1828 + ->setPreviewContent($preview_content); 1821 1829 } else { 1822 1830 return id(new AphrontRedirectResponse()) 1823 1831 ->setURI($view_uri); ··· 2162 2170 2163 2171 protected function newCommentActionGroups() { 2164 2172 return array(); 2173 + } 2174 + 2175 + protected function newAutomaticCommentTransactions($object) { 2176 + return array(); 2177 + } 2178 + 2179 + protected function newCommentPreviewContent($object, array $xactions) { 2180 + return null; 2165 2181 } 2166 2182 2167 2183
+12 -1
src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php
··· 7 7 private $transactions; 8 8 private $isPreview; 9 9 private $transactionView; 10 + private $previewContent; 10 11 11 12 public function setTransactionView($transaction_view) { 12 13 $this->transactionView = $transaction_view; ··· 46 47 return $this; 47 48 } 48 49 50 + public function setPreviewContent($preview_content) { 51 + $this->previewContent = $preview_content; 52 + return $this; 53 + } 54 + 55 + public function getPreviewContent() { 56 + return $this->previewContent; 57 + } 58 + 49 59 public function reduceProxyResponse() { 50 60 if ($this->transactionView) { 51 61 $view = $this->transactionView; ··· 75 85 76 86 $content = array( 77 87 'xactions' => $xactions, 78 - 'spacer' => PHUITimelineView::renderSpacer(), 88 + 'spacer' => PHUITimelineView::renderSpacer(), 89 + 'previewContent' => hsprintf('%s', $this->getPreviewContent()), 79 90 ); 80 91 81 92 return $this->getProxy()->setContent($content);
+4
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
··· 55 55 return $this; 56 56 } 57 57 58 + public function getIsPreview() { 59 + return $this->isPreview; 60 + } 61 + 58 62 public function setShowEditActions($show_edit_actions) { 59 63 $this->showEditActions = $show_edit_actions; 60 64 return $this;
+67
src/infrastructure/diff/view/PHUIDiffInlineCommentPreviewListView.php
··· 1 + <?php 2 + 3 + final class PHUIDiffInlineCommentPreviewListView 4 + extends AphrontView { 5 + 6 + private $inlineComments = array(); 7 + private $ownerPHID; 8 + 9 + public function setInlineComments(array $comments) { 10 + assert_instances_of($comments, 'PhabricatorApplicationTransactionComment'); 11 + $this->inlineComments = $comments; 12 + return $this; 13 + } 14 + 15 + public function getInlineComments() { 16 + return $this->inlineComments; 17 + } 18 + 19 + public function setOwnerPHID($owner_phid) { 20 + $this->ownerPHID = $owner_phid; 21 + return $this; 22 + } 23 + 24 + public function getOwnerPHID() { 25 + return $this->ownerPHID; 26 + } 27 + 28 + public function render() { 29 + $viewer = $this->getViewer(); 30 + 31 + $inlines = $this->getInlineComments(); 32 + foreach ($inlines as $key => $inline) { 33 + $inlines[$key] = DifferentialInlineComment::newFromModernComment( 34 + $inline); 35 + } 36 + 37 + $engine = new PhabricatorMarkupEngine(); 38 + $engine->setViewer($viewer); 39 + foreach ($inlines as $inline) { 40 + $engine->addObject( 41 + $inline, 42 + PhabricatorInlineCommentInterface::MARKUP_FIELD_BODY); 43 + } 44 + $engine->process(); 45 + 46 + $owner_phid = $this->getOwnerPHID(); 47 + 48 + $handles = $viewer->loadHandles(array($viewer->getPHID())); 49 + $handles = iterator_to_array($handles); 50 + 51 + $views = array(); 52 + foreach ($inlines as $inline) { 53 + $views[] = id(new PHUIDiffInlineCommentDetailView()) 54 + ->setUser($viewer) 55 + ->setInlineComment($inline) 56 + ->setMarkupEngine($engine) 57 + ->setHandles($handles) 58 + ->setEditable(false) 59 + ->setPreview(true) 60 + ->setCanMarkDone(false) 61 + ->setObjectOwnerPHID($owner_phid); 62 + } 63 + 64 + return $views; 65 + } 66 + 67 + }
+10 -2
webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
··· 183 183 184 184 this._completed = true; 185 185 186 - JX.Stratcom.invoke('differential-inline-comment-update'); 186 + this._didUpdate(); 187 187 this.invoke('done'); 188 188 }, 189 189 ··· 335 335 }, 336 336 337 337 _didUpdate: function() { 338 - JX.Stratcom.invoke('differential-inline-comment-update'); 338 + // After making changes to inline comments, refresh the transaction 339 + // preview at the bottom of the page. 340 + 341 + // TODO: This isn't the cleanest way to find the preview form, but 342 + // rendering no longer has direct access to it. 343 + var forms = JX.DOM.scry(document.body, 'form', 'transaction-append'); 344 + if (forms.length) { 345 + JX.DOM.invoke(forms[0], 'shouldRefresh'); 346 + } 339 347 } 340 348 341 349 },
+4 -1
webroot/rsrc/js/application/transactions/behavior-comment-actions.js
··· 149 149 } else { 150 150 JX.DOM.setContent( 151 151 JX.$(config.timelineID), 152 - JX.$H(response.xactions.join(''))); 152 + [ 153 + JX.$H(response.xactions.join('')), 154 + JX.$H(response.previewContent) 155 + ]); 153 156 JX.DOM.show(panel); 154 157 } 155 158 }