From 27daa116c2ecf6c5cf61bc543961139fa90917ed Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 17 Jul 2014 15:48:50 -0700 Subject: [PATCH] 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 --- .../controller/ManiphestReportController.php | 2 +- ...torTypeaheadCommonDatasourceController.php | 39 ------------------- .../control/AphrontFormTokenizerControl.php | 1 - 3 files changed, 1 insertion(+), 41 deletions(-) diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index 6fd69d432c..dd43b2c043 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -321,7 +321,7 @@ final class ManiphestReportController extends ManiphestController { ->setUser($user) ->appendChild( id(new AphrontFormTokenizerControl()) - ->setDatasource('/typeahead/common/searchproject/') + ->setDatasource(new PhabricatorProjectDatasource()) ->setLabel(pht('Project')) ->setLimit(1) ->setName('set_project') diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php index a29d461c3b..dc54c9b7d6 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php @@ -20,19 +20,13 @@ final class PhabricatorTypeaheadCommonDatasourceController $raw_query = $request->getStr('raw'); $need_users = false; - $need_projs = false; $need_upforgrabs = false; - $need_noproject = false; $need_rich_data = false; switch ($this->type) { case 'searchowner': $need_users = true; $need_upforgrabs = true; break; - case 'searchproject': - $need_projs = true; - $need_noproject = true; - break; } $results = array(); @@ -43,13 +37,6 @@ final class PhabricatorTypeaheadCommonDatasourceController ->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) { $columns = array( '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'); if ($request->isAjax()) { diff --git a/src/view/form/control/AphrontFormTokenizerControl.php b/src/view/form/control/AphrontFormTokenizerControl.php index 258071a4a4..f342cd3236 100644 --- a/src/view/form/control/AphrontFormTokenizerControl.php +++ b/src/view/form/control/AphrontFormTokenizerControl.php @@ -96,7 +96,6 @@ final class AphrontFormTokenizerControl extends AphrontFormControl { $map = array( 'searchowner' => pht('Type a user name...'), - 'searchproject' => pht('Type a project name...'), ); return idx($map, $request);