mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Always pass handles to tokenizers, not <phid -> name>
maps
Summary: Ref T1279. Prerequisite for adding icons or other type information to tokenizers, since we don't currently have enough information to prefill them when rendering things from the server side. By passing handles in, the tokenizer can extract type information. Test Plan: - Searched by user in Audit. - Sent Conpherence from profile page. - Tried to send an empty conpherence. - Searched Countdown by user. - Edited CCs in Differential. - Edited reviewers in Differential. - Edited a commit's projects. - Searched lint by owner. - Searched feed by owner/project. - Searched files by owner. - Searched Herald by owner. - Searched Legalpad by owner. - Searched Macro by owner. - Filtered Maniphest reports by project. - Edited CCs in Maniphest. - Searched Owners by owner. - Edited an Owners package. - Searched Paste by owner. - Searched activity logs by owner. - Searched for mocks by owner. - Edited a mock's CCs. - Searched Ponder by owner. - Searched projects by owner. - Edited a Releeph project's pushers. - Searched Releeph by requestor. - Edited "Uses Symbols" for an Arcanist project. - Edited all tokenizers in main search. - Searched Slowvote by user. Reviewers: chad, btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1279 Differential Revision: https://secure.phabricator.com/D7248
This commit is contained in:
parent
2abbd51868
commit
0598600476
28 changed files with 66 additions and 119 deletions
|
@ -139,9 +139,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
|
||||||
|
|
||||||
$tok_value = null;
|
$tok_value = null;
|
||||||
if ($handle) {
|
if ($handle) {
|
||||||
$tok_value = array(
|
$tok_value = array($handle);
|
||||||
$handle->getPHID() => $handle->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$form->appendChild(
|
$form->appendChild(
|
||||||
|
|
|
@ -11,15 +11,12 @@ final class ConpherenceNewController extends ConpherenceController {
|
||||||
|
|
||||||
$title = pht('New Message');
|
$title = pht('New Message');
|
||||||
$participants = array();
|
$participants = array();
|
||||||
|
$participant_prefill = null;
|
||||||
$message = '';
|
$message = '';
|
||||||
$e_participants = null;
|
$e_participants = null;
|
||||||
$e_message = null;
|
$e_message = null;
|
||||||
|
|
||||||
// this comes from ajax requests from all over. should be a single phid.
|
// this comes from ajax requests from all over. should be a single phid.
|
||||||
$participant_prefill = $request->getStr('participant');
|
|
||||||
if ($participant_prefill) {
|
|
||||||
$participants[] = $participant_prefill;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
$participants = $request->getArr('participants');
|
$participants = $request->getArr('participants');
|
||||||
|
@ -47,15 +44,20 @@ final class ConpherenceNewController extends ConpherenceController {
|
||||||
return id(new AphrontRedirectResponse())
|
return id(new AphrontRedirectResponse())
|
||||||
->setURI($uri);
|
->setURI($uri);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$participant_prefill = $request->getStr('participant');
|
||||||
|
if ($participant_prefill) {
|
||||||
|
$participants[] = $participant_prefill;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$participant_handles = array();
|
$participant_handles = array();
|
||||||
if ($participants) {
|
if ($participants) {
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$participant_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->withPHIDs($participants)
|
->withPHIDs($participants)
|
||||||
->execute();
|
->execute();
|
||||||
$participant_handles = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$submit_uri = $this->getApplicationURI('new/');
|
$submit_uri = $this->getApplicationURI('new/');
|
||||||
|
@ -64,7 +66,7 @@ final class ConpherenceNewController extends ConpherenceController {
|
||||||
// TODO - we can get a better cancel_uri once we get better at crazy
|
// TODO - we can get a better cancel_uri once we get better at crazy
|
||||||
// ajax jonx T2086
|
// ajax jonx T2086
|
||||||
if ($participant_prefill) {
|
if ($participant_prefill) {
|
||||||
$handle = $handles[$participant_prefill];
|
$handle = $participant_handles[$participant_prefill];
|
||||||
$cancel_uri = $handle->getURI();
|
$cancel_uri = $handle->getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,10 @@ final class PhabricatorCountdownSearchEngine
|
||||||
AphrontFormView $form,
|
AphrontFormView $form,
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$upcoming = $saved_query->getParameter('upcoming');
|
$upcoming = $saved_query->getParameter('upcoming');
|
||||||
|
|
||||||
|
@ -47,7 +46,7 @@ final class PhabricatorCountdownSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCheckboxControl())
|
id(new AphrontFormCheckboxControl())
|
||||||
->addCheckbox(
|
->addCheckbox(
|
||||||
|
|
|
@ -50,7 +50,7 @@ final class DifferentialCCsFieldSpecification
|
||||||
public function renderEditControl() {
|
public function renderEditControl() {
|
||||||
$cc_map = array();
|
$cc_map = array();
|
||||||
foreach ($this->ccs as $phid) {
|
foreach ($this->ccs as $phid) {
|
||||||
$cc_map[$phid] = $this->getHandle($phid)->getFullName();
|
$cc_map[] = $this->getHandle($phid);
|
||||||
}
|
}
|
||||||
return id(new AphrontFormTokenizerControl())
|
return id(new AphrontFormTokenizerControl())
|
||||||
->setLabel('CC')
|
->setLabel('CC')
|
||||||
|
|
|
@ -89,7 +89,7 @@ final class DifferentialReviewersFieldSpecification
|
||||||
public function renderEditControl() {
|
public function renderEditControl() {
|
||||||
$reviewer_map = array();
|
$reviewer_map = array();
|
||||||
foreach ($this->reviewers as $phid) {
|
foreach ($this->reviewers as $phid) {
|
||||||
$reviewer_map[$phid] = $this->getHandle($phid)->getFullName();
|
$reviewer_map[] = $this->getHandle($phid);
|
||||||
}
|
}
|
||||||
return id(new AphrontFormTokenizerControl())
|
return id(new AphrontFormTokenizerControl())
|
||||||
->setLabel(pht('Reviewers'))
|
->setLabel(pht('Reviewers'))
|
||||||
|
|
|
@ -27,7 +27,7 @@ final class DiffusionCommitEditController extends DiffusionController {
|
||||||
$commit_phid,
|
$commit_phid,
|
||||||
$edge_type);
|
$edge_type);
|
||||||
$handles = $this->loadViewerHandles($current_proj_phids);
|
$handles = $this->loadViewerHandles($current_proj_phids);
|
||||||
$proj_t_values = mpull($handles, 'getFullName', 'getPHID');
|
$proj_t_values = $handles;
|
||||||
|
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
$proj_phids = $request->getArr('projects');
|
$proj_phids = $request->getArr('projects');
|
||||||
|
|
|
@ -21,18 +21,14 @@ final class DiffusionLintController extends DiffusionController {
|
||||||
$owners = array();
|
$owners = array();
|
||||||
if (!$drequest) {
|
if (!$drequest) {
|
||||||
if (!$request->getArr('owner')) {
|
if (!$request->getArr('owner')) {
|
||||||
if ($user->isLoggedIn()) {
|
$owners = array($user->getPHID());
|
||||||
$owners[$user->getPHID()] = $user->getFullName();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$phids = $request->getArr('owner');
|
$owners = array(head($request->getArr('owner')));
|
||||||
$phid = reset($phids);
|
|
||||||
$handles = $this->loadViewerHandles(array($phid));
|
|
||||||
$owners[$phid] = $handles[$phid]->getFullName();
|
|
||||||
}
|
}
|
||||||
|
$owner_handles = $this->loadViewerHandles($owners);
|
||||||
}
|
}
|
||||||
|
|
||||||
$codes = $this->loadLintCodes(array_keys($owners));
|
$codes = $this->loadLintCodes($owners);
|
||||||
|
|
||||||
if ($codes && !$drequest) {
|
if ($codes && !$drequest) {
|
||||||
// TODO: Build some real Query classes for this stuff.
|
// TODO: Build some real Query classes for this stuff.
|
||||||
|
@ -125,7 +121,7 @@ final class DiffusionLintController extends DiffusionController {
|
||||||
->setLimit(1)
|
->setLimit(1)
|
||||||
->setName('owner')
|
->setName('owner')
|
||||||
->setLabel(pht('Owner'))
|
->setLabel(pht('Owner'))
|
||||||
->setValue($owners))
|
->setValue($owner_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue('Filter'));
|
->setValue('Filter'));
|
||||||
|
|
|
@ -66,9 +66,8 @@ final class PhabricatorFeedSearchEngine
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$tokens = mpull($handles, 'getFullName', 'getPHID');
|
$user_handles = array_select_keys($handles, $user_phids);
|
||||||
$user_tokens = array_select_keys($tokens, $user_phids);
|
$proj_handles = array_select_keys($handles, $proj_phids);
|
||||||
$proj_tokens = array_select_keys($tokens, $proj_phids);
|
|
||||||
|
|
||||||
$viewer_projects = $saved_query->getParameter('viewerProjects');
|
$viewer_projects = $saved_query->getParameter('viewerProjects');
|
||||||
|
|
||||||
|
@ -78,13 +77,13 @@ final class PhabricatorFeedSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('users')
|
->setName('users')
|
||||||
->setLabel(pht('Include Users'))
|
->setLabel(pht('Include Users'))
|
||||||
->setValue($user_tokens))
|
->setValue($user_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setDatasource('/typeahead/common/projects/')
|
->setDatasource('/typeahead/common/projects/')
|
||||||
->setName('projectPHIDs')
|
->setName('projectPHIDs')
|
||||||
->setLabel(pht('Include Projects'))
|
->setLabel(pht('Include Projects'))
|
||||||
->setValue($proj_tokens))
|
->setValue($proj_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCheckboxControl())
|
id(new AphrontFormCheckboxControl())
|
||||||
->addCheckbox(
|
->addCheckbox(
|
||||||
|
|
|
@ -46,11 +46,10 @@ final class PhabricatorFileSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$explicit = $saved_query->getParameter('explicit');
|
$explicit = $saved_query->getParameter('explicit');
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ final class PhabricatorFileSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCheckboxControl())
|
id(new AphrontFormCheckboxControl())
|
||||||
->addCheckbox(
|
->addCheckbox(
|
||||||
|
|
|
@ -52,11 +52,10 @@ final class HeraldRuleSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$content_type = $saved_query->getParameter('contentType');
|
$content_type = $saved_query->getParameter('contentType');
|
||||||
$rule_type = $saved_query->getParameter('ruleType');
|
$rule_type = $saved_query->getParameter('ruleType');
|
||||||
|
@ -67,7 +66,7 @@ final class HeraldRuleSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setName('contentType')
|
->setName('contentType')
|
||||||
|
|
|
@ -53,7 +53,6 @@ final class LegalpadDocumentSearchEngine
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -61,13 +60,13 @@ final class LegalpadDocumentSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('creators')
|
->setName('creators')
|
||||||
->setLabel(pht('Creators'))
|
->setLabel(pht('Creators'))
|
||||||
->setValue(array_select_keys($tokens, $creator_phids)))
|
->setValue(array_select_keys($handles, $creator_phids)))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('contributors')
|
->setName('contributors')
|
||||||
->setLabel(pht('Contributors'))
|
->setLabel(pht('Contributors'))
|
||||||
->setValue(array_select_keys($tokens, $contributor_phids)));
|
->setValue(array_select_keys($handles, $contributor_phids)));
|
||||||
|
|
||||||
$this->buildDateRange(
|
$this->buildDateRange(
|
||||||
$form,
|
$form,
|
||||||
|
|
|
@ -66,11 +66,10 @@ final class PhabricatorMacroSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$status = $saved_query->getParameter('status');
|
$status = $saved_query->getParameter('status');
|
||||||
$names = implode(', ', $saved_query->getParameter('names', array()));
|
$names = implode(', ', $saved_query->getParameter('names', array()));
|
||||||
|
@ -89,7 +88,7 @@ final class PhabricatorMacroSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setName('nameLike')
|
->setName('nameLike')
|
||||||
|
|
|
@ -265,9 +265,7 @@ final class ManiphestReportController extends ManiphestController {
|
||||||
|
|
||||||
$tokens = array();
|
$tokens = array();
|
||||||
if ($handle) {
|
if ($handle) {
|
||||||
$tokens = array(
|
$tokens = array($handle);
|
||||||
$handle->getPHID() => $handle->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter = $this->renderReportFilters($tokens, $has_window = false);
|
$filter = $this->renderReportFilters($tokens, $has_window = false);
|
||||||
|
@ -635,9 +633,7 @@ final class ManiphestReportController extends ManiphestController {
|
||||||
|
|
||||||
$tokens = array();
|
$tokens = array();
|
||||||
if ($project_handle) {
|
if ($project_handle) {
|
||||||
$tokens = array(
|
$tokens = array($project_handle);
|
||||||
$project_handle->getPHID() => $project_handle->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
$filter = $this->renderReportFilters($tokens, $has_window = true);
|
$filter = $this->renderReportFilters($tokens, $has_window = true);
|
||||||
|
|
||||||
|
|
|
@ -343,8 +343,6 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
|
|
||||||
$handles = $this->loadViewerHandles($phids);
|
$handles = $this->loadViewerHandles($phids);
|
||||||
|
|
||||||
$tvalues = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$error_view = null;
|
$error_view = null;
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$error_view = new AphrontErrorView();
|
$error_view = new AphrontErrorView();
|
||||||
|
@ -355,21 +353,19 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
||||||
|
|
||||||
if ($task->getOwnerPHID()) {
|
if ($task->getOwnerPHID()) {
|
||||||
$assigned_value = array(
|
$assigned_value = array($handles[$task->getOwnerPHID()]);
|
||||||
$task->getOwnerPHID() => $handles[$task->getOwnerPHID()]->getFullName(),
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
$assigned_value = array();
|
$assigned_value = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($task->getCCPHIDs()) {
|
if ($task->getCCPHIDs()) {
|
||||||
$cc_value = array_select_keys($tvalues, $task->getCCPHIDs());
|
$cc_value = array_select_keys($handles, $task->getCCPHIDs());
|
||||||
} else {
|
} else {
|
||||||
$cc_value = array();
|
$cc_value = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($task->getProjectPHIDs()) {
|
if ($task->getProjectPHIDs()) {
|
||||||
$projects_value = array_select_keys($tvalues, $task->getProjectPHIDs());
|
$projects_value = array_select_keys($handles, $task->getProjectPHIDs());
|
||||||
} else {
|
} else {
|
||||||
$projects_value = array();
|
$projects_value = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,15 +123,12 @@ final class PhabricatorOwnersEditController
|
||||||
|
|
||||||
$primary = $package->getPrimaryOwnerPHID();
|
$primary = $package->getPrimaryOwnerPHID();
|
||||||
if ($primary && isset($handles[$primary])) {
|
if ($primary && isset($handles[$primary])) {
|
||||||
$token_primary_owner = array(
|
$handle_primary_owner = array($handles[$primary]);
|
||||||
$primary => $handles[$primary]->getFullName(),
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
$token_primary_owner = array();
|
$handle_primary_owner = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$token_all_owners = array_select_keys($handles, $owners);
|
$handles_all_owners = array_select_keys($handles, $owners);
|
||||||
$token_all_owners = mpull($token_all_owners, 'getFullName');
|
|
||||||
|
|
||||||
if ($package->getID()) {
|
if ($package->getID()) {
|
||||||
$title = pht('Edit Package');
|
$title = pht('Edit Package');
|
||||||
|
@ -195,14 +192,14 @@ final class PhabricatorOwnersEditController
|
||||||
->setLabel(pht('Primary Owner'))
|
->setLabel(pht('Primary Owner'))
|
||||||
->setName('primary')
|
->setName('primary')
|
||||||
->setLimit(1)
|
->setLimit(1)
|
||||||
->setValue($token_primary_owner)
|
->setValue($handle_primary_owner)
|
||||||
->setError($e_primary))
|
->setError($e_primary))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setDatasource('/typeahead/common/usersorprojects/')
|
->setDatasource('/typeahead/common/usersorprojects/')
|
||||||
->setLabel(pht('Owners'))
|
->setLabel(pht('Owners'))
|
||||||
->setName('owners')
|
->setName('owners')
|
||||||
->setValue($token_all_owners))
|
->setValue($handles_all_owners))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setName('auditing')
|
->setName('auditing')
|
||||||
|
|
|
@ -153,9 +153,7 @@ final class PhabricatorOwnersListController
|
||||||
$phids = $request->getArr('owner');
|
$phids = $request->getArr('owner');
|
||||||
$phid = reset($phids);
|
$phid = reset($phids);
|
||||||
$handles = $this->loadViewerHandles(array($phid));
|
$handles = $this->loadViewerHandles(array($phid));
|
||||||
$owners_search_value = array(
|
$owners_search_value = array($handles[$phid]);
|
||||||
$phid => $handles[$phid]->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$callsigns = array('' => pht('(Any Repository)'));
|
$callsigns = array('' => pht('(Any Repository)'));
|
||||||
|
|
|
@ -48,11 +48,10 @@ final class PhabricatorPasteSearchEngine
|
||||||
AphrontFormView $form,
|
AphrontFormView $form,
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$languages = $saved_query->getParameter('languages', array());
|
$languages = $saved_query->getParameter('languages', array());
|
||||||
$no_language = false;
|
$no_language = false;
|
||||||
|
@ -70,7 +69,7 @@ final class PhabricatorPasteSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setName('languages')
|
->setName('languages')
|
||||||
|
|
|
@ -22,16 +22,12 @@ final class PhabricatorPeopleLogsController
|
||||||
$handles = $this->loadViewerHandles($phids);
|
$handles = $this->loadViewerHandles($phids);
|
||||||
if ($filter_user) {
|
if ($filter_user) {
|
||||||
$filter_user = reset($filter_user);
|
$filter_user = reset($filter_user);
|
||||||
$user_value = array(
|
$user_value = array($handles[$filter_user]);
|
||||||
$filter_user => $handles[$filter_user]->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filter_actor) {
|
if ($filter_actor) {
|
||||||
$filter_actor = reset($filter_actor);
|
$filter_actor = reset($filter_actor);
|
||||||
$actor_value = array(
|
$actor_value = array($handles[$filter_actor]);
|
||||||
$filter_actor => $handles[$filter_actor]->getFullName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,6 @@ final class PholioMockEditController extends PholioController {
|
||||||
->withPHIDs($v_cc)
|
->withPHIDs($v_cc)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$cc_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$image_elements = array();
|
$image_elements = array();
|
||||||
foreach ($mock_images as $mock_image) {
|
foreach ($mock_images as $mock_image) {
|
||||||
$image_elements[] = id(new PholioUploadedImageView())
|
$image_elements[] = id(new PholioUploadedImageView())
|
||||||
|
@ -303,7 +301,7 @@ final class PholioMockEditController extends PholioController {
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setLabel(pht('CC'))
|
->setLabel(pht('CC'))
|
||||||
->setName('cc')
|
->setName('cc')
|
||||||
->setValue($cc_tokens)
|
->setValue($handles)
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setDatasource('/typeahead/common/mailable/'))
|
->setDatasource('/typeahead/common/mailable/'))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
|
|
@ -27,11 +27,10 @@ final class PholioMockSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -39,8 +38,7 @@ final class PholioMockSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens));
|
->setValue($author_handles));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getURI($path) {
|
protected function getURI($path) {
|
||||||
|
|
|
@ -61,10 +61,6 @@ final class PonderQuestionSearchEngine
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$author_tokens = array_select_keys($tokens, $author_phids);
|
|
||||||
$answerer_tokens = array_select_keys($tokens, $answerer_phids);
|
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -72,13 +68,13 @@ final class PonderQuestionSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue(array_select_keys($handles, $author_phids)))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('answerers')
|
->setName('answerers')
|
||||||
->setLabel(pht('Answered By'))
|
->setLabel(pht('Answered By'))
|
||||||
->setValue($answerer_tokens))
|
->setValue(array_select_keys($handles, $answerer_phids)))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setLabel(pht('Status'))
|
->setLabel(pht('Status'))
|
||||||
|
|
|
@ -36,11 +36,10 @@ final class PhabricatorProjectSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('memberPHIDs', array());
|
$phids = $saved_query->getParameter('memberPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$member_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$member_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$status = $saved_query->getParameter('status');
|
$status = $saved_query->getParameter('status');
|
||||||
|
|
||||||
|
@ -50,7 +49,7 @@ final class PhabricatorProjectSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('members')
|
->setName('members')
|
||||||
->setLabel(pht('Members'))
|
->setLabel(pht('Members'))
|
||||||
->setValue($member_tokens))
|
->setValue($member_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setLabel(pht('Status'))
|
->setLabel(pht('Status'))
|
||||||
|
|
|
@ -135,10 +135,7 @@ final class ReleephProjectEditController extends ReleephProjectController {
|
||||||
->withPHIDs($pusher_phids)
|
->withPHIDs($pusher_phids)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$pusher_tokens = array();
|
$pusher_handles = array_select_keys($handles, $pusher_phids);
|
||||||
foreach ($pusher_phids as $phid) {
|
|
||||||
$pusher_tokens[$phid] = $handles[$phid]->getFullName();
|
|
||||||
}
|
|
||||||
|
|
||||||
$basic_inset = id(new AphrontFormInsetView())
|
$basic_inset = id(new AphrontFormInsetView())
|
||||||
->setTitle(pht('Basics'))
|
->setTitle(pht('Basics'))
|
||||||
|
@ -209,7 +206,7 @@ final class ReleephProjectEditController extends ReleephProjectController {
|
||||||
->setLabel(pht('Pushers'))
|
->setLabel(pht('Pushers'))
|
||||||
->setName('pushers')
|
->setName('pushers')
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setValue($pusher_tokens));
|
->setValue($pusher_handles));
|
||||||
|
|
||||||
$commit_author_inset = $this->buildCommitAuthorInset($commit_author);
|
$commit_author_inset = $this->buildCommitAuthorInset($commit_author);
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,10 @@ final class ReleephRequestSearchEngine
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
|
|
||||||
$phids = $saved_query->getParameter('requestorPHIDs', array());
|
$phids = $saved_query->getParameter('requestorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$requestor_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$requestor_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -84,7 +83,7 @@ final class ReleephRequestSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('requestors')
|
->setName('requestors')
|
||||||
->setLabel(pht('Requestors'))
|
->setLabel(pht('Requestors'))
|
||||||
->setValue($requestor_tokens));
|
->setValue($requestor_handles));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getURI($path) {
|
protected function getURI($path) {
|
||||||
|
|
|
@ -59,10 +59,10 @@ final class PhabricatorRepositoryArcanistProjectEditController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($project->getSymbolIndexProjects()) {
|
if ($project->getSymbolIndexProjects()) {
|
||||||
$uses = id(new PhabricatorRepositoryArcanistProject())->loadAllWhere(
|
$uses = id(new PhabricatorHandleQuery())
|
||||||
'phid in (%Ls)',
|
->setViewer($user)
|
||||||
$project->getSymbolIndexProjects());
|
->withPHIDs($project->getSymbolIndexProjects())
|
||||||
$uses = mpull($uses, 'getName', 'getPHID');
|
->execute();
|
||||||
} else {
|
} else {
|
||||||
$uses = array();
|
$uses = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,22 +128,18 @@ final class PhabricatorSearchController
|
||||||
$author_value = array_select_keys(
|
$author_value = array_select_keys(
|
||||||
$handles,
|
$handles,
|
||||||
$query->getParameter('author', array()));
|
$query->getParameter('author', array()));
|
||||||
$author_value = mpull($author_value, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$owner_value = array_select_keys(
|
$owner_value = array_select_keys(
|
||||||
$handles,
|
$handles,
|
||||||
$query->getParameter('owner', array()));
|
$query->getParameter('owner', array()));
|
||||||
$owner_value = mpull($owner_value, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$subscribers_value = array_select_keys(
|
$subscribers_value = array_select_keys(
|
||||||
$handles,
|
$handles,
|
||||||
$query->getParameter('subscribers', array()));
|
$query->getParameter('subscribers', array()));
|
||||||
$subscribers_value = mpull($subscribers_value, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$project_value = array_select_keys(
|
$project_value = array_select_keys(
|
||||||
$handles,
|
$handles,
|
||||||
$query->getParameter('project', array()));
|
$query->getParameter('project', array()));
|
||||||
$project_value = mpull($project_value, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$search_form = new AphrontFormView();
|
$search_form = new AphrontFormView();
|
||||||
$search_form
|
$search_form
|
||||||
|
|
|
@ -29,11 +29,10 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
AphrontFormView $form,
|
AphrontFormView $form,
|
||||||
PhabricatorSavedQuery $saved_query) {
|
PhabricatorSavedQuery $saved_query) {
|
||||||
$phids = $saved_query->getParameter('authorPHIDs', array());
|
$phids = $saved_query->getParameter('authorPHIDs', array());
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$author_handles = id(new PhabricatorHandleQuery())
|
||||||
->setViewer($this->requireViewer())
|
->setViewer($this->requireViewer())
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->execute();
|
->execute();
|
||||||
$author_tokens = mpull($handles, 'getFullName', 'getPHID');
|
|
||||||
|
|
||||||
$voted = $saved_query->getParameter('voted', false);
|
$voted = $saved_query->getParameter('voted', false);
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
->setDatasource('/typeahead/common/users/')
|
->setDatasource('/typeahead/common/users/')
|
||||||
->setName('authors')
|
->setName('authors')
|
||||||
->setLabel(pht('Authors'))
|
->setLabel(pht('Authors'))
|
||||||
->setValue($author_tokens))
|
->setValue($author_handles))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCheckboxControl())
|
id(new AphrontFormCheckboxControl())
|
||||||
->addCheckbox(
|
->addCheckbox(
|
||||||
|
|
|
@ -35,15 +35,8 @@ final class AphrontFormTokenizerControl extends AphrontFormControl {
|
||||||
$name = $this->getName();
|
$name = $this->getName();
|
||||||
$values = nonempty($this->getValue(), array());
|
$values = nonempty($this->getValue(), array());
|
||||||
|
|
||||||
// TODO: Convert tokenizers to always take raw handles. For now, we
|
assert_instances_of($values, 'PhabricatorObjectHandle');
|
||||||
// accept either a list of handles or a `map<phid, string>`.
|
$values = mpull($values, 'getFullName', 'getPHID');
|
||||||
try {
|
|
||||||
assert_instances_of($values, 'PhabricatorObjectHandle');
|
|
||||||
$values = mpull($values, 'getFullName', 'getPHID');
|
|
||||||
} catch (InvalidArgumentException $ex) {
|
|
||||||
// Ignore this, just use the values as provided.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->getID()) {
|
if ($this->getID()) {
|
||||||
$id = $this->getID();
|
$id = $this->getID();
|
||||||
|
|
Loading…
Reference in a new issue