mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Add EditEngine typeahead
Summary: Allows you to set forms via typeahead Test Plan: `/typeahead/browse/PhabricatorEditEngineDatasource/` Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17065
This commit is contained in:
parent
8b7e99f68c
commit
92db64c1b2
2 changed files with 41 additions and 0 deletions
|
@ -2572,6 +2572,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorEditEngineConfigurationViewController' => 'applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php',
|
||||
'PhabricatorEditEngineController' => 'applications/transactions/controller/PhabricatorEditEngineController.php',
|
||||
'PhabricatorEditEngineCreateQuickActions' => 'applications/settings/quickmenu/PhabricatorEditEngineCreateQuickActions.php',
|
||||
'PhabricatorEditEngineDatasource' => 'applications/transactions/typeahead/PhabricatorEditEngineDatasource.php',
|
||||
'PhabricatorEditEngineExtension' => 'applications/transactions/engineextension/PhabricatorEditEngineExtension.php',
|
||||
'PhabricatorEditEngineExtensionModule' => 'applications/transactions/engineextension/PhabricatorEditEngineExtensionModule.php',
|
||||
'PhabricatorEditEngineListController' => 'applications/transactions/controller/PhabricatorEditEngineListController.php',
|
||||
|
@ -7551,6 +7552,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorEditEngineConfigurationViewController' => 'PhabricatorEditEngineController',
|
||||
'PhabricatorEditEngineController' => 'PhabricatorApplicationTransactionController',
|
||||
'PhabricatorEditEngineCreateQuickActions' => 'PhabricatorQuickActions',
|
||||
'PhabricatorEditEngineDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorEditEngineExtension' => 'Phobject',
|
||||
'PhabricatorEditEngineExtensionModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorEditEngineListController' => 'PhabricatorEditEngineController',
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorEditEngineDatasource
|
||||
extends PhabricatorTypeaheadDatasource {
|
||||
|
||||
public function getBrowseTitle() {
|
||||
return pht('Browse Forms');
|
||||
}
|
||||
|
||||
public function getPlaceholderText() {
|
||||
return pht('Type a form name...');
|
||||
}
|
||||
|
||||
public function getDatasourceApplicationClass() {
|
||||
return 'PhabricatorTransactionsApplication';
|
||||
}
|
||||
|
||||
public function loadResults() {
|
||||
$query = id(new PhabricatorEditEngineConfigurationQuery());
|
||||
|
||||
$forms = $this->executeQuery($query);
|
||||
$results = array();
|
||||
foreach ($forms as $form) {
|
||||
|
||||
$result = id(new PhabricatorTypeaheadResult())
|
||||
->setName($form->getName())
|
||||
->setPHID($form->getPHID());
|
||||
|
||||
if ($form->getIsDisabled()) {
|
||||
$result->setClosed(pht('Archived'));
|
||||
}
|
||||
|
||||
$results[] = $result;
|
||||
}
|
||||
|
||||
return $this->filterResultsAgainstTokens($results);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue