From 6404fa5c0e59fd0a10863e355efd39ef61e5a889 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 22 Feb 2013 04:57:43 -0800 Subject: [PATCH] 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 --- .../PhabricatorApplicationAudit.php | 27 +++++++++---------- .../PhabricatorApplicationDifferential.php | 2 +- .../PhabricatorApplicationFlags.php | 2 +- .../PhabricatorApplicationManiphest.php | 2 +- .../view/PhabricatorApplicationLaunchView.php | 6 ++--- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/applications/audit/application/PhabricatorApplicationAudit.php b/src/applications/audit/application/PhabricatorApplicationAudit.php index f36583689e..a8209e28db 100644 --- a/src/applications/audit/application/PhabricatorApplicationAudit.php +++ b/src/applications/audit/application/PhabricatorApplicationAudit.php @@ -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; } diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php index e1035ca7ad..1ba3d29185 100644 --- a/src/applications/differential/application/PhabricatorApplicationDifferential.php +++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php @@ -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)) diff --git a/src/applications/flag/application/PhabricatorApplicationFlags.php b/src/applications/flag/application/PhabricatorApplicationFlags.php index b37329c3de..46581965e0 100644 --- a/src/applications/flag/application/PhabricatorApplicationFlags.php +++ b/src/applications/flag/application/PhabricatorApplicationFlags.php @@ -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)) diff --git a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php index ce7870b008..9701393878 100644 --- a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php +++ b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php @@ -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)) diff --git a/src/applications/meta/view/PhabricatorApplicationLaunchView.php b/src/applications/meta/view/PhabricatorApplicationLaunchView.php index b065b70307..6649125cd9 100644 --- a/src/applications/meta/view/PhabricatorApplicationLaunchView.php +++ b/src/applications/meta/view/PhabricatorApplicationLaunchView.php @@ -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',