From f92480fb77409b434cd85012e194010379549b52 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 31 Jul 2019 10:06:34 -0700 Subject: [PATCH] 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 --- .../search/engine/PhabricatorSearchEngineAPIMethod.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php index f4e2dc918f..3af4f349fa 100644 --- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php +++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php @@ -198,6 +198,7 @@ EOTEXT $label = $field->getLabel(); $constants = $field->newConduitConstants(); + $show_table = false; $type_object = $field->getConduitParameterType(); if ($type_object) { @@ -209,6 +210,7 @@ EOTEXT ' ', phutil_tag('em', array(), pht('(See table below.)')), ); + $show_table = true; } } else { $type = null; @@ -222,11 +224,11 @@ EOTEXT $description, ); - if ($constants) { + if ($show_table) { $constant_lists[] = $this->newRemarkupDocumentationView( pht( 'Constants supported by the `%s` constraint:', - 'statuses')); + $key)); $constants_rows = array(); foreach ($constants as $constant) {