1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +01:00

Remove "searchproject" typeahead datasource

Summary: Ref T4420. This is just "project", plus the special "no project" token, but that doesn't actually work. Replace it with a normal project typeahead. This is only used in Maniphest's reports.

Test Plan: Searched for a couple of projects in reports.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4420

Differential Revision: https://secure.phabricator.com/D9890
This commit is contained in:
epriestley 2014-07-17 15:48:50 -07:00
parent 0a3a3eae00
commit 27daa116c2
3 changed files with 1 additions and 41 deletions

View file

@ -321,7 +321,7 @@ final class ManiphestReportController extends ManiphestController {
->setUser($user) ->setUser($user)
->appendChild( ->appendChild(
id(new AphrontFormTokenizerControl()) id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/searchproject/') ->setDatasource(new PhabricatorProjectDatasource())
->setLabel(pht('Project')) ->setLabel(pht('Project'))
->setLimit(1) ->setLimit(1)
->setName('set_project') ->setName('set_project')

View file

@ -20,19 +20,13 @@ final class PhabricatorTypeaheadCommonDatasourceController
$raw_query = $request->getStr('raw'); $raw_query = $request->getStr('raw');
$need_users = false; $need_users = false;
$need_projs = false;
$need_upforgrabs = false; $need_upforgrabs = false;
$need_noproject = false;
$need_rich_data = false; $need_rich_data = false;
switch ($this->type) { switch ($this->type) {
case 'searchowner': case 'searchowner':
$need_users = true; $need_users = true;
$need_upforgrabs = true; $need_upforgrabs = true;
break; break;
case 'searchproject':
$need_projs = true;
$need_noproject = true;
break;
} }
$results = array(); $results = array();
@ -43,13 +37,6 @@ final class PhabricatorTypeaheadCommonDatasourceController
->setPHID(ManiphestTaskOwner::OWNER_UP_FOR_GRABS); ->setPHID(ManiphestTaskOwner::OWNER_UP_FOR_GRABS);
} }
if ($need_noproject) {
$results[] = id(new PhabricatorTypeaheadResult())
->setName('noproject (No Project)')
->setPHID(ManiphestTaskOwner::PROJECT_NO_PROJECT);
}
if ($need_users) { if ($need_users) {
$columns = array( $columns = array(
'isSystemAgent', 'isSystemAgent',
@ -148,32 +135,6 @@ final class PhabricatorTypeaheadCommonDatasourceController
} }
} }
if ($need_projs) {
$projs = id(new PhabricatorProjectQuery())
->setViewer($viewer)
->needImages(true)
->execute();
foreach ($projs as $proj) {
$closed = null;
if ($proj->isArchived()) {
$closed = pht('Archived');
}
$proj_result = id(new PhabricatorTypeaheadResult())
->setName($proj->getName())
->setDisplayType('Project')
->setURI('/project/view/'.$proj->getID().'/')
->setPHID($proj->getPHID())
->setIcon($proj->getIcon())
->setPriorityType('proj')
->setClosed($closed);
$proj_result->setImageURI($proj->getProfileImageURI());
$results[] = $proj_result;
}
}
$content = mpull($results, 'getWireFormat'); $content = mpull($results, 'getWireFormat');
if ($request->isAjax()) { if ($request->isAjax()) {

View file

@ -96,7 +96,6 @@ final class AphrontFormTokenizerControl extends AphrontFormControl {
$map = array( $map = array(
'searchowner' => pht('Type a user name...'), 'searchowner' => pht('Type a user name...'),
'searchproject' => pht('Type a project name...'),
); );
return idx($map, $request); return idx($map, $request);