@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Display application status in tip for needs attention number

Summary:
Also splits blocking and active revisions.

This could display 0 with non-empty tip over it.
It's intentional meaning that 0 objects need your attention but there is still some work to do.

Test Plan: Hovered over number.

Reviewers: epriestley, chad

Reviewed By: chad

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5049

vrana c29fe2de 6cee50d4

+54 -28
+2 -6
src/applications/audit/application/PhabricatorApplicationAudit.php
··· 56 56 ->execute(); 57 57 58 58 $count = count($audits); 59 - $type = $count 60 - ? PhabricatorApplicationStatusView::TYPE_INFO 61 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 59 + $type = PhabricatorApplicationStatusView::TYPE_INFO; 62 60 $status[] = id(new PhabricatorApplicationStatusView()) 63 61 ->setType($type) 64 62 ->setText(pht('%d Commit(s) Awaiting Audit', $count)) ··· 71 69 ->execute(); 72 70 73 71 $count = count($commits); 74 - $type = $count 75 - ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 76 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 72 + $type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 77 73 $status[] = id(new PhabricatorApplicationStatusView()) 78 74 ->setType($type) 79 75 ->setText(pht('%d Problem Commit(s)', $count))
+12 -8
src/applications/differential/application/PhabricatorApplicationDifferential.php
··· 87 87 88 88 $status = array(); 89 89 90 - $active = count($blocking) + count($active); 91 - $type = $active 92 - ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 93 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 90 + $blocking = count($blocking); 91 + $type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 92 + $status[] = id(new PhabricatorApplicationStatusView()) 93 + ->setType($type) 94 + ->setText(pht('%d Review(s) Blocking Others', $blocking)) 95 + ->setCount($blocking); 96 + 97 + $active = count($active); 98 + $type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 94 99 $status[] = id(new PhabricatorApplicationStatusView()) 95 100 ->setType($type) 96 101 ->setText(pht('%d Review(s) Need Attention', $active)) 97 102 ->setCount($active); 98 103 99 104 $waiting = count($waiting); 100 - $type = $waiting 101 - ? PhabricatorApplicationStatusView::TYPE_INFO 102 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 105 + $type = PhabricatorApplicationStatusView::TYPE_INFO; 103 106 $status[] = id(new PhabricatorApplicationStatusView()) 104 107 ->setType($type) 105 - ->setText(pht('%d Review(s) Waiting on Others', $waiting)); 108 + ->setText(pht('%d Review(s) Waiting on Others', $waiting)) 109 + ->setCount($waiting); 106 110 107 111 return $status; 108 112 }
+1 -3
src/applications/flag/application/PhabricatorApplicationFlags.php
··· 32 32 ->execute(); 33 33 34 34 $count = count($flags); 35 - $type = $count 36 - ? PhabricatorApplicationStatusView::TYPE_INFO 37 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 35 + $type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 38 36 $status[] = id(new PhabricatorApplicationStatusView()) 39 37 ->setType($type) 40 38 ->setText(pht('%d Flagged Object(s)', $count))
+4 -7
src/applications/maniphest/application/PhabricatorApplicationManiphest.php
··· 85 85 $query->execute(); 86 86 87 87 $count = $query->getRowCount(); 88 - $type = $count 89 - ? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION 90 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 88 + $type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 91 89 $status[] = id(new PhabricatorApplicationStatusView()) 92 90 ->setType($type) 93 91 ->setText(pht('%d Unbreak Now Task(s)!', $count)) ··· 101 99 $query->execute(); 102 100 103 101 $count = $query->getRowCount(); 104 - $type = $count 105 - ? PhabricatorApplicationStatusView::TYPE_INFO 106 - : PhabricatorApplicationStatusView::TYPE_EMPTY; 102 + $type = PhabricatorApplicationStatusView::TYPE_INFO; 107 103 $status[] = id(new PhabricatorApplicationStatusView()) 108 104 ->setType($type) 109 - ->setText(pht('%d Assigned Task(s)', $count)); 105 + ->setText(pht('%d Assigned Task(s)', $count)) 106 + ->setCount($count); 110 107 111 108 return $status; 112 109 }
+16 -3
src/applications/meta/view/PhabricatorApplicationLaunchView.php
··· 57 57 } 58 58 59 59 $count = 0; 60 + $text = array(); 60 61 if ($this->status) { 62 + $attention = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION; 61 63 foreach ($this->status as $status) { 62 - $count += $status->getCount(); 64 + if ($status->getType() == $attention) { 65 + $count += $status->getCount(); 66 + } 67 + if ($status->getCount()) { 68 + $text[] = $status->getText(); 69 + } 63 70 } 64 71 } 65 72 66 - if ($count) { 67 - $content[] = phutil_tag( 73 + if ($text) { 74 + Javelin::initBehavior('phabricator-tooltips'); 75 + $content[] = javelin_tag( 68 76 'span', 69 77 array( 78 + 'sigil' => 'has-tooltip', 79 + 'meta' => array( 80 + 'tip' => implode("\n", $text), 81 + 'size' => 240, 82 + ), 70 83 'class' => 'phabricator-application-launch-attention', 71 84 ), 72 85 $count);
+14 -1
src/applications/meta/view/PhabricatorApplicationStatusView.php
··· 17 17 return $this; 18 18 } 19 19 20 + public function getType() { 21 + return $this->type; 22 + } 23 + 20 24 public function setText($text) { 21 25 $this->text = $text; 22 26 return $this; 27 + } 28 + 29 + public function getText() { 30 + return $this->text; 23 31 } 24 32 25 33 public function setCount($count) { ··· 32 40 } 33 41 34 42 public function render() { 43 + $type = $this->type; 44 + if (!$this->count) { 45 + $type = self::TYPE_EMPTY; 46 + } 47 + 35 48 $classes = array( 36 49 'phabricator-application-status', 37 - 'phabricator-application-status-type-'.$this->type, 50 + 'phabricator-application-status-type-'.$type, 38 51 ); 39 52 40 53 return phutil_tag(
+5
src/infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php
··· 125 125 '%d Problem Commits', 126 126 ), 127 127 128 + '%d Review(s) Blocking Others' => array( 129 + '%d Review Blocking Others', 130 + '%d Reviews Blocking Others', 131 + ), 132 + 128 133 '%d Review(s) Need Attention' => array( 129 134 '%d Review Needs Attention', 130 135 '%d Reviews Need Attention',