mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Restrict Differential buckets to just ApplicationSearch views
Summary: Ref T9363, If we're in a dashboard panel, only show buckets with data, or a fallback if nothing exists. Test Plan: Test 'active revisions' panel in a dashboard and in Differential. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9363 Differential Revision: https://secure.phabricator.com/D17544
This commit is contained in:
parent
9099485a71
commit
ffab52f17e
1 changed files with 13 additions and 4 deletions
|
@ -162,10 +162,13 @@ final class DifferentialRevisionSearchEngine
|
|||
$groups = $bucket->newResultGroups($query, $revisions);
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$views[] = id(clone $template)
|
||||
->setHeader($group->getName())
|
||||
->setNoDataString($group->getNoDataString())
|
||||
->setRevisions($group->getObjects());
|
||||
// Don't show groups in Dashboard Panels
|
||||
if ($group->getObjects() || !$this->isPanelContext()) {
|
||||
$views[] = id(clone $template)
|
||||
->setHeader($group->getName())
|
||||
->setNoDataString($group->getNoDataString())
|
||||
->setRevisions($group->getObjects());
|
||||
}
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
$this->addError($ex->getMessage());
|
||||
|
@ -176,6 +179,12 @@ final class DifferentialRevisionSearchEngine
|
|||
->setHandles(array());
|
||||
}
|
||||
|
||||
if (!$views) {
|
||||
$views[] = id(new DifferentialRevisionListView())
|
||||
->setUser($viewer)
|
||||
->setNoDataString(pht('No revisions found.'));
|
||||
}
|
||||
|
||||
$phids = array_mergev(mpull($views, 'getRequiredHandlePHIDs'));
|
||||
if ($phids) {
|
||||
$handles = id(new PhabricatorHandleQuery())
|
||||
|
|
Loading…
Reference in a new issue