1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

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
This commit is contained in:
epriestley 2020-05-13 09:24:33 -07:00
parent 419b7ceebb
commit c063e0e5ec
5 changed files with 40 additions and 15 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => '1e667bcb', 'core.pkg.js' => '1e667bcb',
'dark-console.pkg.js' => '187792c2', 'dark-console.pkg.js' => '187792c2',
'differential.pkg.css' => 'd71d4531', 'differential.pkg.css' => 'd71d4531',
'differential.pkg.js' => '21616a78', 'differential.pkg.js' => 'b3e29cb8',
'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => 'a98c0bf7', 'diffusion.pkg.js' => 'a98c0bf7',
'maniphest.pkg.css' => '35995d6d', 'maniphest.pkg.css' => '35995d6d',
@ -381,7 +381,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
'rsrc/js/application/diff/DiffChangeset.js' => '20715b98', 'rsrc/js/application/diff/DiffChangeset.js' => '20715b98',
'rsrc/js/application/diff/DiffChangesetList.js' => '40d6c41c', 'rsrc/js/application/diff/DiffChangesetList.js' => '40d6c41c',
'rsrc/js/application/diff/DiffInline.js' => '15de2478', 'rsrc/js/application/diff/DiffInline.js' => '6227a0e3',
'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9',
'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b',
'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd',
@ -776,7 +776,7 @@ return array(
'phabricator-dashboard-css' => '5a205b9d', 'phabricator-dashboard-css' => '5a205b9d',
'phabricator-diff-changeset' => '20715b98', 'phabricator-diff-changeset' => '20715b98',
'phabricator-diff-changeset-list' => '40d6c41c', 'phabricator-diff-changeset-list' => '40d6c41c',
'phabricator-diff-inline' => '15de2478', 'phabricator-diff-inline' => '6227a0e3',
'phabricator-diff-path-view' => '8207abf9', 'phabricator-diff-path-view' => '8207abf9',
'phabricator-diff-tree-view' => '5d83623b', 'phabricator-diff-tree-view' => '5d83623b',
'phabricator-drag-and-drop-file-upload' => '4370900d', 'phabricator-drag-and-drop-file-upload' => '4370900d',
@ -1034,9 +1034,6 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-util', 'javelin-util',
), ),
'15de2478' => array(
'javelin-dom',
),
'1a844c06' => array( '1a844c06' => array(
'javelin-install', 'javelin-install',
'javelin-util', 'javelin-util',
@ -1511,6 +1508,9 @@ return array(
'60cd9241' => array( '60cd9241' => array(
'javelin-behavior', 'javelin-behavior',
), ),
'6227a0e3' => array(
'javelin-dom',
),
'6337cf26' => array( '6337cf26' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',

View file

@ -101,6 +101,11 @@ abstract class PhabricatorApplicationTransactionComment
return ($this->oldComment !== self::ATTACHABLE); return ($this->oldComment !== self::ATTACHABLE);
} }
public function getRawRemarkupURI() {
return urisprintf(
'/transactions/raw/%s/',
$this->getTransactionPHID());
}
/* -( PhabricatorMarkupInterface )----------------------------------------- */ /* -( PhabricatorMarkupInterface )----------------------------------------- */

View file

@ -173,12 +173,6 @@ final class PHUIDiffInlineCommentDetailView
'action' => 'edit', 'action' => 'edit',
'key' => 'e', 'key' => 'e',
); );
$menu_items[] = array(
'label' => pht('Delete Comment'),
'icon' => 'fa-trash-o',
'action' => 'delete',
);
} else if ($is_preview) { } else if ($is_preview) {
$links[] = javelin_tag( $links[] = javelin_tag(
'a', 'a',
@ -236,6 +230,28 @@ final class PHUIDiffInlineCommentDetailView
); );
} }
if (!$is_preview) {
$xaction_phid = $inline->getTransactionPHID();
$storage = $inline->getStorageObject();
if ($xaction_phid) {
$menu_items[] = array(
'label' => pht('View Raw Remarkup'),
'icon' => 'fa-code',
'action' => 'raw',
'uri' => $storage->getRawRemarkupURI(),
);
}
}
if ($this->editable && !$is_preview) {
$menu_items[] = array(
'label' => pht('Delete Comment'),
'icon' => 'fa-trash-o',
'action' => 'delete',
);
}
$done_button = null; $done_button = null;
$mark_done = $this->getCanMarkDone(); $mark_done = $this->getCanMarkDone();

View file

@ -705,7 +705,7 @@ final class PHUITimelineEventView extends AphrontView {
$items[] = id(new PhabricatorActionView()) $items[] = id(new PhabricatorActionView())
->setIcon('fa-code') ->setIcon('fa-code')
->setHref('/transactions/raw/'.$xaction_phid.'/') ->setHref('/transactions/raw/'.$xaction_phid.'/')
->setName(pht('View Remarkup')) ->setName(pht('View Raw Remarkup'))
->addSigil('transaction-raw') ->addSigil('transaction-raw')
->setMetadata( ->setMetadata(
array( array(

View file

@ -921,7 +921,7 @@ JX.install('DiffInline', {
for (var ii = 0; ii < this._menuItems.length; ii++) { for (var ii = 0; ii < this._menuItems.length; ii++) {
var spec = this._menuItems[ii]; var spec = this._menuItems[ii];
var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action); var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action, spec);
var item = new JX.PHUIXActionView() var item = new JX.PHUIXActionView()
.setIcon(spec.icon) .setIcon(spec.icon)
@ -938,7 +938,7 @@ JX.install('DiffInline', {
return items; return items;
}, },
_onMenuItem: function(menu, action, e) { _onMenuItem: function(menu, action, spec, e) {
e.prevent(); e.prevent();
menu.close(); menu.close();
@ -958,6 +958,10 @@ JX.install('DiffInline', {
case 'edit': case 'edit':
this.edit(); this.edit();
break; break;
case 'raw':
new JX.Workflow(spec.uri)
.start();
break;
} }
}, },