Page MenuHomePhabricator

D13035.id31427.diff
No OneTemporary

D13035.id31427.diff

diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -185,9 +185,25 @@
$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 @@
$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 @@
}
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

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 6:23 AM (4 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223742
Default Alt Text
D13035.id31427.diff (1 KB)

Event Timeline