@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 inline "ContentState" a client object, and track "hasSuggestion" on it

Summary:
Ref T13559. In an effort to ultimately fix the "quote + cancel" bug, begin formalizing content states on the client.

This creates a "ContentState" client object and moves the authoritative storage for the "hasSuggestion" property to it.

Test Plan: Created inlines, etc. See followups.

Maniphest Tasks: T13559

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

+48 -9
+13 -6
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' => 'd1150814', 16 + 'differential.pkg.js' => '5e0c7197', 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' => '511a1315', 388 + 'rsrc/js/application/diff/DiffInline.js' => '09e0c6e5', 389 + 'rsrc/js/application/diff/DiffInlineContentState.js' => 'cb9e5396', 389 390 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 390 391 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 391 392 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', ··· 787 788 'phabricator-dashboard-css' => '5a205b9d', 788 789 'phabricator-diff-changeset' => 'd7d3ba75', 789 790 'phabricator-diff-changeset-list' => 'cc2c5de5', 790 - 'phabricator-diff-inline' => '511a1315', 791 + 'phabricator-diff-inline' => '09e0c6e5', 792 + 'phabricator-diff-inline-content-state' => 'cb9e5396', 791 793 'phabricator-diff-path-view' => '8207abf9', 792 794 'phabricator-diff-tree-view' => '5d83623b', 793 795 'phabricator-drag-and-drop-file-upload' => '4370900d', ··· 998 1000 'herald-rule-editor', 999 1001 'javelin-behavior', 1000 1002 ), 1003 + '09e0c6e5' => array( 1004 + 'javelin-dom', 1005 + 'phabricator-diff-inline-content-state', 1006 + ), 1001 1007 '0ad8d31f' => array( 1002 1008 'javelin-behavior', 1003 1009 'javelin-stratcom', ··· 1397 1403 '506aa3f4' => array( 1398 1404 'javelin-behavior', 1399 1405 'javelin-stratcom', 1400 - 'javelin-dom', 1401 - ), 1402 - '511a1315' => array( 1403 1406 'javelin-dom', 1404 1407 ), 1405 1408 '5202e831' => array( ··· 2086 2089 'javelin-workflow', 2087 2090 'javelin-json', 2088 2091 ), 2092 + 'cb9e5396' => array( 2093 + 'javelin-dom', 2094 + ), 2089 2095 'cc2c5de5' => array( 2090 2096 'javelin-install', 2091 2097 'phuix-button-view', ··· 2441 2447 'javelin-behavior-phabricator-object-selector', 2442 2448 'javelin-behavior-repository-crossreference', 2443 2449 'javelin-behavior-aphront-more', 2450 + 'phabricator-diff-inline-content-state', 2444 2451 'phabricator-diff-inline', 2445 2452 'phabricator-diff-changeset', 2446 2453 'phabricator-diff-changeset-list',
+1
resources/celerity/packages.php
··· 212 212 213 213 'javelin-behavior-aphront-more', 214 214 215 + 'phabricator-diff-inline-content-state', 215 216 'phabricator-diff-inline', 216 217 'phabricator-diff-changeset', 217 218 'phabricator-diff-changeset-list',
+12 -3
webroot/rsrc/js/application/diff/DiffInline.js
··· 1 1 /** 2 2 * @provides phabricator-diff-inline 3 3 * @requires javelin-dom 4 + * phabricator-diff-inline-content-state 4 5 * @javelin 5 6 */ 6 7 7 8 JX.install('DiffInline', { 8 9 9 10 construct : function() { 11 + this._activeContentState = new JX.DiffInlineContentState(); 10 12 }, 11 13 12 14 members: { ··· 52 54 _endOffset: null, 53 55 _isSelected: false, 54 56 _canSuggestEdit: false, 57 + 58 + _activeContentState: null, 55 59 56 60 bindToRow: function(row) { 57 61 this._row = row; ··· 785 789 this.triggerDraft(); 786 790 }, 787 791 792 + _getActiveContentState: function() { 793 + return this._activeContentState; 794 + }, 795 + 788 796 setHasSuggestion: function(has_suggestion) { 789 - this._hasSuggestion = has_suggestion; 797 + var state = this._getActiveContentState(); 798 + state.setHasSuggestion(has_suggestion); 790 799 791 800 var button = this._getSuggestionButton(); 792 801 var pht = this.getChangeset().getChangesetList().getTranslations(); ··· 806 815 }, 807 816 808 817 getHasSuggestion: function() { 809 - return this._hasSuggestion; 818 + return this._getActiveContentState().getHasSuggestion(); 810 819 }, 811 820 812 821 save: function() { ··· 920 929 state.suggestionText = node.value; 921 930 } 922 931 923 - state.hasSuggestion = this.getHasSuggestion(); 932 + state.hasSuggestion = this._getActiveContentState().getHasSuggestion(); 924 933 925 934 return state; 926 935 },
+22
webroot/rsrc/js/application/diff/DiffInlineContentState.js
··· 1 + /** 2 + * @provides phabricator-diff-inline-content-state 3 + * @requires javelin-dom 4 + * @javelin 5 + */ 6 + 7 + JX.install('DiffInlineContentState', { 8 + 9 + construct : function() { 10 + 11 + }, 12 + 13 + properties: { 14 + text: null, 15 + suggestionText: null, 16 + hasSuggestion: false 17 + }, 18 + 19 + members: { 20 + } 21 + 22 + });