[Redesign] Put all ApplicationSearch results in an ObjectBox
Summary: Ref T8099. In most cases we return either an ObjectList or AphrontTable, and can pretty up the UI in ApplicationSearch. There are a few edge cases, like PeopleUserLog, that can be cleanup up individually in the future, but look fine for now. Also added 'setNotice' for AphrontTable for a few cases where we want to convey addtional information. TODO: Seems we always pass a Pager Object, which tries to get displayed, I'll redesign that interaction in the future, probably by passing the Pager to the ObjectBox Test Plan: Went throught most/all ApplicationSearch panels I could find, even edge cases look better. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D12989
This commit is contained in:
@@ -200,6 +200,12 @@ final class PhabricatorApplicationSearchController
|
||||
|
||||
$nav->appendChild($filter_view);
|
||||
|
||||
if ($named_query) {
|
||||
$title = $named_query->getQueryName();
|
||||
} else {
|
||||
$title = pht('Advanced Search');
|
||||
}
|
||||
|
||||
if ($run_query) {
|
||||
$nav->appendChild(
|
||||
$anchor = id(new PhabricatorAnchorView())
|
||||
@@ -227,7 +233,15 @@ final class PhabricatorApplicationSearchController
|
||||
$saved_query);
|
||||
}
|
||||
|
||||
$nav->appendChild($list);
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title);
|
||||
|
||||
if ($list instanceof AphrontTableView) {
|
||||
$box->setTable($list);
|
||||
} else {
|
||||
$box->setObjectList($list);
|
||||
}
|
||||
$nav->appendChild($box);
|
||||
|
||||
// TODO: This is a bit hacky.
|
||||
if ($list instanceof PHUIObjectItemListView) {
|
||||
@@ -260,12 +274,6 @@ final class PhabricatorApplicationSearchController
|
||||
$nav->appendChild($errors);
|
||||
}
|
||||
|
||||
if ($named_query) {
|
||||
$title = $named_query->getQueryName();
|
||||
} else {
|
||||
$title = pht('Advanced Search');
|
||||
}
|
||||
|
||||
$crumbs = $parent
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb($title);
|
||||
@@ -353,7 +361,12 @@ final class PhabricatorApplicationSearchController
|
||||
|
||||
$nav->selectFilter('query/edit');
|
||||
$nav->setCrumbs($crumbs);
|
||||
$nav->appendChild($list);
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Saved Queries'))
|
||||
->setObjectList($list);
|
||||
|
||||
$nav->appendChild($box);
|
||||
|
||||
return $parent->buildApplicationPage(
|
||||
$nav,
|
||||
|
||||
Reference in New Issue
Block a user