Skip to content

Commit c063e0e

Browse files
author
epriestley
committedMay 14, 2020
Add "View Raw Remarkup" to inline comments
Summary: Ref T13513. Ref T11401. Support viewing raw remarkup for inlines. Test Plan: Viewed raw remarkup on inlines. Maniphest Tasks: T13513, T11401 Differential Revision: https://secure.phabricator.com/D21246
1 parent 419b7ce commit c063e0e

File tree

5 files changed

+40
-15
lines changed

5 files changed

+40
-15
lines changed
 

‎resources/celerity/map.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'core.pkg.js' => '1e667bcb',
1414
'dark-console.pkg.js' => '187792c2',
1515
'differential.pkg.css' => 'd71d4531',
16-
'differential.pkg.js' => '21616a78',
16+
'differential.pkg.js' => 'b3e29cb8',
1717
'diffusion.pkg.css' => '42c75c37',
1818
'diffusion.pkg.js' => 'a98c0bf7',
1919
'maniphest.pkg.css' => '35995d6d',
@@ -381,7 +381,7 @@
381381
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
382382
'rsrc/js/application/diff/DiffChangeset.js' => '20715b98',
383383
'rsrc/js/application/diff/DiffChangesetList.js' => '40d6c41c',
384-
'rsrc/js/application/diff/DiffInline.js' => '15de2478',
384+
'rsrc/js/application/diff/DiffInline.js' => '6227a0e3',
385385
'rsrc/js/application/diff/DiffPathView.js' => '8207abf9',
386386
'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b',
387387
'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd',
@@ -776,7 +776,7 @@
776776
'phabricator-dashboard-css' => '5a205b9d',
777777
'phabricator-diff-changeset' => '20715b98',
778778
'phabricator-diff-changeset-list' => '40d6c41c',
779-
'phabricator-diff-inline' => '15de2478',
779+
'phabricator-diff-inline' => '6227a0e3',
780780
'phabricator-diff-path-view' => '8207abf9',
781781
'phabricator-diff-tree-view' => '5d83623b',
782782
'phabricator-drag-and-drop-file-upload' => '4370900d',
@@ -1034,9 +1034,6 @@
10341034
'javelin-stratcom',
10351035
'javelin-util',
10361036
),
1037-
'15de2478' => array(
1038-
'javelin-dom',
1039-
),
10401037
'1a844c06' => array(
10411038
'javelin-install',
10421039
'javelin-util',
@@ -1511,6 +1508,9 @@
15111508
'60cd9241' => array(
15121509
'javelin-behavior',
15131510
),
1511+
'6227a0e3' => array(
1512+
'javelin-dom',
1513+
),
15141514
'6337cf26' => array(
15151515
'javelin-behavior',
15161516
'javelin-dom',

‎src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ public function hasOldComment() {
101101
return ($this->oldComment !== self::ATTACHABLE);
102102
}
103103

104+
public function getRawRemarkupURI() {
105+
return urisprintf(
106+
'/transactions/raw/%s/',
107+
$this->getTransactionPHID());
108+
}
104109

105110
/* -( PhabricatorMarkupInterface )----------------------------------------- */
106111

‎src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php

+22-6
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ public function render() {
173173
'action' => 'edit',
174174
'key' => 'e',
175175
);
176-
177-
$menu_items[] = array(
178-
'label' => pht('Delete Comment'),
179-
'icon' => 'fa-trash-o',
180-
'action' => 'delete',
181-
);
182176
} else if ($is_preview) {
183177
$links[] = javelin_tag(
184178
'a',
@@ -236,6 +230,28 @@ public function render() {
236230
);
237231
}
238232

233+
if (!$is_preview) {
234+
$xaction_phid = $inline->getTransactionPHID();
235+
$storage = $inline->getStorageObject();
236+
237+
if ($xaction_phid) {
238+
$menu_items[] = array(
239+
'label' => pht('View Raw Remarkup'),
240+
'icon' => 'fa-code',
241+
'action' => 'raw',
242+
'uri' => $storage->getRawRemarkupURI(),
243+
);
244+
}
245+
}
246+
247+
if ($this->editable && !$is_preview) {
248+
$menu_items[] = array(
249+
'label' => pht('Delete Comment'),
250+
'icon' => 'fa-trash-o',
251+
'action' => 'delete',
252+
);
253+
}
254+
239255
$done_button = null;
240256

241257
$mark_done = $this->getCanMarkDone();

‎src/view/phui/PHUITimelineEventView.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ private function getMenuItems($anchor) {
705705
$items[] = id(new PhabricatorActionView())
706706
->setIcon('fa-code')
707707
->setHref('/transactions/raw/'.$xaction_phid.'/')
708-
->setName(pht('View Remarkup'))
708+
->setName(pht('View Raw Remarkup'))
709709
->addSigil('transaction-raw')
710710
->setMetadata(
711711
array(

‎webroot/rsrc/js/application/diff/DiffInline.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ JX.install('DiffInline', {
921921
for (var ii = 0; ii < this._menuItems.length; ii++) {
922922
var spec = this._menuItems[ii];
923923

924-
var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action);
924+
var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action, spec);
925925

926926
var item = new JX.PHUIXActionView()
927927
.setIcon(spec.icon)
@@ -938,7 +938,7 @@ JX.install('DiffInline', {
938938
return items;
939939
},
940940

941-
_onMenuItem: function(menu, action, e) {
941+
_onMenuItem: function(menu, action, spec, e) {
942942
e.prevent();
943943
menu.close();
944944

@@ -958,6 +958,10 @@ JX.install('DiffInline', {
958958
case 'edit':
959959
this.edit();
960960
break;
961+
case 'raw':
962+
new JX.Workflow(spec.uri)
963+
.start();
964+
break;
961965
}
962966

963967
},

0 commit comments

Comments
 (0)
Failed to load comments.