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:
@@ -162,11 +162,14 @@ final class DifferentialRevisionSearchEngine
|
|||||||
$groups = $bucket->newResultGroups($query, $revisions);
|
$groups = $bucket->newResultGroups($query, $revisions);
|
||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
|
// Don't show groups in Dashboard Panels
|
||||||
|
if ($group->getObjects() || !$this->isPanelContext()) {
|
||||||
$views[] = id(clone $template)
|
$views[] = id(clone $template)
|
||||||
->setHeader($group->getName())
|
->setHeader($group->getName())
|
||||||
->setNoDataString($group->getNoDataString())
|
->setNoDataString($group->getNoDataString())
|
||||||
->setRevisions($group->getObjects());
|
->setRevisions($group->getObjects());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$this->addError($ex->getMessage());
|
$this->addError($ex->getMessage());
|
||||||
}
|
}
|
||||||
@@ -176,6 +179,12 @@ final class DifferentialRevisionSearchEngine
|
|||||||
->setHandles(array());
|
->setHandles(array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$views) {
|
||||||
|
$views[] = id(new DifferentialRevisionListView())
|
||||||
|
->setUser($viewer)
|
||||||
|
->setNoDataString(pht('No revisions found.'));
|
||||||
|
}
|
||||||
|
|
||||||
$phids = array_mergev(mpull($views, 'getRequiredHandlePHIDs'));
|
$phids = array_mergev(mpull($views, 'getRequiredHandlePHIDs'));
|
||||||
if ($phids) {
|
if ($phids) {
|
||||||
$handles = id(new PhabricatorHandleQuery())
|
$handles = id(new PhabricatorHandleQuery())
|
||||||
|
|||||||
Reference in New Issue
Block a user