Page MenuHomePhabricator

D19640.id46934.diff
No OneTemporary

D19640.id46934.diff

diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
--- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php
+++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php
@@ -67,35 +67,48 @@
->setKey('responsiblePHIDs')
->setConduitKey('responsible')
->setAliases(array('responsible', 'responsibles', 'responsiblePHID'))
- ->setDatasource(new DifferentialResponsibleDatasource()),
+ ->setDatasource(new DifferentialResponsibleDatasource())
+ ->setDescription(
+ pht(
+ 'Find commits where given users, projects, or packages are '.
+ 'responsible for the next steps in the audit workflow.')),
id(new PhabricatorUsersSearchField())
->setLabel(pht('Authors'))
->setKey('authorPHIDs')
->setConduitKey('authors')
- ->setAliases(array('author', 'authors', 'authorPHID')),
+ ->setAliases(array('author', 'authors', 'authorPHID'))
+ ->setDescription(pht('Find commits authored by particular users.')),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Auditors'))
->setKey('auditorPHIDs')
->setConduitKey('auditors')
->setAliases(array('auditor', 'auditors', 'auditorPHID'))
- ->setDatasource(new DiffusionAuditorFunctionDatasource()),
+ ->setDatasource(new DiffusionAuditorFunctionDatasource())
+ ->setDescription(
+ pht(
+ 'Find commits where given users, projects, or packages are '.
+ 'auditors.')),
id(new PhabricatorSearchCheckboxesField())
->setLabel(pht('Audit Status'))
->setKey('statuses')
->setAliases(array('status'))
- ->setOptions(PhabricatorAuditCommitStatusConstants::getStatusNameMap()),
+ ->setOptions(PhabricatorAuditCommitStatusConstants::getStatusNameMap())
+ ->setDescription(pht('Find commits with given audit statuses.')),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Repositories'))
->setKey('repositoryPHIDs')
->setConduitKey('repositories')
->setAliases(array('repository', 'repositories', 'repositoryPHID'))
- ->setDatasource(new DiffusionRepositoryFunctionDatasource()),
+ ->setDatasource(new DiffusionRepositoryFunctionDatasource())
+ ->setDescription(pht('Find commits in particular repositories.')),
id(new PhabricatorSearchDatasourceField())
->setLabel(pht('Packages'))
->setKey('packagePHIDs')
->setConduitKey('packages')
->setAliases(array('package', 'packages', 'packagePHID'))
- ->setDatasource(new PhabricatorOwnersPackageDatasource()),
+ ->setDatasource(new PhabricatorOwnersPackageDatasource())
+ ->setDescription(
+ pht('Find commits which affect given packages.')),
id(new PhabricatorSearchThreeStateField())
->setLabel(pht('Unreachable'))
->setKey('unreachable')
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
@@ -3,6 +3,8 @@
final class PhabricatorDashboardQueryPanelType
extends PhabricatorDashboardPanelType {
+ private $pager;
+
public function getPanelTypeKey() {
return 'query';
}
@@ -108,6 +110,8 @@
$results = $engine->executeQuery($query, $pager);
+ $this->pager = $pager;
+
return $engine->renderResults($results, $saved);
}
@@ -120,10 +124,29 @@
$search_engine = $this->getSearchEngine($panel);
$key = $panel->getProperty('key');
$href = $search_engine->getQueryResultsPageURI($key);
- $icon = id(new PHUIIconView())
- ->setIcon('fa-search')
- ->setHref($href);
- $header->addActionItem($icon);
+
+ $has_more = false;
+ if (isset($this->pager)) {
+ $pager = $this->pager;
+ if ($pager instanceof AphrontCursorPagerView) {
+ $has_more = $pager->getHasMoreResults();
+ } else if ($pager instanceof PHUIPagerView) {
+ $has_more = $pager->getHasMorePages();
+ }
+ }
+
+ if ($has_more) {
+ $text = pht('View All (More Available)');
+ } else {
+ $text = pht('View All');
+ }
+
+ $icon = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setIcon('fa-search')
+ ->setText($text)
+ ->setHref($href);
+ $header->addActionLink($icon);
return $header;
}
diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
--- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
+++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
@@ -161,7 +161,9 @@
will be applied first as a starting point, then any additional values in
`constraints` will be applied, overwriting the defaults from the original query.
-Specify constraints like this:
+Different endpoints support different constraints. The constraints this method
+supports are detailed below. As an example, you might specify constraints like
+this:
```lang=json, name="Example Custom Constraints"
{

File Metadata

Mime Type
text/plain
Expires
Oct 26 2025, 9:54 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9032746
Default Alt Text
D19640.id46934.diff (5 KB)

Event Timeline