1
0
Fork 0
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:
vrana 2013-02-22 04:57:43 -08:00
parent 4dc49f7a93
commit 6404fa5c0e
5 changed files with 19 additions and 20 deletions

View file

@ -49,20 +49,6 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication {
$phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user); $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()) $commits = id(new PhabricatorAuditCommitQuery())
->withAuthorPHIDs($phids) ->withAuthorPHIDs($phids)
->withStatus(PhabricatorAuditQuery::STATUS_OPEN) ->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
@ -75,6 +61,19 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication {
->setText(pht('%d Problem Commit(s)', $count)) ->setText(pht('%d Problem Commit(s)', $count))
->setCount($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; return $status;
} }

View file

@ -95,7 +95,7 @@ final class PhabricatorApplicationDifferential extends PhabricatorApplication {
->setCount($blocking); ->setCount($blocking);
$active = count($active); $active = count($active);
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; $type = PhabricatorApplicationStatusView::TYPE_WARNING;
$status[] = id(new PhabricatorApplicationStatusView()) $status[] = id(new PhabricatorApplicationStatusView())
->setType($type) ->setType($type)
->setText(pht('%d Review(s) Need Attention', $active)) ->setText(pht('%d Review(s) Need Attention', $active))

View file

@ -32,7 +32,7 @@ final class PhabricatorApplicationFlags extends PhabricatorApplication {
->execute(); ->execute();
$count = count($flags); $count = count($flags);
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; $type = PhabricatorApplicationStatusView::TYPE_WARNING;
$status[] = id(new PhabricatorApplicationStatusView()) $status[] = id(new PhabricatorApplicationStatusView())
->setType($type) ->setType($type)
->setText(pht('%d Flagged Object(s)', $count)) ->setText(pht('%d Flagged Object(s)', $count))

View file

@ -99,7 +99,7 @@ final class PhabricatorApplicationManiphest extends PhabricatorApplication {
$query->execute(); $query->execute();
$count = $query->getRowCount(); $count = $query->getRowCount();
$type = PhabricatorApplicationStatusView::TYPE_INFO; $type = PhabricatorApplicationStatusView::TYPE_WARNING;
$status[] = id(new PhabricatorApplicationStatusView()) $status[] = id(new PhabricatorApplicationStatusView())
->setType($type) ->setType($type)
->setText(pht('%d Assigned Task(s)', $count)) ->setText(pht('%d Assigned Task(s)', $count))

View file

@ -59,9 +59,9 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$count = 0; $count = 0;
$text = array(); $text = array();
if ($this->status) { if ($this->status) {
$attention = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; $info = PhabricatorApplicationStatusView::TYPE_INFO;
foreach ($this->status as $status) { foreach ($this->status as $status) {
if ($status->getType() == $attention) { if ($status->getType() != $info) {
$count += $status->getCount(); $count += $status->getCount();
} }
if ($status->getCount()) { if ($status->getCount()) {
@ -70,7 +70,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
} }
} }
if ($text) { if ($count) {
Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('phabricator-tooltips');
$content[] = javelin_tag( $content[] = javelin_tag(
'span', 'span',