mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
Don't display 0 in launch view
Summary: This includes assigned tasks in the Maniphest number. Test Plan: Looked at it. Reviewers: chad, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D5067
This commit is contained in:
parent
4dc49f7a93
commit
6404fa5c0e
5 changed files with 19 additions and 20 deletions
|
@ -49,20 +49,6 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication {
|
|||
|
||||
$phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user);
|
||||
|
||||
$audits = id(new PhabricatorAuditQuery())
|
||||
->withAuditorPHIDs($phids)
|
||||
->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
|
||||
->withAwaitingUser($user)
|
||||
->execute();
|
||||
|
||||
$count = count($audits);
|
||||
$type = PhabricatorApplicationStatusView::TYPE_INFO;
|
||||
$status[] = id(new PhabricatorApplicationStatusView())
|
||||
->setType($type)
|
||||
->setText(pht('%d Commit(s) Awaiting Audit', $count))
|
||||
->setCount($count);
|
||||
|
||||
|
||||
$commits = id(new PhabricatorAuditCommitQuery())
|
||||
->withAuthorPHIDs($phids)
|
||||
->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
|
||||
|
@ -75,6 +61,19 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication {
|
|||
->setText(pht('%d Problem Commit(s)', $count))
|
||||
->setCount($count);
|
||||
|
||||
$audits = id(new PhabricatorAuditQuery())
|
||||
->withAuditorPHIDs($phids)
|
||||
->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
|
||||
->withAwaitingUser($user)
|
||||
->execute();
|
||||
|
||||
$count = count($audits);
|
||||
$type = PhabricatorApplicationStatusView::TYPE_WARNING;
|
||||
$status[] = id(new PhabricatorApplicationStatusView())
|
||||
->setType($type)
|
||||
->setText(pht('%d Commit(s) Awaiting Audit', $count))
|
||||
->setCount($count);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ final class PhabricatorApplicationDifferential extends PhabricatorApplication {
|
|||
->setCount($blocking);
|
||||
|
||||
$active = count($active);
|
||||
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
|
||||
$type = PhabricatorApplicationStatusView::TYPE_WARNING;
|
||||
$status[] = id(new PhabricatorApplicationStatusView())
|
||||
->setType($type)
|
||||
->setText(pht('%d Review(s) Need Attention', $active))
|
||||
|
|
|
@ -32,7 +32,7 @@ final class PhabricatorApplicationFlags extends PhabricatorApplication {
|
|||
->execute();
|
||||
|
||||
$count = count($flags);
|
||||
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
|
||||
$type = PhabricatorApplicationStatusView::TYPE_WARNING;
|
||||
$status[] = id(new PhabricatorApplicationStatusView())
|
||||
->setType($type)
|
||||
->setText(pht('%d Flagged Object(s)', $count))
|
||||
|
|
|
@ -99,7 +99,7 @@ final class PhabricatorApplicationManiphest extends PhabricatorApplication {
|
|||
$query->execute();
|
||||
|
||||
$count = $query->getRowCount();
|
||||
$type = PhabricatorApplicationStatusView::TYPE_INFO;
|
||||
$type = PhabricatorApplicationStatusView::TYPE_WARNING;
|
||||
$status[] = id(new PhabricatorApplicationStatusView())
|
||||
->setType($type)
|
||||
->setText(pht('%d Assigned Task(s)', $count))
|
||||
|
|
|
@ -59,9 +59,9 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
|||
$count = 0;
|
||||
$text = array();
|
||||
if ($this->status) {
|
||||
$attention = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
|
||||
$info = PhabricatorApplicationStatusView::TYPE_INFO;
|
||||
foreach ($this->status as $status) {
|
||||
if ($status->getType() == $attention) {
|
||||
if ($status->getType() != $info) {
|
||||
$count += $status->getCount();
|
||||
}
|
||||
if ($status->getCount()) {
|
||||
|
@ -70,7 +70,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
|
|||
}
|
||||
}
|
||||
|
||||
if ($text) {
|
||||
if ($count) {
|
||||
Javelin::initBehavior('phabricator-tooltips');
|
||||
$content[] = javelin_tag(
|
||||
'span',
|
||||
|
|
Loading…
Reference in a new issue