mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-01 18:30:59 +01:00
[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
This commit is contained in:
parent
2dadf55892
commit
b24260b04a
1 changed files with 19 additions and 20 deletions
|
@ -185,9 +185,25 @@ final class PhabricatorApplicationSearchController
|
||||||
$title = pht('Advanced Search');
|
$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) {
|
if ($run_query) {
|
||||||
$anchor = id(new PhabricatorAnchorView())
|
$box->setAnchor(
|
||||||
->setAnchorName('R');
|
id(new PhabricatorAnchorView())
|
||||||
|
->setAnchorName('R'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$query = $engine->buildQueryFromSavedQuery($saved_query);
|
$query = $engine->buildQueryFromSavedQuery($saved_query);
|
||||||
|
@ -211,22 +227,11 @@ final class PhabricatorApplicationSearchController
|
||||||
$saved_query);
|
$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) {
|
if ($list instanceof AphrontTableView) {
|
||||||
$box->setTable($list);
|
$box->setTable($list);
|
||||||
} else {
|
} else {
|
||||||
$box->setObjectList($list);
|
$box->setObjectList($list);
|
||||||
}
|
}
|
||||||
$nav->appendChild($box);
|
|
||||||
|
|
||||||
// TODO: This is a bit hacky.
|
// TODO: This is a bit hacky.
|
||||||
if ($list instanceof PHUIObjectItemListView) {
|
if ($list instanceof PHUIObjectItemListView) {
|
||||||
|
@ -249,13 +254,7 @@ final class PhabricatorApplicationSearchController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$errors = id(new PHUIInfoView())
|
$box->setFormErrors($errors, pht('Query Errors'));
|
||||||
->setTitle(pht('Query Errors'))
|
|
||||||
->setErrors($errors);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($errors) {
|
|
||||||
$nav->appendChild($errors);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs = $parent
|
$crumbs = $parent
|
||||||
|
|
Loading…
Reference in a new issue