[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-61-gcd34c6c
? sunnavy
sunnavy at bestpractical.com
Wed May 26 04:33:37 EDT 2010
The branch, 3.8-trunk has been updated
via cd34c6cd10030f70e688a9768ee115eda26d68e7 (commit)
via df2885a385bc86cf459d789cd1c7afcc57f2a978 (commit)
from b986cfda9f5c08270e87785fb1a7c606ffa73a66 (commit)
Summary of changes:
share/html/Ticket/Display.html | 5 +++--
share/html/Ticket/Elements/ShowUpdateStatus | 3 +--
t/web/ticket_seen.t | 26 +++++++++++++++++++++-----
3 files changed, 25 insertions(+), 9 deletions(-)
- Log -----------------------------------------------------------------
commit df2885a385bc86cf459d789cd1c7afcc57f2a978
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed May 26 16:27:29 2010 +0800
tests for unread message anchor
diff --git a/t/web/ticket_seen.t b/t/web/ticket_seen.t
index 00b2632..3a77a58 100644
--- a/t/web/ticket_seen.t
+++ b/t/web/ticket_seen.t
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use RT::Test tests => 16;
+use RT::Test tests => 21;
my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
ok $queue && $queue->id, 'loaded or created queue';
@@ -52,6 +52,14 @@ diag "user B adds a message, we check that user A see notification and can clear
my ($status, $msg) = $ticket->Correspond( Content => 'bla-bla' );
ok $status, 'added reply' or diag "error: $msg";
+ my $txns = $ticket->Transactions;
+ $txns->Limit(
+ FIELD => 'Type',
+ VALUE => "Correspond",
+ );
+ my $txn = $txns->Last;
+ my $reply_id = $txn->id;
+ ok( $reply_id, 'got correspond txn id' );
$agent_a->goto_ticket($tid);
$agent_a->content_like(qr/bla-bla/ims, 'the message on the page');
@@ -61,11 +69,23 @@ diag "user B adds a message, we check that user A see notification and can clear
'we have not seen something'
);
+ $agent_a->follow_link_ok(
+ { text => 'jump to the first unread message' },
+ 'try to jump to first unread message'
+ );
+ like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' );
+
$agent_a->follow_link_ok({text => 'jump to the first unread message and mark all messages as seen'}, 'try to mark all as seen');
$agent_a->content_like(
qr/Marked all messages as seen/ims,
'see success message'
);
+ like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' );
+
+ $agent_a->content_like(
+ qr/Marked all messages as seen/ims,
+ 'see success message'
+ );
$agent_a->goto_ticket($tid);
$agent_a->content_unlike(
@@ -74,7 +94,3 @@ diag "user B adds a message, we check that user A see notification and can clear
);
}
-
-
-
-
commit cd34c6cd10030f70e688a9768ee115eda26d68e7
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed May 26 16:32:11 2010 +0800
transmit Anchor arg for redirect
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index f8eaf39..549ba93 100755
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -189,8 +189,9 @@ if (@Actions) {
my $key = Digest::MD5::md5_hex( rand(1024) );
push @{ $session{"Actions"}->{$key} ||= [] }, @Actions;
$session{'i'}++;
- RT::Interface::Web::Redirect( RT->Config->Get('WebURL') . "Ticket/Display.html?id=" . $TicketObj->id . "&results=" . $key );
-
+ my $url = RT->Config->Get('WebURL') . "Ticket/Display.html?id=" . $TicketObj->id . "&results=" . $key;
+ $url .= '#' . $ARGS{Anchor} if $ARGS{Anchor};
+ RT::Interface::Web::Redirect($url);
}
my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj, Tickets => $Tickets);
diff --git a/share/html/Ticket/Elements/ShowUpdateStatus b/share/html/Ticket/Elements/ShowUpdateStatus
index 4eb53b4..a48eec0 100644
--- a/share/html/Ticket/Elements/ShowUpdateStatus
+++ b/share/html/Ticket/Elements/ShowUpdateStatus
@@ -50,8 +50,7 @@
<&|/l, &>There are unread messages on this ticket.</&>
<&|/l,
RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id,
- RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1". "#txn-".$txn->id
-
+ RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id
&>You can <a href="[_1]">jump to the first unread message</a> or <a href="[_2]">jump to the first unread message and mark all messages as seen</a>.</&>
</&>
</div>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list