1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 13:22:42 +01:00

Fix button for "All Problem Commits" on Owners packages

Summary:
Ref T9482. This button goes to the wrong place and this table conditionally hides itself so I missed it.

Instead:

  - Always show the table, with an empty string if there are no relevant commits.
  - Link to a working UI.

Test Plan: Saw table. Clicked button.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9482

Differential Revision: https://secure.phabricator.com/D14189
This commit is contained in:
epriestley 2015-09-29 06:43:55 -07:00
parent fa943f744b
commit be83d62375

View file

@ -76,27 +76,28 @@ final class PhabricatorOwnersDetailController
'auditorPHIDs' => $package->getPHID(), 'auditorPHIDs' => $package->getPHID(),
)); ));
$status_concern = DiffusionCommitQuery::AUDIT_STATUS_CONCERN;
$attention_commits = id(new DiffusionCommitQuery()) $attention_commits = id(new DiffusionCommitQuery())
->setViewer($request->getUser()) ->setViewer($request->getUser())
->withAuditorPHIDs(array($package->getPHID())) ->withAuditorPHIDs(array($package->getPHID()))
->withAuditStatus(DiffusionCommitQuery::AUDIT_STATUS_CONCERN) ->withAuditStatus($status_concern)
->needCommitData(true) ->needCommitData(true)
->setLimit(10) ->setLimit(10)
->execute(); ->execute();
if ($attention_commits) { $view = id(new PhabricatorAuditListView())
$view = id(new PhabricatorAuditListView()) ->setUser($viewer)
->setUser($viewer) ->setNoDataString(pht('This package has no open problem commits.'))
->setCommits($attention_commits); ->setCommits($attention_commits);
$commit_views[] = array( $commit_views[] = array(
'view' => $view, 'view' => $view,
'header' => pht('Commits in this Package that Need Attention'), 'header' => pht('Commits in this Package that Need Attention'),
'button' => id(new PHUIButtonView()) 'button' => id(new PHUIButtonView())
->setTag('a') ->setTag('a')
->setHref($commit_uri->alter('status', 'open')) ->setHref($commit_uri->alter('status', $status_concern))
->setText(pht('View All Problem Commits')), ->setText(pht('View All Problem Commits')),
); );
}
$all_commits = id(new DiffusionCommitQuery()) $all_commits = id(new DiffusionCommitQuery())
->setViewer($request->getUser()) ->setViewer($request->getUser())