1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Fix two minor display issues with the Conduit "*.search" API documentation

Summary:
Depends on D20685. Ref T13350. Currently:

  - When a SearchEngine parameter is marked as hidden from Conduit, we may still render a table of possible values. Instead, only render the table if the parameter is actually usable.
  - The table header is hard-coded to say `'statuses'`, which is just a silly mistake. (Most commonly, this table does have `statuses` constants.)

Test Plan: Viewed the Conduit API documentation for the new "slowvote.poll.search" API method, saw more sensible display behavior.

Maniphest Tasks: T13350

Differential Revision: https://secure.phabricator.com/D20686
This commit is contained in:
epriestley 2019-07-31 10:06:34 -07:00
parent 0b0ab1bd7c
commit f92480fb77

View file

@ -198,6 +198,7 @@ EOTEXT
$label = $field->getLabel(); $label = $field->getLabel();
$constants = $field->newConduitConstants(); $constants = $field->newConduitConstants();
$show_table = false;
$type_object = $field->getConduitParameterType(); $type_object = $field->getConduitParameterType();
if ($type_object) { if ($type_object) {
@ -209,6 +210,7 @@ EOTEXT
' ', ' ',
phutil_tag('em', array(), pht('(See table below.)')), phutil_tag('em', array(), pht('(See table below.)')),
); );
$show_table = true;
} }
} else { } else {
$type = null; $type = null;
@ -222,11 +224,11 @@ EOTEXT
$description, $description,
); );
if ($constants) { if ($show_table) {
$constant_lists[] = $this->newRemarkupDocumentationView( $constant_lists[] = $this->newRemarkupDocumentationView(
pht( pht(
'Constants supported by the `%s` constraint:', 'Constants supported by the `%s` constraint:',
'statuses')); $key));
$constants_rows = array(); $constants_rows = array();
foreach ($constants as $constant) { foreach ($constants as $constant) {