diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'core.pkg.css' => '6d8c526d', - 'core.pkg.js' => '46bc8dbd', + 'core.pkg.js' => 'c60f35d8', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', 'differential.pkg.js' => '6223dd9d', @@ -244,7 +244,7 @@ 'rsrc/externals/javelin/lib/__tests__/URI.js' => '1e45fda9', 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783', 'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a', - 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '9fef18a5', + 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'c431f925', 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '70baed2f', 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'e6e25838', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', @@ -704,7 +704,7 @@ 'javelin-scrollbar' => '087e919c', 'javelin-sound' => '949c0fe5', 'javelin-stratcom' => '6c53634d', - 'javelin-tokenizer' => '9fef18a5', + 'javelin-tokenizer' => 'c431f925', 'javelin-typeahead' => '70baed2f', 'javelin-typeahead-composite-source' => '503e17fd', 'javelin-typeahead-normalizer' => 'e6e25838', @@ -1581,12 +1581,6 @@ 'javelin-dom', 'javelin-vector', ), - '9fef18a5' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - ), 'a0b57eb8' => array( 'javelin-behavior', 'javelin-dom', @@ -1783,6 +1777,12 @@ 'javelin-dom', 'javelin-vector', ), + 'c431f925' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + ), 'c72aa091' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -163,7 +163,10 @@ $can_create = (bool)$edit_config; if ($can_create) { $form_key = $edit_config->getIdentifier(); - $edit_uri = "/task/edit/form/{$form_key}/?parent={$id}&template={$id}"; + $edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/")) + ->setQueryParam('parent', $id) + ->setQueryParam('template', $id) + ->setQueryParam('status', ManiphestTaskStatus::getDefaultStatus()); $edit_uri = $this->getApplicationURI($edit_uri); } else { // TODO: This will usually give us a somewhat-reasonable error page, but diff --git a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js --- a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js +++ b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js @@ -428,16 +428,23 @@ if (this.getBrowseURI()) { var button = JX.DOM.find(this._frame, 'a', 'tokenizer-browse'); - JX.DOM.alterClass(button, 'disabled', !!this._isAtTokenLimit()); + JX.DOM.alterClass(button, 'disabled', !!this._shouldLockBrowse()); } this.invoke('change', this); }, - _isAtTokenLimit: function() { + _shouldLockBrowse: function() { var limit = this.getLimit(); if (!limit) { + // If there's no limit, never lock the browse button. + return false; + } + + if (limit == 1) { + // If the limit is 1, we'll replace the current token if the + // user selects a new one, so we never need to lock the button. return false; } @@ -486,7 +493,7 @@ return; } - if (this._isAtTokenLimit()) { + if (this._shouldLockBrowse()) { return; } @@ -498,6 +505,14 @@ source.addResult(r.token); var result = source.getResult(r.key); + // If we have a limit of 1 token, replace the current token with + // the new token if we currently have a token. + if (this.getLimit() == 1) { + for (var k in this.getTokens()) { + this.removeToken(k); + } + } + this.addToken(r.key, result.name); this.focus(); }))