Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14029491
D14094.id34063.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D14094.id34063.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
@@ -11,7 +11,7 @@
'core.pkg.js' => '47dc9ebb',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
- 'differential.pkg.js' => '52d725be',
+ 'differential.pkg.js' => '6223dd9d',
'diffusion.pkg.css' => '385e85b3',
'diffusion.pkg.js' => '0115b37c',
'maniphest.pkg.css' => '4845691a',
@@ -357,13 +357,13 @@
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/differential/ChangesetViewManager.js' => '58562350',
- 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4',
+ 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f',
'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18',
'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d',
'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb',
- 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '037b59eb',
+ 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '65ef6074',
'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492',
'rsrc/js/application/differential/behavior-populate.js' => '8694b1df',
'rsrc/js/application/differential/behavior-toggle-files.js' => 'ca3f91eb',
@@ -517,7 +517,7 @@
'conpherence-widget-pane-css' => '775eaaba',
'differential-changeset-view-css' => 'b6b0d1bb',
'differential-core-view-css' => '7ac3cabc',
- 'differential-inline-comment-editor' => 'd4c87bf4',
+ 'differential-inline-comment-editor' => '64a5550f',
'differential-revision-add-comment-css' => 'c47f8c40',
'differential-revision-comment-css' => '14b8565a',
'differential-revision-history-css' => '0e8eb855',
@@ -568,7 +568,7 @@
'javelin-behavior-differential-comment-jump' => '4fdb476d',
'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
'javelin-behavior-differential-dropdown-menus' => '2035b9cb',
- 'javelin-behavior-differential-edit-inline-comments' => '037b59eb',
+ 'javelin-behavior-differential-edit-inline-comments' => '65ef6074',
'javelin-behavior-differential-feedback-preview' => 'b064af76',
'javelin-behavior-differential-keyboard-navigation' => '2c426492',
'javelin-behavior-differential-populate' => '8694b1df',
@@ -853,14 +853,6 @@
'javelin-behavior-device',
'phabricator-title',
),
- '037b59eb' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-dom',
- 'javelin-util',
- 'javelin-vector',
- 'differential-inline-comment-editor',
- ),
'048330fa' => array(
'javelin-behavior',
'javelin-typeahead-ondemand-source',
@@ -1289,6 +1281,22 @@
'javelin-workflow',
'javelin-dom',
),
+ '64a5550f' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ 'javelin-request',
+ 'javelin-workflow',
+ ),
+ '65ef6074' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-vector',
+ 'differential-inline-comment-editor',
+ ),
'665cf6ac' => array(
'javelin-behavior',
'javelin-util',
@@ -1817,14 +1825,6 @@
'javelin-dom',
'javelin-view',
),
- 'd4c87bf4' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- 'javelin-request',
- 'javelin-workflow',
- ),
'd4eecc63' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php
--- a/src/infrastructure/diff/PhabricatorInlineCommentController.php
+++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php
@@ -94,6 +94,19 @@
$op = $this->getOperation();
switch ($op) {
+ case 'busy':
+ if ($request->isFormPost()) {
+ return new AphrontAjaxResponse();
+ }
+
+ return $this->newDialog()
+ ->setTitle(pht('Already Editing'))
+ ->appendParagraph(
+ pht(
+ 'You are already editing an inline comment. Finish editing '.
+ 'your current comment before adding new comments.'))
+ ->addCancelButton('/')
+ ->addSubmitButton(pht('Jump to Inline'));
case 'hide':
case 'show':
if (!$request->validateCSRF()) {
diff --git a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
--- a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
+++ b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js
@@ -250,11 +250,29 @@
JX.DifferentialInlineCommentEditor._undoRows = rows;
},
+ _onBusyWorkflow: function() {
+ // If the user clicks the "Jump to Inline" button, scroll to the row
+ // being edited.
+ JX.DOM.scrollTo(this.getRow());
+ },
+
start : function() {
- this._registerUndoListener();
+ var op = this.getOperation();
+
+ // The user is already editing a comment, we're going to give them an
+ // error message.
+ if (op == 'busy') {
+ var onbusy = JX.bind(this, this._onBusyWorkflow);
+ new JX.Workflow(this._uri, {op: op})
+ .setHandler(onbusy)
+ .start();
+
+ return this;
+ }
+
+ this._registerUndoListener();
var data = this._buildRequestData();
- var op = this.getOperation();
if (op == 'delete' || op == 'refdelete' || op == 'undelete') {
this._setRowState('loading');
diff --git a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
--- a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
+++ b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js
@@ -138,13 +138,23 @@
'mousedown',
['differential-changeset', 'tag:th'],
function(e) {
- if (editor ||
- selecting ||
- e.isRightButton() ||
+ if (e.isRightButton() ||
getRowNumber(e.getTarget()) === undefined) {
return;
}
+ if (editor) {
+ new JX.DifferentialInlineCommentEditor(config.uri)
+ .setOperation('busy')
+ .setRow(editor.getRow().previousSibling)
+ .start();
+ return;
+ }
+
+ if (selecting) {
+ return;
+ }
+
selecting = true;
root = e.getNode('differential-changeset');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 8:45 PM (3 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715343
Default Alt Text
D14094.id34063.diff (7 KB)
Attached To
Mode
D14094: Show users what's wrong when they try to edit an inline with an editor already open
Attached
Detach File
Event Timeline
Log In to Comment