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

Give custom controls passable disabled states

Summary: Fixes T9871. Ref T10004. These won't win any awards but it fixes them being incredibly weird and confusing.

Test Plan:
{F1029090}

- Tried to use controls, got reasonable behavior.
- Used normal controls to make sure I didn't break anything.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9871, T10004

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

+95 -58
+47 -47
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '8378907a', 11 - 'core.pkg.js' => '5058979d', 10 + 'core.pkg.css' => 'cc8abd0e', 11 + 'core.pkg.js' => 'e0379ae5', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 14 'differential.pkg.js' => '6223dd9d', ··· 132 132 'rsrc/css/phui/phui-feed-story.css' => 'b7b26d23', 133 133 'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 134 134 'rsrc/css/phui/phui-form-view.css' => 'cf7da606', 135 - 'rsrc/css/phui/phui-form.css' => 'afdb2c6e', 135 + 'rsrc/css/phui/phui-form.css' => '0b98e572', 136 136 'rsrc/css/phui/phui-header-view.css' => '55bb32dd', 137 137 'rsrc/css/phui/phui-icon.css' => 'b0a6b1b6', 138 138 'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8', ··· 244 244 'rsrc/externals/javelin/lib/__tests__/URI.js' => '1e45fda9', 245 245 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783', 246 246 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', 247 - 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'c431f925', 247 + 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '8d3bc1b2', 248 248 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '70baed2f', 249 249 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'e6e25838', 250 250 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', ··· 415 415 'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '3f5d6dbf', 416 416 'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'fc91ab6c', 417 417 'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef', 418 - 'rsrc/js/application/policy/behavior-policy-control.js' => '7d470398', 418 + 'rsrc/js/application/policy/behavior-policy-control.js' => 'ae45872f', 419 419 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c', 420 420 'rsrc/js/application/projects/behavior-project-boards.js' => 'ba4fa35c', 421 421 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', ··· 456 456 'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f', 457 457 'rsrc/js/core/MultirowRowManager.js' => 'b5d57730', 458 458 'rsrc/js/core/Notification.js' => 'ccf1cbf8', 459 - 'rsrc/js/core/Prefab.js' => 'be38fe4e', 459 + 'rsrc/js/core/Prefab.js' => '666c80c5', 460 460 'rsrc/js/core/ShapedRequest.js' => '7cbe244b', 461 461 'rsrc/js/core/TextAreaUtils.js' => '5c93c52c', 462 462 'rsrc/js/core/Title.js' => 'df5e11d2', ··· 486 486 'rsrc/js/core/behavior-object-selector.js' => '49b73b36', 487 487 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', 488 488 'rsrc/js/core/behavior-phabricator-nav.js' => '56a1ca03', 489 - 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'eeaa9e5a', 489 + 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'c14b5995', 490 490 'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b', 491 491 'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45', 492 492 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', ··· 639 639 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 640 640 'javelin-behavior-phabricator-object-selector' => '49b73b36', 641 641 'javelin-behavior-phabricator-oncopy' => '2926fff2', 642 - 'javelin-behavior-phabricator-remarkup-assist' => 'eeaa9e5a', 642 + 'javelin-behavior-phabricator-remarkup-assist' => 'c14b5995', 643 643 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 644 644 'javelin-behavior-phabricator-search-typeahead' => '048330fa', 645 645 'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6', ··· 651 651 'javelin-behavior-pholio-mock-view' => 'fbe497e7', 652 652 'javelin-behavior-phui-dropdown-menu' => '54733475', 653 653 'javelin-behavior-phui-object-box-tabs' => '2bfa2836', 654 - 'javelin-behavior-policy-control' => '7d470398', 654 + 'javelin-behavior-policy-control' => 'ae45872f', 655 655 'javelin-behavior-policy-rule-editor' => '5e9f347c', 656 656 'javelin-behavior-project-boards' => 'ba4fa35c', 657 657 'javelin-behavior-project-create' => '065227cc', ··· 702 702 'javelin-scrollbar' => '087e919c', 703 703 'javelin-sound' => '949c0fe5', 704 704 'javelin-stratcom' => '6c53634d', 705 - 'javelin-tokenizer' => 'c431f925', 705 + 'javelin-tokenizer' => '8d3bc1b2', 706 706 'javelin-typeahead' => '70baed2f', 707 707 'javelin-typeahead-composite-source' => '503e17fd', 708 708 'javelin-typeahead-normalizer' => 'e6e25838', ··· 757 757 'phabricator-notification-menu-css' => 'f31c0bde', 758 758 'phabricator-object-selector-css' => '85ee8ce6', 759 759 'phabricator-phtize' => 'd254d646', 760 - 'phabricator-prefab' => 'be38fe4e', 760 + 'phabricator-prefab' => '666c80c5', 761 761 'phabricator-remarkup-css' => '275e362f', 762 762 'phabricator-search-results-css' => '7dea472c', 763 763 'phabricator-shaped-request' => '7cbe244b', ··· 804 804 'phui-feed-story-css' => 'b7b26d23', 805 805 'phui-font-icon-base-css' => 'ecbbb4c2', 806 806 'phui-fontkit-css' => '9cda225e', 807 - 'phui-form-css' => 'afdb2c6e', 807 + 'phui-form-css' => '0b98e572', 808 808 'phui-form-view-css' => 'cf7da606', 809 809 'phui-header-view-css' => '55bb32dd', 810 810 'phui-icon-view-css' => 'b0a6b1b6', ··· 1293 1293 'javelin-vector', 1294 1294 'differential-inline-comment-editor', 1295 1295 ), 1296 + '666c80c5' => array( 1297 + 'javelin-install', 1298 + 'javelin-util', 1299 + 'javelin-dom', 1300 + 'javelin-typeahead', 1301 + 'javelin-tokenizer', 1302 + 'javelin-typeahead-preloaded-source', 1303 + 'javelin-typeahead-ondemand-source', 1304 + 'javelin-dom', 1305 + 'javelin-stratcom', 1306 + 'javelin-util', 1307 + ), 1296 1308 '6882e80a' => array( 1297 1309 'javelin-dom', 1298 1310 ), ··· 1391 1403 'javelin-request', 1392 1404 'javelin-router', 1393 1405 ), 1394 - '7d470398' => array( 1395 - 'javelin-behavior', 1396 - 'javelin-dom', 1397 - 'javelin-util', 1398 - 'phuix-dropdown-menu', 1399 - 'phuix-action-list-view', 1400 - 'phuix-action-view', 1401 - 'javelin-workflow', 1402 - ), 1403 1406 '7e41274a' => array( 1404 1407 'javelin-install', 1405 1408 ), ··· 1496 1499 'javelin-dom', 1497 1500 'javelin-util', 1498 1501 ), 1502 + '8d3bc1b2' => array( 1503 + 'javelin-dom', 1504 + 'javelin-util', 1505 + 'javelin-stratcom', 1506 + 'javelin-install', 1507 + ), 1499 1508 '8ef9ab58' => array( 1500 1509 'javelin-behavior', 1501 1510 'javelin-dom', ··· 1645 1654 'javelin-uri', 1646 1655 'phabricator-file-upload', 1647 1656 ), 1657 + 'ae45872f' => array( 1658 + 'javelin-behavior', 1659 + 'javelin-dom', 1660 + 'javelin-util', 1661 + 'phuix-dropdown-menu', 1662 + 'phuix-action-list-view', 1663 + 'phuix-action-view', 1664 + 'javelin-workflow', 1665 + ), 1648 1666 'b064af76' => array( 1649 1667 'javelin-behavior', 1650 1668 'javelin-stratcom', ··· 1741 1759 'javelin-util', 1742 1760 'javelin-request', 1743 1761 ), 1744 - 'be38fe4e' => array( 1762 + 'bff6884b' => array( 1745 1763 'javelin-install', 1746 - 'javelin-util', 1747 1764 'javelin-dom', 1748 - 'javelin-typeahead', 1749 - 'javelin-tokenizer', 1750 - 'javelin-typeahead-preloaded-source', 1751 - 'javelin-typeahead-ondemand-source', 1752 - 'javelin-dom', 1765 + ), 1766 + 'c14b5995' => array( 1767 + 'javelin-behavior', 1753 1768 'javelin-stratcom', 1754 - 'javelin-util', 1755 - ), 1756 - 'bff6884b' => array( 1757 - 'javelin-install', 1758 1769 'javelin-dom', 1770 + 'phabricator-phtize', 1771 + 'phabricator-textareautils', 1772 + 'javelin-workflow', 1773 + 'javelin-vector', 1759 1774 ), 1760 1775 'c1700f6f' => array( 1761 1776 'javelin-install', ··· 1763 1778 'javelin-stratcom', 1764 1779 'javelin-dom', 1765 1780 'javelin-vector', 1766 - ), 1767 - 'c431f925' => array( 1768 - 'javelin-dom', 1769 - 'javelin-util', 1770 - 'javelin-stratcom', 1771 - 'javelin-install', 1772 1781 ), 1773 1782 'c72aa091' => array( 1774 1783 'javelin-behavior', ··· 1960 1969 'edf8a145' => array( 1961 1970 'javelin-behavior', 1962 1971 'javelin-uri', 1963 - ), 1964 - 'eeaa9e5a' => array( 1965 - 'javelin-behavior', 1966 - 'javelin-stratcom', 1967 - 'javelin-dom', 1968 - 'phabricator-phtize', 1969 - 'phabricator-textareautils', 1970 - 'javelin-workflow', 1971 - 'javelin-vector', 1972 1972 ), 1973 1973 'efe49472' => array( 1974 1974 'javelin-install',
+2
src/view/form/control/AphrontFormPolicyControl.php
··· 272 272 'capability' => $this->capability, 273 273 'editURI' => '/policy/edit/'.$context_path, 274 274 'customPlaceholder' => $this->getCustomPolicyPlaceholder(), 275 + 'disabled' => $this->getDisabled(), 275 276 )); 276 277 277 278 $selected = idx($flat_options, $this->getValue(), array()); ··· 350 351 $viewer, 351 352 $space_phid), 352 353 array( 354 + 'disabled' => $this->getDisabled(), 353 355 'name' => 'spacePHID', 354 356 'class' => 'aphront-space-select-control-knob', 355 357 ));
+1
src/view/form/control/AphrontFormTokenizerControl.php
··· 112 112 'username' => $username, 113 113 'placeholder' => $placeholder, 114 114 'browseURI' => $browse_uri, 115 + 'disabled' => $this->getDisabled(), 115 116 )); 116 117 } 117 118
+19 -9
src/view/form/control/PhabricatorRemarkupControl.php
··· 31 31 // currently ship JS or CSS. 32 32 require_celerity_resource('lightbox-attachment-css'); 33 33 34 - Javelin::initBehavior( 35 - 'aphront-drag-and-drop-textarea', 36 - array( 37 - 'target' => $id, 38 - 'activatedClass' => 'aphront-textarea-drag-and-drop', 39 - 'uri' => '/file/dropupload/', 40 - 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), 41 - )); 34 + if (!$this->getDisabled()) { 35 + Javelin::initBehavior( 36 + 'aphront-drag-and-drop-textarea', 37 + array( 38 + 'target' => $id, 39 + 'activatedClass' => 'aphront-textarea-drag-and-drop', 40 + 'uri' => '/file/dropupload/', 41 + 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), 42 + )); 43 + } 42 44 43 45 Javelin::initBehavior( 44 46 'phabricator-remarkup-assist', ··· 53 55 'name' => pht('name'), 54 56 'URL' => pht('URL'), 55 57 ), 58 + 'disabled' => $this->getDisabled(), 56 59 )); 57 60 Javelin::initBehavior('phabricator-tooltips', array()); 58 61 ··· 175 178 $tip); 176 179 } 177 180 181 + $sigils = array(); 182 + $sigils[] = 'remarkup-assist'; 183 + if (!$this->getDisabled()) { 184 + $sigils[] = 'has-tooltip'; 185 + } 186 + 178 187 $buttons[] = javelin_tag( 179 188 'a', 180 189 array( 181 190 'class' => implode(' ', $classes), 182 191 'href' => $href, 183 - 'sigil' => 'remarkup-assist has-tooltip', 192 + 'sigil' => implode(' ', $sigils), 184 193 'meta' => $meta, 185 194 'mustcapture' => $mustcapture, 186 195 'target' => $target, ··· 220 229 'div', 221 230 array( 222 231 'sigil' => 'remarkup-assist-control', 232 + 'class' => $this->getDisabled() ? 'disabled-control' : null, 223 233 ), 224 234 array( 225 235 $buttons,
+3 -1
webroot/rsrc/css/phui/phui-form.css
··· 142 142 } 143 143 144 144 select[disabled], 145 - input[disabled] { 145 + input[disabled], 146 + textarea[disabled], 147 + .disabled-control { 146 148 opacity: 0.5; 147 149 } 148 150
+7 -1
webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
··· 46 46 properties : { 47 47 limit : null, 48 48 renderTokenCallback : null, 49 - browseURI: null 49 + browseURI: null, 50 + disabled: false 50 51 }, 51 52 52 53 members : { ··· 65 66 _placeholder : null, 66 67 67 68 start : function() { 69 + if (this.getDisabled()) { 70 + JX.DOM.alterClass(this._containerNode, 'disabled-control', true); 71 + return; 72 + } 73 + 68 74 if (__DEV__) { 69 75 if (!this._typeahead) { 70 76 throw new Error(
+8
webroot/rsrc/js/application/policy/behavior-policy-control.js
··· 14 14 var input = JX.$(config.inputID); 15 15 var value = config.value; 16 16 17 + if (config.disabled) { 18 + JX.DOM.alterClass(control, 'disabled-control', true); 19 + JX.DOM.listen(control, 'click', null, function(e) { 20 + e.kill(); 21 + }); 22 + return; 23 + } 24 + 17 25 var menu = new JX.PHUIXDropdownMenu(control) 18 26 .setWidth(260) 19 27 .setAlign('left');
+4
webroot/rsrc/js/core/Prefab.js
··· 240 240 tokenizer.setBrowseURI(config.browseURI); 241 241 } 242 242 243 + if (config.disabled) { 244 + tokenizer.setDisabled(true); 245 + } 246 + 243 247 JX.Stratcom.addData(root, {'tokenizer' : tokenizer}); 244 248 245 249 return {
+4
webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
··· 196 196 197 197 e.kill(); 198 198 199 + if (config.disabled) { 200 + return; 201 + } 202 + 199 203 var root = e.getNode('remarkup-assist-control'); 200 204 var area = JX.DOM.find(root, 'textarea'); 201 205