mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +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) {
|
||||
|
||||
$viewer = $this->requireViewer();
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setNoDataString(pht('No results returned for that query.'));
|
||||
|
||||
if ($results) {
|
||||
$objects = id(new PhabricatorObjectQuery())
|
||||
|
@ -247,7 +249,6 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
->withPHIDs(mpull($results, 'getPHID'))
|
||||
->execute();
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
foreach ($results as $phid => $handle) {
|
||||
$view = id(new PhabricatorSearchResultView())
|
||||
->setHandle($handle)
|
||||
|
@ -256,15 +257,9 @@ final class PhabricatorSearchApplicationSearchEngine
|
|||
->render();
|
||||
$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) {
|
||||
|
|
Loading…
Reference in a new issue