mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +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:
parent
0a3a3eae00
commit
27daa116c2
3 changed files with 1 additions and 41 deletions
|
@ -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')
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue