Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14357431
D10183.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D10183.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '519e8478',
- 'core.pkg.js' => '4c28870b',
+ 'core.pkg.js' => 'eb8d4f82',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37',
'differential.pkg.js' => 'eb182ccd',
@@ -425,7 +425,7 @@
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => 'd6f54db0',
'rsrc/js/application/transactions/behavior-transaction-comment-form.js' => '9f7309fb',
- 'rsrc/js/application/transactions/behavior-transaction-list.js' => '71f66c08',
+ 'rsrc/js/application/transactions/behavior-transaction-list.js' => '13c739ea',
'rsrc/js/application/uiexample/JavelinViewExample.js' => 'd4a14807',
'rsrc/js/application/uiexample/ReactorButtonExample.js' => 'd19198c8',
'rsrc/js/application/uiexample/ReactorCheckboxExample.js' => '519705ea',
@@ -629,7 +629,7 @@
'javelin-behavior-phabricator-show-all-transactions' => '7c273581',
'javelin-behavior-phabricator-tooltips' => '3ee3408b',
'javelin-behavior-phabricator-transaction-comment-form' => '9f7309fb',
- 'javelin-behavior-phabricator-transaction-list' => '71f66c08',
+ 'javelin-behavior-phabricator-transaction-list' => '13c739ea',
'javelin-behavior-phabricator-watch-anchor' => '06e05112',
'javelin-behavior-phame-post-preview' => 'be807912',
'javelin-behavior-pholio-mock-edit' => '9c2623f4',
@@ -925,6 +925,14 @@
'javelin-util',
'phabricator-shaped-request',
),
+ '13c739ea' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-dom',
+ 'javelin-uri',
+ 'phabricator-textareautils',
+ ),
'14a827de' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1280,14 +1288,6 @@
'phabricator-phtize',
'changeset-view-manager',
),
- '71f66c08' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-dom',
- 'javelin-uri',
- 'phabricator-textareautils',
- ),
'7319e029' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1109,6 +1109,7 @@
'PhabricatorApplicationTransactionCommentHistoryController' => 'applications/transactions/controller/PhabricatorApplicationTransactionCommentHistoryController.php',
'PhabricatorApplicationTransactionCommentQuery' => 'applications/transactions/query/PhabricatorApplicationTransactionCommentQuery.php',
'PhabricatorApplicationTransactionCommentQuoteController' => 'applications/transactions/controller/PhabricatorApplicationTransactionCommentQuoteController.php',
+ 'PhabricatorApplicationTransactionCommentRawController' => 'applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php',
'PhabricatorApplicationTransactionCommentRemoveController' => 'applications/transactions/controller/PhabricatorApplicationTransactionCommentRemoveController.php',
'PhabricatorApplicationTransactionCommentView' => 'applications/transactions/view/PhabricatorApplicationTransactionCommentView.php',
'PhabricatorApplicationTransactionController' => 'applications/transactions/controller/PhabricatorApplicationTransactionController.php',
@@ -3912,6 +3913,7 @@
'PhabricatorApplicationTransactionCommentHistoryController' => 'PhabricatorApplicationTransactionController',
'PhabricatorApplicationTransactionCommentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorApplicationTransactionCommentQuoteController' => 'PhabricatorApplicationTransactionController',
+ 'PhabricatorApplicationTransactionCommentRawController' => 'PhabricatorApplicationTransactionController',
'PhabricatorApplicationTransactionCommentRemoveController' => 'PhabricatorApplicationTransactionController',
'PhabricatorApplicationTransactionCommentView' => 'AphrontView',
'PhabricatorApplicationTransactionController' => 'PhabricatorController',
diff --git a/src/applications/transactions/application/PhabricatorTransactionsApplication.php b/src/applications/transactions/application/PhabricatorTransactionsApplication.php
--- a/src/applications/transactions/application/PhabricatorTransactionsApplication.php
+++ b/src/applications/transactions/application/PhabricatorTransactionsApplication.php
@@ -25,6 +25,8 @@
=> 'PhabricatorApplicationTransactionCommentHistoryController',
'quote/(?<phid>[^/]+)/'
=> 'PhabricatorApplicationTransactionCommentQuoteController',
+ 'raw/(?<phid>[^/]+)/'
+ => 'PhabricatorApplicationTransactionCommentRawController',
'detail/(?<phid>[^/]+)/'
=> 'PhabricatorApplicationTransactionDetailController',
'(?P<value>old|new)/(?<phid>[^/]+)/'
diff --git a/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/controller/PhabricatorApplicationTransactionCommentRawController.php
@@ -0,0 +1,59 @@
+<?php
+
+final class PhabricatorApplicationTransactionCommentRawController
+ extends PhabricatorApplicationTransactionController {
+
+ private $phid;
+
+ public function willProcessRequest(array $data) {
+ $this->phid = $data['phid'];
+ }
+
+ public function processRequest() {
+ $request = $this->getRequest();
+ $user = $request->getUser();
+
+ $xaction = id(new PhabricatorObjectQuery())
+ ->withPHIDs(array($this->phid))
+ ->setViewer($user)
+ ->executeOne();
+
+ if (!$xaction) {
+ return new Aphront404Response();
+ }
+
+ if (!$xaction->getComment()) {
+ // You can't view a raw comment if there is no comment.
+ return new Aphront404Response();
+ }
+
+ if ($xaction->getComment()->getIsRemoved()) {
+ // You can't view a raw comment if the comment is deleted.
+ return new Aphront400Response();
+ }
+
+ $obj_phid = $xaction->getObjectPHID();
+ $obj_handle = id(new PhabricatorHandleQuery())
+ ->setViewer($user)
+ ->withPHIDs(array($obj_phid))
+ ->executeOne();
+
+ $dialog = id(new AphrontDialogView())
+ ->setUser($user)
+ ->addCancelButton($obj_handle->getURI())
+ ->setTitle(pht('Raw Comment'));
+
+ $dialog
+ ->addHiddenInput('anchor', $request->getStr('anchor'))
+ ->appendChild(
+ id(new PHUIFormLayoutView())
+ ->setFullWidth(true)
+ ->appendChild(
+ id(new AphrontFormTextAreaControl())
+ ->setReadOnly(true)
+ ->setValue($xaction->getComment()->getContent())));
+
+ return id(new AphrontDialogResponse())->setDialog($dialog);
+ }
+
+}
diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php
--- a/src/view/phui/PHUITimelineEventView.php
+++ b/src/view/phui/PHUITimelineEventView.php
@@ -528,6 +528,17 @@
'uri' => '/transactions/quote/'.$xaction_phid.'/',
'ref' => $ref,
));
+
+ // if there is something to quote then there is something to view raw
+ $items[] = id(new PhabricatorActionView())
+ ->setIcon('fa-cutlery')
+ ->setHref('/transactions/raw/'.$xaction_phid.'/')
+ ->setName(pht('View Raw'))
+ ->addSigil('transaction-raw')
+ ->setMetadata(
+ array(
+ 'anchor' => $anchor,
+ ));
}
if ($this->getIsRemovable()) {
diff --git a/webroot/rsrc/js/application/transactions/behavior-transaction-list.js b/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
--- a/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
+++ b/webroot/rsrc/js/application/transactions/behavior-transaction-list.js
@@ -12,7 +12,7 @@
JX.Stratcom.listen(
'click',
- [['transaction-edit'], ['transaction-remove']],
+ [['transaction-edit'], ['transaction-remove'], ['transaction-raw']],
function(e) {
if (!e.isNormalClick()) {
return;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 4:49 AM (17 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6912807
Default Alt Text
D10183.diff (8 KB)
Attached To
Mode
D10183: Transactions - add "view raw" action
Attached
Detach File
Event Timeline
Log In to Comment