@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.

Strip timestamps from popup notification bubbles

Summary:
Fixes T11097. Currently, popup notifications show a useless timestamp with the current time, after D16041 made some things more consistent.

Strip these from the popup bubbles.

Test Plan:
- Saw a popup bubble, no timestamp.
- Viewed main notification list, saw timestamps.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11097

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

+41 -12
+13
src/applications/notification/builder/PhabricatorNotificationBuilder.php
··· 5 5 private $stories; 6 6 private $parsedStories; 7 7 private $user = null; 8 + private $showTimestamps = true; 8 9 9 10 public function __construct(array $stories) { 10 11 assert_instances_of($stories, 'PhabricatorFeedStory'); ··· 14 15 public function setUser($user) { 15 16 $this->user = $user; 16 17 return $this; 18 + } 19 + 20 + public function setShowTimestamps($show_timestamps) { 21 + $this->showTimestamps = $show_timestamps; 22 + return $this; 23 + } 24 + 25 + public function getShowTimestamps() { 26 + return $this->showTimestamps; 17 27 } 18 28 19 29 private function parseStories() { ··· 121 131 // TODO: Render a nice debuggable notice instead? 122 132 continue; 123 133 } 134 + 135 + $view->setShowTimestamp($this->getShowTimestamps()); 136 + 124 137 $null_view->appendChild($view->renderNotification($this->user)); 125 138 } 126 139
+2 -1
src/applications/notification/controller/PhabricatorNotificationIndividualController.php
··· 31 31 } 32 32 33 33 $builder = id(new PhabricatorNotificationBuilder(array($story))) 34 - ->setUser($viewer); 34 + ->setUser($viewer) 35 + ->setShowTimestamps(false); 35 36 36 37 $content = $builder->buildView()->render(); 37 38 $dict = $builder->buildDict();
+26 -11
src/view/phui/PHUIFeedStoryView.php
··· 17 17 private $chronologicalKey; 18 18 private $tags; 19 19 private $authorIcon; 20 + private $showTimestamp = true; 20 21 21 22 public function setTags($tags) { 22 23 $this->tags = $tags; ··· 97 98 return $this; 98 99 } 99 100 101 + public function setShowTimestamp($show_timestamp) { 102 + $this->showTimestamp = $show_timestamp; 103 + return $this; 104 + } 105 + 106 + public function getShowTimestamp() { 107 + return $this->showTimestamp; 108 + } 109 + 100 110 public function addProject($project) { 101 111 $this->projects[] = $project; 102 112 return $this; ··· 136 146 if (!$this->viewed) { 137 147 $classes[] = 'phabricator-notification-unread'; 138 148 } 139 - if ($this->epoch) { 140 - if ($user) { 141 - $foot = phabricator_datetime($this->epoch, $user); 142 - $foot = phutil_tag( 143 - 'span', 144 - array( 145 - 'class' => 'phabricator-notification-date', 146 - ), 147 - $foot); 149 + 150 + if ($this->getShowTimestamp()) { 151 + if ($this->epoch) { 152 + if ($user) { 153 + $foot = phabricator_datetime($this->epoch, $user); 154 + $foot = phutil_tag( 155 + 'span', 156 + array( 157 + 'class' => 'phabricator-notification-date', 158 + ), 159 + $foot); 160 + } else { 161 + $foot = null; 162 + } 148 163 } else { 149 - $foot = null; 164 + $foot = pht('No time specified.'); 150 165 } 151 166 } else { 152 - $foot = pht('No time specified.'); 167 + $foot = null; 153 168 } 154 169 155 170 return javelin_tag(