mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
Changing criteria for showing badges in object timeline view
Summary: Ref T8941 Test Plan: Create an object and create multiple transactions, some time apart to ensure that time clumping isn't interfering. Make sure that events that are large enough to have a dropdown menu show badges under author pic. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin Maniphest Tasks: T8941 Differential Revision: https://secure.phabricator.com/D15543
This commit is contained in:
parent
82f97b6b33
commit
0ea738f18f
2 changed files with 6 additions and 7 deletions
|
@ -342,6 +342,8 @@ final class PHUITimelineEventView extends AphrontView {
|
|||
// Render "extra" information (timestamp, etc).
|
||||
$extra = $this->renderExtra($events);
|
||||
|
||||
$show_badges = false;
|
||||
|
||||
$group_titles = array();
|
||||
$group_items = array();
|
||||
$group_children = array();
|
||||
|
@ -358,6 +360,7 @@ final class PHUITimelineEventView extends AphrontView {
|
|||
|
||||
if ($event->hasChildren()) {
|
||||
$group_children[] = $event->renderChildren();
|
||||
$show_badges = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -382,7 +385,7 @@ final class PHUITimelineEventView extends AphrontView {
|
|||
'href' => $this->userHandle->getURI(),
|
||||
),
|
||||
'');
|
||||
if ($this->badges) {
|
||||
if ($this->badges && $show_badges) {
|
||||
$flex = new PHUIBadgeBoxView();
|
||||
$flex->addItems($this->badges);
|
||||
$flex->setCollapsed(true);
|
||||
|
|
|
@ -224,12 +224,6 @@ final class PHUITimelineView extends AphrontView {
|
|||
|
||||
$user_phids = array();
|
||||
foreach ($events as $key => $event) {
|
||||
if (!$event->hasChildren()) {
|
||||
// This is a minor event, so we don't have space to show badges.
|
||||
unset($events[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$author_phid = $event->getAuthorPHID();
|
||||
if (!$author_phid) {
|
||||
unset($events[$key]);
|
||||
|
@ -259,7 +253,9 @@ final class PHUITimelineView extends AphrontView {
|
|||
$awards = mgroup($awards, 'getRecipientPHID');
|
||||
|
||||
foreach ($events as $event) {
|
||||
|
||||
$author_awards = idx($awards, $event->getAuthorPHID(), array());
|
||||
|
||||
$badges = array();
|
||||
foreach ($author_awards as $award) {
|
||||
$badge = $award->getBadge();
|
||||
|
|
Loading…
Reference in a new issue