mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Fix documentation behaviors for the new proxy functions for custom datasource fields
Summary: Ref T13090. The doc string in "any()" wasn't specified correctly and the help page wasn't getting enough supporting data to build properly. Test Plan: Viewed "Reference: Advanced Functions" for a custom datasource field and got more helpful help. Maniphest Tasks: T13090 Differential Revision: https://secure.phabricator.com/D19128
This commit is contained in:
parent
3203fd9eea
commit
8ae01fdc6b
3 changed files with 25 additions and 3 deletions
|
@ -19,9 +19,25 @@ final class PhabricatorTypeaheadFunctionHelpController
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
$source = $sources[$class];
|
$raw_parameters = $request->getStr('parameters');
|
||||||
|
if ($raw_parameters) {
|
||||||
|
$parameters = phutil_json_decode($raw_parameters);
|
||||||
|
} else {
|
||||||
|
$parameters = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$source = id(clone $sources[$class])
|
||||||
|
->setParameters($parameters);
|
||||||
|
|
||||||
|
// This can fail for some types of datasources (like the custom field proxy
|
||||||
|
// datasources) if the "parameters" are wrong. Just fail cleanly instead
|
||||||
|
// of fataling.
|
||||||
|
try {
|
||||||
|
$application_class = $source->getDatasourceApplicationClass();
|
||||||
|
} catch (Exception $ex) {
|
||||||
|
return new Aphront404Response();
|
||||||
|
}
|
||||||
|
|
||||||
$application_class = $source->getDatasourceApplicationClass();
|
|
||||||
if ($application_class) {
|
if ($application_class) {
|
||||||
$result = id(new PhabricatorApplicationQuery())
|
$result = id(new PhabricatorApplicationQuery())
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
|
|
|
@ -226,6 +226,12 @@ final class PhabricatorTypeaheadModularDatasourceController
|
||||||
if ($source->getAllDatasourceFunctions()) {
|
if ($source->getAllDatasourceFunctions()) {
|
||||||
$reference_uri = '/typeahead/help/'.get_class($source).'/';
|
$reference_uri = '/typeahead/help/'.get_class($source).'/';
|
||||||
|
|
||||||
|
$parameters = $source->getParameters();
|
||||||
|
if ($parameters) {
|
||||||
|
$reference_uri = (string)id(new PhutilURI($reference_uri))
|
||||||
|
->setQueryParam('parameters', phutil_json_encode($parameters));
|
||||||
|
}
|
||||||
|
|
||||||
$reference_link = phutil_tag(
|
$reference_link = phutil_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -22,7 +22,7 @@ final class PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource
|
||||||
'summary' => pht('Find results with any value.'),
|
'summary' => pht('Find results with any value.'),
|
||||||
'description' => pht(
|
'description' => pht(
|
||||||
"This function includes results which have any value. Use a query ".
|
"This function includes results which have any value. Use a query ".
|
||||||
"like this to find results with any value:\n\n%s".
|
"like this to find results with any value:\n\n%s",
|
||||||
'> any()'),
|
'> any()'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue