1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-21 19:19:12 +01:00

Add a "problem commits" prebuilt filter to Audits

Summary: Ref T4715. We show this number on the homepage, provide an easy way to query matching commits.

Test Plan: Clicked "problem commits", saw them.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4715

Differential Revision: https://secure.phabricator.com/D8880
This commit is contained in:
epriestley 2014-04-28 08:26:08 -07:00
parent 8716e734f0
commit 9da255efaa
2 changed files with 12 additions and 2 deletions

View file

@ -107,8 +107,10 @@ final class PhabricatorCommitSearchEngine
$names = array();
if ($this->requireViewer()->isLoggedIn()) {
$names['need_attention'] = pht('Need Attention');
$names['need'] = pht('Need Attention');
$names['problem'] = pht('Problem Commits');
}
$names['open'] = pht('Open Audits');
$names['all'] = pht('All Commits');
@ -129,7 +131,7 @@ final class PhabricatorCommitSearchEngine
'auditStatus',
DiffusionCommitQuery::AUDIT_STATUS_OPEN);
return $query;
case 'need_attention':
case 'need':
$query->setParameter('awaitingUserPHID', $viewer->getPHID());
$query->setParameter(
'auditStatus',
@ -138,6 +140,12 @@ final class PhabricatorCommitSearchEngine
'auditorPHIDs',
PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer));
return $query;
case 'problem':
$query->setParameter('commitAuthorPHIDs', array($viewer->getPHID()));
$query->setParameter(
'auditStatus',
DiffusionCommitQuery::AUDIT_STATUS_CONCERN);
return $query;
}
return parent::buildSavedQueryFromBuiltin($query_key);

View file

@ -418,6 +418,7 @@ final class PhabricatorHomeMainController
->withAuditorPHIDs($phids)
->withAuditStatus(DiffusionCommitQuery::AUDIT_STATUS_OPEN)
->withAuditAwaitingUser($user)
->needAuditRequests(true)
->needCommitData(true)
->setLimit(10);
@ -458,6 +459,7 @@ final class PhabricatorHomeMainController
->withAuthorPHIDs($phids)
->withAuditStatus(DiffusionCommitQuery::AUDIT_STATUS_CONCERN)
->needCommitData(true)
->needAuditRequests(true)
->setLimit(10);
$commits = $query->execute();