mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-17 10:11:10 +01:00
Modernize "users" typeahead datasource
Summary: Ref T4420. Modernize users. Test Plan: - Edited "Commit Authors" on Audit search. - Edited "Created By" on calendar search. - Edited "invited" on calendar search. - Edited "To" on "New conpherence message". - Edited user on "Add user to conpherence thread". - Edited "Authors" on countdown search. - Edited "Author" on differential search. - Edited "Responsible users" on differential search. - Edited "Owner" on Diffusion lint search. - Edited "include users" on Feed search. - Edited "Authors" on file search. - Edited "Authors" on Herald rule search. - Edited a couple of user-selecting Herald fields on rules. - Edited "user" on legalpad signature exemption. - Edited "creator" on legalpad search. - Edited "contributors" on legalpad search. - Edited "signers" on legalpad signature search. - Edited "Authors" on macro search. - Edited "Reassign/claim" on task detail. - Edited "assigned to" on task edit. - Edited "assigned to", "users projects", "authors" on task search. - Edited "creators" on oauthserver. - Edited "authors" on paste search. - Edited "actors" and "users" on activity log search. - Edited "authors" on pholio search. - Edited "users" on phrequent search. - Edited "authors", "answered by" on Ponder search. - Edited "add members" on project membership editor. - Edited "members" on project search. - Edited "pushers" on releeph product edit. - Edited "requestors" on releeph request search. - Edited "pushers" on diffusion push log. - Edited "authors", "owners", "subscribers" on global search. - Edited "authors" on slowvote search. - Edited users in custom policy. - Grepped for "common/authors", no hits. - Grepped for "common/users", no (relevant) hits. - Grepped for "common/accounts", no (relevant) hits. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T4420 Differential Revision: https://secure.phabricator.com/D9885
This commit is contained in:
parent
086fe952e6
commit
dcc6997793
38 changed files with 185 additions and 64 deletions
|
@ -414,7 +414,7 @@ return array(
|
|||
'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'ab8d2723',
|
||||
'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef',
|
||||
'rsrc/js/application/policy/behavior-policy-control.js' => 'f3fef818',
|
||||
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '92918fcb',
|
||||
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '0ea85aa3',
|
||||
'rsrc/js/application/ponder/behavior-votebox.js' => '4e9b766b',
|
||||
'rsrc/js/application/projects/behavior-boards-dropdown.js' => '0ec56e1d',
|
||||
'rsrc/js/application/projects/behavior-project-boards.js' => 'c6b95cbd',
|
||||
|
@ -641,7 +641,7 @@ return array(
|
|||
'javelin-behavior-phui-object-box-tabs' => 'a3e2244e',
|
||||
'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3',
|
||||
'javelin-behavior-policy-control' => 'f3fef818',
|
||||
'javelin-behavior-policy-rule-editor' => '92918fcb',
|
||||
'javelin-behavior-policy-rule-editor' => '0ea85aa3',
|
||||
'javelin-behavior-ponder-votebox' => '4e9b766b',
|
||||
'javelin-behavior-project-boards' => 'c6b95cbd',
|
||||
'javelin-behavior-project-create' => '065227cc',
|
||||
|
@ -899,6 +899,17 @@ return array(
|
|||
3 => 'javelin-util',
|
||||
4 => 'phabricator-notification-css',
|
||||
),
|
||||
'0ea85aa3' => array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'multirow-row-manager',
|
||||
2 => 'javelin-dom',
|
||||
3 => 'javelin-util',
|
||||
4 => 'phabricator-prefab',
|
||||
5 => 'javelin-tokenizer',
|
||||
6 => 'javelin-typeahead',
|
||||
7 => 'javelin-typeahead-ondemand-source',
|
||||
8 => 'javelin-json',
|
||||
),
|
||||
'0ec56e1d' => array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'javelin-dom',
|
||||
|
@ -1450,17 +1461,6 @@ return array(
|
|||
1 => 'javelin-uri',
|
||||
2 => 'phabricator-notification',
|
||||
),
|
||||
'92918fcb' => array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'multirow-row-manager',
|
||||
2 => 'javelin-dom',
|
||||
3 => 'javelin-util',
|
||||
4 => 'phabricator-prefab',
|
||||
5 => 'javelin-tokenizer',
|
||||
6 => 'javelin-typeahead',
|
||||
7 => 'javelin-typeahead-preloaded-source',
|
||||
8 => 'javelin-json',
|
||||
),
|
||||
'92eb531d' => array(
|
||||
0 => 'javelin-behavior',
|
||||
1 => 'javelin-dom',
|
||||
|
|
|
@ -1910,6 +1910,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPeopleCalendarController' => 'applications/people/controller/PhabricatorPeopleCalendarController.php',
|
||||
'PhabricatorPeopleController' => 'applications/people/controller/PhabricatorPeopleController.php',
|
||||
'PhabricatorPeopleCreateController' => 'applications/people/controller/PhabricatorPeopleCreateController.php',
|
||||
'PhabricatorPeopleDatasource' => 'applications/people/typeahead/PhabricatorPeopleDatasource.php',
|
||||
'PhabricatorPeopleDeleteController' => 'applications/people/controller/PhabricatorPeopleDeleteController.php',
|
||||
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
|
||||
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
|
||||
|
@ -4711,6 +4712,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPeopleCalendarController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleController' => 'PhabricatorController',
|
||||
'PhabricatorPeopleCreateController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorPeopleDeleteController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
|
||||
|
|
|
@ -91,7 +91,7 @@ final class PhabricatorCommitSearchEngine
|
|||
->setValue(array_select_keys($handles, $auditor_phids)))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Commit Authors'))
|
||||
->setValue(array_select_keys($handles, $commit_author_phids)))
|
||||
|
|
|
@ -106,13 +106,13 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('creators')
|
||||
->setLabel(pht('Created By'))
|
||||
->setValue($creator_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('invited')
|
||||
->setLabel(pht('Invited'))
|
||||
->setValue($invited_handles))
|
||||
|
|
|
@ -82,7 +82,7 @@ final class ConpherenceNewController extends ConpherenceController {
|
|||
->setName('participants')
|
||||
->setValue($participant_handles)
|
||||
->setUser($user)
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setLabel(pht('To'))
|
||||
->setError($e_participants))
|
||||
->appendChild(
|
||||
|
|
|
@ -206,7 +206,7 @@ final class ConpherenceUpdateController
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setName('add_person')
|
||||
->setUser($user)
|
||||
->setDatasource('/typeahead/common/users/'));
|
||||
->setDatasource(new PhabricatorPeopleDatasource()));
|
||||
|
||||
require_celerity_resource('conpherence-update-css');
|
||||
return id(new AphrontDialogView())
|
||||
|
|
|
@ -51,7 +51,7 @@ final class PhabricatorCountdownSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -143,13 +143,13 @@ final class DifferentialRevisionSearchEngine
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Responsible Users'))
|
||||
->setName('responsibles')
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue(array_select_keys($handles, $responsible_phids)))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Authors'))
|
||||
->setName('authors')
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue(array_select_keys($handles, $author_phids)))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
|
|
|
@ -112,7 +112,7 @@ final class DiffusionLintController extends DiffusionController {
|
|||
->setMethod('GET')
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setLimit(1)
|
||||
->setName('owner')
|
||||
->setLabel(pht('Owner'))
|
||||
|
|
|
@ -78,7 +78,7 @@ final class PhabricatorFeedSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('users')
|
||||
->setLabel(pht('Include Users'))
|
||||
->setValue($user_handles))
|
||||
|
|
|
@ -61,7 +61,7 @@ final class PhabricatorFileSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -596,12 +596,12 @@ final class HeraldRuleController extends HeraldController {
|
|||
'arcanistprojects' => new DiffusionArcanistProjectDatasource(),
|
||||
'package' => new PhabricatorOwnersPackageDatasource(),
|
||||
'project' => new PhabricatorProjectDatasource(),
|
||||
'user' => new PhabricatorPeopleDatasource(),
|
||||
);
|
||||
|
||||
$sources = mpull($sources, 'getDatasourceURI');
|
||||
$sources += array(
|
||||
'email' => '/typeahead/common/mailable/',
|
||||
'user' => '/typeahead/common/accounts/',
|
||||
'userorproject' => '/typeahead/common/accountsorprojects/',
|
||||
);
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ final class HeraldRuleSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -130,7 +130,7 @@ final class LegalpadDocumentSignatureAddController extends LegalpadController {
|
|||
->setLabel(pht('Exempt User'))
|
||||
->setName('users')
|
||||
->setLimit(1)
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($user_handles)
|
||||
->setError($e_user));
|
||||
} else {
|
||||
|
|
|
@ -95,13 +95,13 @@ final class LegalpadDocumentSearchEngine
|
|||
->setDisabled(!$this->requireViewer()->getPHID()))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('creators')
|
||||
->setLabel(pht('Creators'))
|
||||
->setValue(array_select_keys($handles, $creator_phids)))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('contributors')
|
||||
->setLabel(pht('Contributors'))
|
||||
->setValue(array_select_keys($handles, $contributor_phids)));
|
||||
|
|
|
@ -99,7 +99,7 @@ final class LegalpadDocumentSignatureSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('signers')
|
||||
->setLabel(pht('Signers'))
|
||||
->setValue(array_select_keys($handles, $signer_phids)))
|
||||
|
|
|
@ -93,7 +93,7 @@ final class PhabricatorMacroSearchEngine
|
|||
->setValue($status))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -283,6 +283,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
);
|
||||
|
||||
$projects_source = new PhabricatorProjectDatasource();
|
||||
$users_source = new PhabricatorPeopleDatasource();
|
||||
|
||||
$tokenizer_map = array(
|
||||
ManiphestTransaction::TYPE_PROJECTS => array(
|
||||
|
@ -292,10 +293,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
),
|
||||
ManiphestTransaction::TYPE_OWNER => array(
|
||||
'id' => 'assign-tokenizer',
|
||||
'src' => '/typeahead/common/users/',
|
||||
'src' => $users_source->getDatasourceURI(),
|
||||
'value' => $default_claim,
|
||||
'limit' => 1,
|
||||
'placeholder' => pht('Type a user name...'),
|
||||
'placeholder' => $users_source->getPlaceholderText(),
|
||||
),
|
||||
ManiphestTransaction::TYPE_CCS => array(
|
||||
'id' => 'cc-tokenizer',
|
||||
|
|
|
@ -602,7 +602,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
->setName('assigned_to')
|
||||
->setValue($assigned_value)
|
||||
->setUser($user)
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setLimit(1));
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ final class ManiphestTaskSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('assigned')
|
||||
->setLabel(pht('Assigned To'))
|
||||
->setValue($assigned_handles))
|
||||
|
@ -353,13 +353,13 @@ final class ManiphestTaskSearchEngine
|
|||
->setValue($exclude_project_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('userProjects')
|
||||
->setLabel(pht('In Users\' Projects'))
|
||||
->setValue($user_project_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -45,7 +45,7 @@ final class PhabricatorOAuthServerClientSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('creators')
|
||||
->setLabel(pht('Creators'))
|
||||
->setValue($creator_handles));
|
||||
|
|
|
@ -67,7 +67,7 @@ final class PhabricatorPasteSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -124,13 +124,13 @@ final class PhabricatorPeopleLogSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('actors')
|
||||
->setLabel(pht('Actors'))
|
||||
->setValue($actor_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('users')
|
||||
->setLabel(pht('Users'))
|
||||
->setValue($user_handles))
|
||||
|
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorPeopleDatasource
|
||||
extends PhabricatorTypeaheadDatasource {
|
||||
|
||||
public function getPlaceholderText() {
|
||||
return pht('Type a username...');
|
||||
}
|
||||
|
||||
public function getDatasourceApplicationClass() {
|
||||
return 'PhabricatorApplicationPeople';
|
||||
}
|
||||
|
||||
public function loadResults() {
|
||||
$viewer = $this->getViewer();
|
||||
$raw_query = $this->getRawQuery();
|
||||
|
||||
$results = array();
|
||||
|
||||
$users = array();
|
||||
if (strlen($raw_query)) {
|
||||
// This is an arbitrary limit which is just larger than any limit we
|
||||
// actually use in the application.
|
||||
|
||||
// TODO: The datasource should pass this in the query.
|
||||
$limit = 15;
|
||||
|
||||
$user_table = new PhabricatorUser();
|
||||
$conn_r = $user_table->establishConnection('r');
|
||||
$ids = queryfx_all(
|
||||
$conn_r,
|
||||
'SELECT id FROM %T WHERE username LIKE %>
|
||||
ORDER BY username ASC LIMIT %d',
|
||||
$user_table->getTableName(),
|
||||
$raw_query,
|
||||
$limit);
|
||||
$ids = ipull($ids, 'id');
|
||||
|
||||
if (count($ids) < $limit) {
|
||||
// If we didn't find enough username hits, look for real name hits.
|
||||
// We need to pull the entire pagesize so that we end up with the
|
||||
// right number of items if this query returns many duplicate IDs
|
||||
// that we've already selected.
|
||||
|
||||
$realname_ids = queryfx_all(
|
||||
$conn_r,
|
||||
'SELECT DISTINCT userID FROM %T WHERE token LIKE %>
|
||||
ORDER BY token ASC LIMIT %d',
|
||||
PhabricatorUser::NAMETOKEN_TABLE,
|
||||
$raw_query,
|
||||
$limit);
|
||||
$realname_ids = ipull($realname_ids, 'userID');
|
||||
$ids = array_merge($ids, $realname_ids);
|
||||
|
||||
$ids = array_unique($ids);
|
||||
$ids = array_slice($ids, 0, $limit);
|
||||
}
|
||||
|
||||
// Always add the logged-in user because some tokenizers autosort them
|
||||
// first. They'll be filtered out on the client side if they don't
|
||||
// match the query.
|
||||
if ($viewer->getID()) {
|
||||
$ids[] = $viewer->getID();
|
||||
}
|
||||
|
||||
if ($ids) {
|
||||
$users = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs($ids)
|
||||
->execute();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Restore this when mainsearch moves here.
|
||||
/*
|
||||
|
||||
if ($need_rich_data) {
|
||||
$phids = mpull($users, 'getPHID');
|
||||
$handles = $this->loadViewerHandles($phids);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
foreach ($users as $user) {
|
||||
$closed = null;
|
||||
if ($user->getIsDisabled()) {
|
||||
$closed = pht('Disabled');
|
||||
} else if ($user->getIsSystemAgent()) {
|
||||
$closed = pht('Bot/Script');
|
||||
}
|
||||
|
||||
$result = id(new PhabricatorTypeaheadResult())
|
||||
->setName($user->getFullName())
|
||||
->setURI('/p/'.$user->getUsername())
|
||||
->setPHID($user->getPHID())
|
||||
->setPriorityString($user->getUsername())
|
||||
->setIcon('fa-user bluegrey')
|
||||
->setPriorityType('user')
|
||||
->setClosed($closed);
|
||||
|
||||
// TODO: Restore this too.
|
||||
/*
|
||||
|
||||
if ($need_rich_data) {
|
||||
$display_type = 'User';
|
||||
if ($user->getIsAdmin()) {
|
||||
$display_type = 'Administrator';
|
||||
}
|
||||
$result->setDisplayType($display_type);
|
||||
$result->setImageURI($handles[$user->getPHID()]->getImageURI());
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$results[] = $result;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
|
@ -55,7 +55,7 @@ final class PholioMockSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -69,7 +69,7 @@ final class PhrequentSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('users')
|
||||
->setLabel(pht('Users'))
|
||||
->setValue($handles))
|
||||
|
|
|
@ -21,10 +21,12 @@ final class PhabricatorPolicyRuleUsers
|
|||
}
|
||||
|
||||
public function getValueControlTemplate() {
|
||||
$users_datasource = new PhabricatorPeopleDatasource();
|
||||
|
||||
return array(
|
||||
'markup' => new AphrontTokenizerTemplateView(),
|
||||
'uri' => '/typeahead/common/accounts/',
|
||||
'placeholder' => pht('Type a user name...'),
|
||||
'uri' => $users_datasource->getDatasourceURI(),
|
||||
'placeholder' => $users_datasource->getPlaceholderText(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,13 +73,13 @@ final class PonderQuestionSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue(array_select_keys($handles, $author_phids)))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('answerers')
|
||||
->setLabel(pht('Answered By'))
|
||||
->setValue(array_select_keys($handles, $answerer_phids)))
|
||||
|
|
|
@ -83,7 +83,7 @@ final class PhabricatorProjectMembersEditController
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setName('phids')
|
||||
->setLabel(pht('Add Members'))
|
||||
->setDatasource('/typeahead/common/accounts/'))
|
||||
->setDatasource(new PhabricatorPeopleDatasource()))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->addCancelButton('/project/view/'.$project->getID().'/')
|
||||
|
|
|
@ -63,7 +63,7 @@ final class PhabricatorProjectSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('members')
|
||||
->setLabel(pht('Members'))
|
||||
->setValue($member_handles))
|
||||
|
|
|
@ -194,7 +194,7 @@ final class ReleephProductEditController extends ReleephProductController {
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Pushers'))
|
||||
->setName('pushers')
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($pusher_handles))
|
||||
->appendChild($branch_template_input)
|
||||
->appendChild($branch_template_preview)
|
||||
|
|
|
@ -84,7 +84,7 @@ final class ReleephRequestSearchEngine
|
|||
->setOptions($this->getSeverityOptions()))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('requestors')
|
||||
->setLabel(pht('Requestors'))
|
||||
->setValue($requestor_handles));
|
||||
|
|
|
@ -80,7 +80,7 @@ final class PhabricatorRepositoryPushLogSearchEngine
|
|||
->setValue($repository_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('pushers')
|
||||
->setLabel(pht('Pushers'))
|
||||
->setValue($pusher_handles));
|
||||
|
|
|
@ -136,7 +136,7 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setName('authorPHIDs')
|
||||
->setLabel('Authors')
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($author_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
|
@ -155,7 +155,7 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setName('subscriberPHIDs')
|
||||
->setLabel('Subscribers')
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($subscriber_handles))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
|
|
|
@ -55,7 +55,7 @@ final class PhabricatorSlowvoteSearchEngine
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setDatasource('/typeahead/common/users/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setName('authors')
|
||||
->setLabel(pht('Authors'))
|
||||
->setValue($author_handles))
|
||||
|
|
|
@ -48,11 +48,6 @@ final class PhabricatorTypeaheadCommonDatasourceController
|
|||
$need_projs = true;
|
||||
$need_noproject = true;
|
||||
break;
|
||||
case 'users':
|
||||
case 'accounts':
|
||||
case 'authors':
|
||||
$need_users = true;
|
||||
break;
|
||||
case 'mailable':
|
||||
case 'allmailable':
|
||||
$need_users = true;
|
||||
|
|
|
@ -18,7 +18,7 @@ final class PhabricatorStandardCustomFieldUsers
|
|||
$control = id(new AphrontFormTokenizerControl())
|
||||
->setLabel($this->getFieldName())
|
||||
->setName($this->getFieldKey())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setCaption($this->getCaption())
|
||||
->setValue($control_value);
|
||||
|
||||
|
@ -39,7 +39,7 @@ final class PhabricatorStandardCustomFieldUsers
|
|||
$control = id(new AphrontFormTokenizerControl())
|
||||
->setLabel($this->getFieldName())
|
||||
->setName($this->getFieldKey())
|
||||
->setDatasource('/typeahead/common/accounts/')
|
||||
->setDatasource(new PhabricatorPeopleDatasource())
|
||||
->setValue($handles);
|
||||
|
||||
$form->appendChild($control);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* phabricator-prefab
|
||||
* javelin-tokenizer
|
||||
* javelin-typeahead
|
||||
* javelin-typeahead-preloaded-source
|
||||
* javelin-typeahead-ondemand-source
|
||||
* javelin-json
|
||||
*/
|
||||
JX.behavior('policy-rule-editor', function(config) {
|
||||
|
@ -124,7 +124,7 @@ JX.behavior('policy-rule-editor', function(config) {
|
|||
node = JX.$H(template.markup).getNode();
|
||||
node.id = '';
|
||||
|
||||
var datasource = new JX.TypeaheadPreloadedSource(template.uri);
|
||||
var datasource = new JX.TypeaheadOnDemandSource(template.uri);
|
||||
|
||||
var typeahead = new JX.Typeahead(node);
|
||||
typeahead.setDatasource(datasource);
|
||||
|
|
Loading…
Reference in a new issue