diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php --- a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php @@ -106,9 +106,45 @@ } } + $query->setReturnPartialResultsOnOverheat(true); + $results = $engine->executeQuery($query, $pager); + $results_view = $engine->renderResults($results, $saved); + + $is_overheated = $query->getIsOverheated(); + $overheated_view = null; + if ($is_overheated) { + $content = $results_view->getContent(); + + if ($results) { + $overheated_message = pht( + 'Most objects matching the query for this panel are not visible '. + 'to you, so filtering results is taking a long time. Only some '. + 'results are shown. Refine the query to find more results.'); + } else { + $overheated_message = pht( + 'Most objects matching the query for this panel are not visible '. + 'to you, so filtering results is taking a long time. Refine the '. + 'query to find results.'); + } + + $overheated_warning = id(new PHUIInfoView()) + ->setSeverity(PHUIInfoView::SEVERITY_WARNING) + ->setTitle(pht('Query Overheated')) + ->setErrors( + array( + $overheated_message, + )); + + $overheated_box = id(new PHUIBoxView()) + ->addClass('mmt mmb') + ->appendChild($overheated_warning); + + $content = array($content, $overheated_box); + $results_view->setContent($content); + } - return $engine->renderResults($results, $saved); + return $results_view; } public function adjustPanelHeader(