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

Have "limit=1" tokenizers replace tokens instead of disabling "Browse"

Summary:
Fixes T9984. When a tokenizer only allows one selection (like "Task Owner:" or "Land Onto Branch:"), keep the browse button active but have it //replace// values.

Also, have "Create Subtask" default to the system default status, so subtasks of closed tasks are not also closed.

Test Plan:
- Browsed an empty limit=1 tokenizer.
- Replaced a full limit=1 tokenizer.
- Browsed an empty no-limit tokenizer.
- Browsed more tokens into the no-limit tokenizer.
- Typed some tokens normally.
- Created a subtask of a closed task.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9984

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

+31 -13
+9 -9
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '6d8c526d', 11 - 'core.pkg.js' => '46bc8dbd', 11 + 'core.pkg.js' => 'c60f35d8', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '2de124c9', 14 14 'differential.pkg.js' => '6223dd9d', ··· 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' => '9fef18a5', 247 + 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'c431f925', 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', ··· 704 704 'javelin-scrollbar' => '087e919c', 705 705 'javelin-sound' => '949c0fe5', 706 706 'javelin-stratcom' => '6c53634d', 707 - 'javelin-tokenizer' => '9fef18a5', 707 + 'javelin-tokenizer' => 'c431f925', 708 708 'javelin-typeahead' => '70baed2f', 709 709 'javelin-typeahead-composite-source' => '503e17fd', 710 710 'javelin-typeahead-normalizer' => 'e6e25838', ··· 1581 1581 'javelin-dom', 1582 1582 'javelin-vector', 1583 1583 ), 1584 - '9fef18a5' => array( 1585 - 'javelin-dom', 1586 - 'javelin-util', 1587 - 'javelin-stratcom', 1588 - 'javelin-install', 1589 - ), 1590 1584 'a0b57eb8' => array( 1591 1585 'javelin-behavior', 1592 1586 'javelin-dom', ··· 1782 1776 'javelin-stratcom', 1783 1777 'javelin-dom', 1784 1778 'javelin-vector', 1779 + ), 1780 + 'c431f925' => array( 1781 + 'javelin-dom', 1782 + 'javelin-util', 1783 + 'javelin-stratcom', 1784 + 'javelin-install', 1785 1785 ), 1786 1786 'c72aa091' => array( 1787 1787 'javelin-behavior',
+4 -1
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 163 163 $can_create = (bool)$edit_config; 164 164 if ($can_create) { 165 165 $form_key = $edit_config->getIdentifier(); 166 - $edit_uri = "/task/edit/form/{$form_key}/?parent={$id}&template={$id}"; 166 + $edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/")) 167 + ->setQueryParam('parent', $id) 168 + ->setQueryParam('template', $id) 169 + ->setQueryParam('status', ManiphestTaskStatus::getDefaultStatus()); 167 170 $edit_uri = $this->getApplicationURI($edit_uri); 168 171 } else { 169 172 // TODO: This will usually give us a somewhat-reasonable error page, but
+18 -3
webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
··· 428 428 429 429 if (this.getBrowseURI()) { 430 430 var button = JX.DOM.find(this._frame, 'a', 'tokenizer-browse'); 431 - JX.DOM.alterClass(button, 'disabled', !!this._isAtTokenLimit()); 431 + JX.DOM.alterClass(button, 'disabled', !!this._shouldLockBrowse()); 432 432 } 433 433 434 434 this.invoke('change', this); 435 435 }, 436 436 437 - _isAtTokenLimit: function() { 437 + _shouldLockBrowse: function() { 438 438 var limit = this.getLimit(); 439 439 440 440 if (!limit) { 441 + // If there's no limit, never lock the browse button. 442 + return false; 443 + } 444 + 445 + if (limit == 1) { 446 + // If the limit is 1, we'll replace the current token if the 447 + // user selects a new one, so we never need to lock the button. 441 448 return false; 442 449 } 443 450 ··· 486 493 return; 487 494 } 488 495 489 - if (this._isAtTokenLimit()) { 496 + if (this._shouldLockBrowse()) { 490 497 return; 491 498 } 492 499 ··· 497 504 498 505 source.addResult(r.token); 499 506 var result = source.getResult(r.key); 507 + 508 + // If we have a limit of 1 token, replace the current token with 509 + // the new token if we currently have a token. 510 + if (this.getLimit() == 1) { 511 + for (var k in this.getTokens()) { 512 + this.removeToken(k); 513 + } 514 + } 500 515 501 516 this.addToken(r.key, result.name); 502 517 this.focus();