@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 "Delete" from inline comment previews function correctly while editing comments

Summary: Ref T13513. Currently, if you're editing a comment, "delete" doesn't put the comment into the correct state. This action is normally only reachable from comment previews, since an editing inline has no "delete" button.

Test Plan:
- Started editing an inline, clicked "Delete", got a deletion.
- Created an inline, typed text,
- Deleted a normal comment via preview.
- Deleted a normal comment via the on-inline action.

Maniphest Tasks: T13513

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

+26 -18
+6 -6
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '1e667bcb', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => 'd71d4531', 16 - 'differential.pkg.js' => '30307170', 16 + 'differential.pkg.js' => '5be7941a', 17 17 'diffusion.pkg.css' => '42c75c37', 18 18 'diffusion.pkg.js' => 'a98c0bf7', 19 19 'maniphest.pkg.css' => '35995d6d', ··· 381 381 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 382 382 'rsrc/js/application/diff/DiffChangeset.js' => '700bf848', 383 383 'rsrc/js/application/diff/DiffChangesetList.js' => '6e668c5b', 384 - 'rsrc/js/application/diff/DiffInline.js' => 'db754a7b', 384 + 'rsrc/js/application/diff/DiffInline.js' => '9a3963e0', 385 385 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 386 386 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 387 387 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', ··· 776 776 'phabricator-dashboard-css' => '5a205b9d', 777 777 'phabricator-diff-changeset' => '700bf848', 778 778 'phabricator-diff-changeset-list' => '6e668c5b', 779 - 'phabricator-diff-inline' => 'db754a7b', 779 + 'phabricator-diff-inline' => '9a3963e0', 780 780 'phabricator-diff-path-view' => '8207abf9', 781 781 'phabricator-diff-tree-view' => '5d83623b', 782 782 'phabricator-drag-and-drop-file-upload' => '4370900d', ··· 1808 1808 'javelin-request', 1809 1809 'javelin-router', 1810 1810 ), 1811 + '9a3963e0' => array( 1812 + 'javelin-dom', 1813 + ), 1811 1814 '9aae2b66' => array( 1812 1815 'javelin-install', 1813 1816 'javelin-util', ··· 2116 2119 'javelin-behavior', 2117 2120 'javelin-uri', 2118 2121 'phabricator-notification', 2119 - ), 2120 - 'db754a7b' => array( 2121 - 'javelin-dom', 2122 2122 ), 2123 2123 'e150bd50' => array( 2124 2124 'javelin-behavior',
+20 -12
webroot/rsrc/js/application/diff/DiffInline.js
··· 438 438 op = 'delete'; 439 439 } 440 440 441 - // If there's an existing "unedit" undo element, remove it. 442 - if (this._undoRow) { 443 - JX.DOM.remove(this._undoRow); 444 - this._undoRow = null; 445 - } 446 - 447 441 var data = this._newRequestData(op); 448 442 449 443 this.setLoading(true); ··· 540 534 }, 541 535 542 536 _ondeleteresponse: function() { 543 - this._drawUndeleteRows(); 537 + // If there's an existing "unedit" undo element, remove it. 538 + if (this._undoRow) { 539 + JX.DOM.remove(this._undoRow); 540 + this._undoRow = null; 541 + } 542 + 543 + // If there's an existing editor, remove it. This happens when you 544 + // delete a comment from the comment preview area. In this case, we 545 + // read and preserve the text so "Undo" restores it. 546 + var text; 547 + if (this._editRow) { 548 + text = this._readText(this._editRow); 549 + JX.DOM.remove(this._editRow); 550 + this._editRow = null; 551 + } 552 + 553 + this._drawUndeleteRows(text); 544 554 545 555 this.setLoading(false); 546 556 this.setDeleted(true); ··· 548 558 this._didUpdate(); 549 559 }, 550 560 551 - _drawUndeleteRows: function() { 561 + _drawUndeleteRows: function(text) { 552 562 this._undoType = 'undelete'; 553 - this._undoText = null; 563 + this._undoText = text || null; 554 564 555 565 return this._drawUndoRows('undelete', this._row); 556 566 }, ··· 649 659 }, 650 660 651 661 undo: function() { 652 - 653 662 JX.DOM.remove(this._undoRow); 654 663 this._undoRow = null; 655 664 ··· 666 675 .send(); 667 676 } 668 677 669 - if (this._undoType === 'unedit') { 678 + if (this._undoText !== null) { 670 679 this.edit(this._undoText); 671 680 } 672 - 673 681 }, 674 682 675 683 _onundelete: function() {