Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14064524
D9888.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D9888.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -465,6 +465,7 @@
'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php',
'DifferentialViewPolicyField' => 'applications/differential/customfield/DifferentialViewPolicyField.php',
'DiffusionArcanistProjectDatasource' => 'applications/diffusion/typeahead/DiffusionArcanistProjectDatasource.php',
+ 'DiffusionAuditorDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorDatasource.php',
'DiffusionBranchTableController' => 'applications/diffusion/controller/DiffusionBranchTableController.php',
'DiffusionBranchTableView' => 'applications/diffusion/view/DiffusionBranchTableView.php',
'DiffusionBrowseController' => 'applications/diffusion/controller/DiffusionBrowseController.php',
@@ -3186,6 +3187,7 @@
'DifferentialUnitField' => 'DifferentialCustomField',
'DifferentialViewPolicyField' => 'DifferentialCoreCustomField',
'DiffusionArcanistProjectDatasource' => 'PhabricatorTypeaheadDatasource',
+ 'DiffusionAuditorDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'DiffusionBranchTableController' => 'DiffusionController',
'DiffusionBranchTableView' => 'DiffusionView',
'DiffusionBrowseController' => 'DiffusionController',
diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
--- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php
+++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
@@ -85,7 +85,7 @@
$form
->appendChild(
id(new AphrontFormTokenizerControl())
- ->setDatasource('/typeahead/common/usersprojectsorpackages/')
+ ->setDatasource(new DiffusionAuditorDatasource())
->setName('auditorPHIDs')
->setLabel(pht('Auditors'))
->setValue(array_select_keys($handles, $auditor_phids)))
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -772,6 +772,7 @@
require_celerity_resource('phabricator-transaction-view-css');
$mailable_source = new PhabricatorMetaMTAMailableDatasource();
+ $auditor_source = new DiffusionAuditorDatasource();
Javelin::initBehavior(
'differential-add-reviewers-and-ccs',
@@ -779,9 +780,9 @@
'dynamic' => array(
'add-auditors-tokenizer' => array(
'actions' => array('add_auditors' => 1),
- 'src' => '/typeahead/common/usersprojectsorpackages/',
+ 'src' => $auditor_source->getDatasourceURI(),
'row' => 'add-auditors',
- 'placeholder' => pht('Type a user, project, or package name...'),
+ 'placeholder' => $auditor_source->getPlaceholderText(),
),
'add-ccs-tokenizer' => array(
'actions' => array('add_ccs' => 1),
diff --git a/src/applications/diffusion/typeahead/DiffusionAuditorDatasource.php b/src/applications/diffusion/typeahead/DiffusionAuditorDatasource.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/typeahead/DiffusionAuditorDatasource.php
@@ -0,0 +1,22 @@
+<?php
+
+final class DiffusionAuditorDatasource
+ extends PhabricatorTypeaheadCompositeDatasource {
+
+ public function getPlaceholderText() {
+ return pht('Type a user, project or package name...');
+ }
+
+ public function getDatasourceApplicationClass() {
+ return 'PhabricatorApplicationDiffusion';
+ }
+
+ public function getComponentDatasources() {
+ return array(
+ new PhabricatorPeopleDatasource(),
+ new PhabricatorProjectDatasource(),
+ new PhabricatorOwnersPackageDatasource(),
+ );
+ }
+
+}
diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php
--- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php
+++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php
@@ -22,10 +22,8 @@
$need_rich_data = false;
$need_users = false;
- $need_agents = false;
$need_applications = false;
$need_projs = false;
- $need_packages = false;
$need_upforgrabs = false;
$need_noproject = false;
$need_symbols = false;
@@ -47,11 +45,6 @@
$need_projs = true;
$need_noproject = true;
break;
- case 'usersprojectsorpackages':
- $need_users = true;
- $need_projs = true;
- $need_packages = true;
- break;
}
$results = array();
@@ -193,17 +186,6 @@
}
}
- if ($need_packages) {
- $packages = id(new PhabricatorOwnersPackage())->loadAll();
- foreach ($packages as $package) {
- $results[] = id(new PhabricatorTypeaheadResult())
- ->setIcon('fa-list-alt bluegrey')
- ->setName($package->getName())
- ->setURI('/owners/package/'.$package->getID().'/')
- ->setPHID($package->getPHID());
- }
- }
-
if ($need_applications) {
$applications = PhabricatorApplication::getAllInstalledApplications();
foreach ($applications as $application) {
diff --git a/src/view/form/control/AphrontFormTokenizerControl.php b/src/view/form/control/AphrontFormTokenizerControl.php
--- a/src/view/form/control/AphrontFormTokenizerControl.php
+++ b/src/view/form/control/AphrontFormTokenizerControl.php
@@ -97,8 +97,6 @@
$map = array(
'searchowner' => pht('Type a user name...'),
'searchproject' => pht('Type a project name...'),
- 'usersprojectsorpackages' =>
- pht('Type a user, project, or package name...'),
);
return idx($map, $request);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 11:50 PM (5 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6735887
Default Alt Text
D9888.diff (5 KB)
Attached To
Mode
D9888: Modernize "user, project or package" typeahead datasource
Attached
Detach File
Event Timeline
Log In to Comment