@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.

Remove direct reads of form state from main Inline client code

Summary:
Ref T13559. Instead of directly reading form state, make all callers use the "active" state instead. The state reads the form.

No functional changes, just clarifying responsiblites.

Test Plan: Created inlines, etc. See followup changes.

Maniphest Tasks: T13559

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

+10 -32
+7 -7
resources/celerity/map.php
··· 13 13 'core.pkg.js' => 'ab3502fe', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => 'ffb69e3d', 16 - 'differential.pkg.js' => '68a2e7be', 16 + 'differential.pkg.js' => '442567d7', 17 17 'diffusion.pkg.css' => '42c75c37', 18 18 'diffusion.pkg.js' => '78c9885d', 19 19 'maniphest.pkg.css' => '35995d6d', ··· 385 385 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 386 386 'rsrc/js/application/diff/DiffChangeset.js' => 'd7d3ba75', 387 387 'rsrc/js/application/diff/DiffChangesetList.js' => 'cc2c5de5', 388 - 'rsrc/js/application/diff/DiffInline.js' => 'a5f196da', 388 + 'rsrc/js/application/diff/DiffInline.js' => 'fdebbba6', 389 389 'rsrc/js/application/diff/DiffInlineContentState.js' => '68e6339d', 390 390 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 391 391 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', ··· 788 788 'phabricator-dashboard-css' => '5a205b9d', 789 789 'phabricator-diff-changeset' => 'd7d3ba75', 790 790 'phabricator-diff-changeset-list' => 'cc2c5de5', 791 - 'phabricator-diff-inline' => 'a5f196da', 791 + 'phabricator-diff-inline' => 'fdebbba6', 792 792 'phabricator-diff-inline-content-state' => '68e6339d', 793 793 'phabricator-diff-path-view' => '8207abf9', 794 794 'phabricator-diff-tree-view' => '5d83623b', ··· 1871 1871 'javelin-install', 1872 1872 'javelin-dom', 1873 1873 ), 1874 - 'a5f196da' => array( 1875 - 'javelin-dom', 1876 - 'phabricator-diff-inline-content-state', 1877 - ), 1878 1874 'a77e2cbd' => array( 1879 1875 'javelin-behavior', 1880 1876 'javelin-stratcom', ··· 2234 2230 ), 2235 2231 'fdc13e4e' => array( 2236 2232 'javelin-install', 2233 + ), 2234 + 'fdebbba6' => array( 2235 + 'javelin-dom', 2236 + 'phabricator-diff-inline-content-state', 2237 2237 ), 2238 2238 'ff688a7a' => array( 2239 2239 'owners-path-editor',
+3 -25
webroot/rsrc/js/application/diff/DiffInline.js
··· 612 612 // read and preserve the text so "Undo" restores it. 613 613 var state = null; 614 614 if (this._editRow) { 615 - state = this._readFormState(this._editRow); 615 + state = this._getActiveContentState().getWireFormat(); 616 616 JX.DOM.remove(this._editRow); 617 617 this._editRow = null; 618 618 } ··· 856 856 }, 857 857 858 858 cancel: function() { 859 - var state = this._readFormState(this._editRow); 859 + var state = this._getActiveContentState().getWireFormat(); 860 860 861 861 JX.DOM.remove(this._editRow); 862 862 this._editRow = null; ··· 907 907 908 908 this._didUpdate(); 909 909 } 910 - }, 911 - 912 - _readFormState: function(row) { 913 - var state = this._newContentState(); 914 - 915 - var node; 916 - 917 - try { 918 - node = JX.DOM.find(row, 'textarea', 'inline-content-text'); 919 - state.text = node.value; 920 - } catch (ex) { 921 - // Ignore. 922 - } 923 - 924 - node = this._getSuggestionNode(row); 925 - if (node) { 926 - state.suggestionText = node.value; 927 - } 928 - 929 - state.hasSuggestion = this._getActiveContentState().getHasSuggestion(); 930 - 931 - return state; 932 910 }, 933 911 934 912 _getSuggestionNode: function(row) { ··· 1043 1021 return null; 1044 1022 } 1045 1023 1046 - var state = this._readFormState(this._editRow); 1024 + var state = this._getActiveContentState().getWireFormat(); 1047 1025 if (this._isVoidContentState(state)) { 1048 1026 return null; 1049 1027 }