From b24260b04a3472b3f7bff6ea7a41602b5b4e28e4 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 27 May 2015 11:41:50 -0700 Subject: [PATCH] [Redesign] Add back Advanced Search Summary: Ref T8099, I failed to test "Advanced Search" which disappeared during the last commit. Test Plan: Test built-in, saved, and advanced search filters. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D13035 --- ...PhabricatorApplicationSearchController.php | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index b9c02c76b6..c4256e1e4e 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -185,9 +185,25 @@ final class PhabricatorApplicationSearchController $title = pht('Advanced Search'); } + $box = id(new PHUIObjectBoxView()) + ->setHeaderText($title); + + if ($run_query || $named_query) { + $box->setShowHide( + pht('Edit Query'), + pht('Hide Query'), + $form, + $this->getApplicationURI('query/advanced/?query='.$query_key)); + } else { + $box->setForm($form); + } + + $nav->appendChild($box); + if ($run_query) { - $anchor = id(new PhabricatorAnchorView()) - ->setAnchorName('R'); + $box->setAnchor( + id(new PhabricatorAnchorView()) + ->setAnchorName('R')); try { $query = $engine->buildQueryFromSavedQuery($saved_query); @@ -211,22 +227,11 @@ final class PhabricatorApplicationSearchController $saved_query); } - $box = id(new PHUIObjectBoxView()) - ->setHeaderText($title) - ->setAnchor($anchor); - - $box->setShowHide( - pht('Edit Query'), - pht('Hide Query'), - $form, - $this->getApplicationURI('query/advanced/?query='.$query_key)); - if ($list instanceof AphrontTableView) { $box->setTable($list); } else { $box->setObjectList($list); } - $nav->appendChild($box); // TODO: This is a bit hacky. if ($list instanceof PHUIObjectItemListView) { @@ -249,13 +254,7 @@ final class PhabricatorApplicationSearchController } if ($errors) { - $errors = id(new PHUIInfoView()) - ->setTitle(pht('Query Errors')) - ->setErrors($errors); - } - - if ($errors) { - $nav->appendChild($errors); + $box->setFormErrors($errors, pht('Query Errors')); } $crumbs = $parent