1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Explain why older changes are hidden more clearly

Summary:
Fixes T9920. When hiding changes, tell users why so they can learn the comment rule (usually, "Changes from before your most recent comment are hidden."; sometimes they're hidden for pagination reasons).

Also use "Show Older Comments" instead of "Show older comments." for the action since I think it's a little more consistent to use title case for links/actions?

Test Plan:
  - Viewed a task with a lot of comments, saw a "most recent comment" element.
  - Artificially set page size to 3, saw a "lots of changes" hide.
  - Grepped for removed string.
  - Clicked both "show older stuff" links.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9920

Differential Revision: https://secure.phabricator.com/D14719
This commit is contained in:
epriestley 2015-12-09 06:40:47 -08:00
parent 2677380d0c
commit 5d5fd9e241
2 changed files with 26 additions and 7 deletions

View file

@ -810,11 +810,6 @@ final class PhabricatorUSEnglishTranslation
'%d Users Need Approval',
),
'%s older changes(s) are hidden.' => array(
'%d older change is hidden.',
'%d older changes are hidden.',
),
'%s, %s line(s)' => array(
array(
'%s, %s line',

View file

@ -91,6 +91,9 @@ final class PHUITimelineView extends AphrontView {
$spacer = self::renderSpacer();
// Track why we're hiding older results.
$hide_reason = null;
$hide = array();
$show = array();
@ -109,14 +112,35 @@ final class PHUITimelineView extends AphrontView {
// by default. We may still need to paginate if there are a large number
// of events.
$more = (bool)$hide;
if ($more) {
$hide_reason = 'comment';
}
if ($this->getPager()) {
if ($this->getPager()->getHasMoreResults()) {
if (!$more) {
$hide_reason = 'limit';
}
$more = true;
}
}
$events = array();
if ($more && $this->getPager()) {
switch ($hide_reason) {
case 'comment':
$hide_help = pht(
'Changes from before your most recent comment are hidden.');
break;
case 'limit':
default:
$hide_help = pht(
'There are a very large number of changes, so older changes are '.
'hidden.');
break;
}
$uri = $this->getPager()->getNextPageURI();
$uri->setQueryParam('quoteTargetID', $this->getQuoteTargetID());
$uri->setQueryParam('quoteRef', $this->getQuoteRef());
@ -127,7 +151,7 @@ final class PHUITimelineView extends AphrontView {
'class' => 'phui-timeline-older-transactions-are-hidden',
),
array(
pht('Older changes are hidden. '),
$hide_help,
' ',
javelin_tag(
'a',
@ -136,7 +160,7 @@ final class PHUITimelineView extends AphrontView {
'mustcapture' => true,
'sigil' => 'show-older-link',
),
pht('Show older changes.')),
pht('Show Older Changes')),
));
if ($show) {