mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-11 03:44:48 +01:00
[Redesign] Fix 'nodata' display on search results
Summary: Ref T8099, We can just set the no data string on the ObjectList directly. Test Plan: Run a bum query, see better UI. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D13087
This commit is contained in:
parent
ee599b0201
commit
e230e03880
1 changed files with 3 additions and 8 deletions
|
@ -240,6 +240,8 @@ final class PhabricatorSearchApplicationSearchEngine
|
||||||
array $handles) {
|
array $handles) {
|
||||||
|
|
||||||
$viewer = $this->requireViewer();
|
$viewer = $this->requireViewer();
|
||||||
|
$list = new PHUIObjectItemListView();
|
||||||
|
$list->setNoDataString(pht('No results returned for that query.'));
|
||||||
|
|
||||||
if ($results) {
|
if ($results) {
|
||||||
$objects = id(new PhabricatorObjectQuery())
|
$objects = id(new PhabricatorObjectQuery())
|
||||||
|
@ -247,7 +249,6 @@ final class PhabricatorSearchApplicationSearchEngine
|
||||||
->withPHIDs(mpull($results, 'getPHID'))
|
->withPHIDs(mpull($results, 'getPHID'))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$list = new PHUIObjectItemListView();
|
|
||||||
foreach ($results as $phid => $handle) {
|
foreach ($results as $phid => $handle) {
|
||||||
$view = id(new PhabricatorSearchResultView())
|
$view = id(new PhabricatorSearchResultView())
|
||||||
->setHandle($handle)
|
->setHandle($handle)
|
||||||
|
@ -256,15 +257,9 @@ final class PhabricatorSearchApplicationSearchEngine
|
||||||
->render();
|
->render();
|
||||||
$list->addItem($view);
|
$list->addItem($view);
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $list;
|
|
||||||
} else {
|
|
||||||
$results = id(new PHUIInfoView())
|
|
||||||
->appendChild(pht('No results returned for that query.'))
|
|
||||||
->setSeverity(PHUIInfoView::SEVERITY_NODATA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function readOwnerPHIDs(PhabricatorSavedQuery $saved) {
|
private function readOwnerPHIDs(PhabricatorSavedQuery $saved) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue