Differential D20335 Diff 48540 src/applications/search/controller/PhabricatorApplicationSearchController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/controller/PhabricatorApplicationSearchController.php
Show First 20 Lines • Show All 844 Lines • ▼ Show 20 Lines | return id(new PHUIInfoView()) | ||||
->setFlush(true) | ->setFlush(true) | ||||
->setTitle(pht('Buckets Overflowing')) | ->setTitle(pht('Buckets Overflowing')) | ||||
->setErrors( | ->setErrors( | ||||
array( | array( | ||||
$message, | $message, | ||||
)); | )); | ||||
} | } | ||||
private function newOverheatedView(array $results) { | public static function newOverheatedError($has_results) { | ||||
if ($results) { | $overheated_link = phutil_tag( | ||||
'a', | |||||
array( | |||||
'href' => 'https://phurl.io/u/overheated', | |||||
'target' => '_blank', | |||||
), | |||||
pht('Learn More')); | |||||
if ($has_results) { | |||||
$message = pht( | $message = pht( | ||||
'Most objects matching your query are not visible to you, so '. | 'This query took too long, so only some results are shown. %s', | ||||
'filtering results is taking a long time. Only some results are '. | $overheated_link); | ||||
'shown. Refine your query to find results more quickly.'); | |||||
} else { | } else { | ||||
$message = pht( | $message = pht( | ||||
'Most objects matching your query are not visible to you, so '. | 'This query took too long. %s', | ||||
'filtering results is taking a long time. Refine your query to '. | $overheated_link); | ||||
'find results more quickly.'); | |||||
} | } | ||||
return $message; | |||||
} | |||||
private function newOverheatedView(array $results) { | |||||
$message = self::newOverheatedError((bool)$results); | |||||
return id(new PHUIInfoView()) | return id(new PHUIInfoView()) | ||||
->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ->setSeverity(PHUIInfoView::SEVERITY_WARNING) | ||||
->setFlush(true) | ->setFlush(true) | ||||
->setTitle(pht('Query Overheated')) | ->setTitle(pht('Query Overheated')) | ||||
->setErrors( | ->setErrors( | ||||
array( | array( | ||||
$message, | $message, | ||||
)); | )); | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |