1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-27 07:50:57 +01:00

Fix an issue where "Browse > Select" did not work for dynamic tokenizers

Summary:
Ref T4100. In Herald, using the browse dialog to select a result didn't work because we'd add the token with no name value. Other things would render it elsewhere, but it would eventaully be discarded.

Instead, add it with a name value.

Test Plan: Edited a Herald rule and used Browse > Select to add a token. Saved rule. Saw token persist.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4100

Differential Revision: https://secure.phabricator.com/D12529
This commit is contained in:
epriestley 2015-04-23 06:15:06 -07:00
parent f69f53124c
commit ccd6770a09

View file

@ -465,8 +465,12 @@ JX.install('Tokenizer', {
new JX.Workflow(uri, {exclude: JX.keys(this.getTokens()).join(',')})
.setHandler(
JX.bind(this, function(r) {
this._typeahead.getDatasource().addResult(r.token);
this.addToken(r.key);
var source = this._typeahead.getDatasource();
source.addResult(r.token);
var result = source.getResult(r.key);
this.addToken(r.key, result.name);
this.focus();
}))
.start();