Modernize "repositories" typeahead datasource

Summary:
Ref T4420.

  - Allow tokenizers to accept either a `Datasource` object (new style) or a URI (old style).
  - Read URI and placeholder text from object, if available.
  - Swap the "repositories" datasource (which seemed like the simplest one) over to the new stuff.
  - Tweak/update the repo tokens a little bit.

Test Plan:
  - Used tokenizer in Herald, Differential (search), Differential (edit), Push Logs.
  - Grepped for other callsites.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4420

Differential Revision: https://secure.phabricator.com/D9874
This commit is contained in:
epriestley
2014-07-10 16:18:04 -07:00
parent e281c5ee90
commit 34628002fd
10 changed files with 66 additions and 28 deletions

View File

@@ -74,7 +74,7 @@ final class PhabricatorRepositoryPushLogSearchEngine
$form
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/repositories/')
->setDatasource(new DiffusionRepositoryDatasource())
->setName('repositories')
->setLabel(pht('Repositories'))
->setValue($repository_handles))