[Rt-commit] rt branch, 4.4/improve-jump-to-unread-ui, created. rt-4.4.2-38-gb8e3d3bb2

Maureen Mirville maureen at bestpractical.com
Mon Jan 22 09:17:43 EST 2018


The branch, 4.4/improve-jump-to-unread-ui has been created
        at  b8e3d3bb2e8637e06900bdf761a40258fc87132f (commit)

- Log -----------------------------------------------------------------
commit b8e3d3bb2e8637e06900bdf761a40258fc87132f
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Fri Sep 1 11:27:26 2017 -0400

    Improve UI of unread messages notification
    
    When a user has opted to receive notifications of unread messages,
    a panel at the top of the ticket display page gives the user the
    option to mark messages as read and also jump to the first unread
    message. The previous UI used links within the text making it
    difficult to see. UI updated with buttons instead. Previous
    variable, "UpdateStatus" was changed to "UnreadMessages" to make
    it clear that it refers to tickets with unread messages.
    Corresponding tests also updated accordingly.
    
    Fixes: I#30082
    Fixes: I#32584

diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index 0add81dd7..47a80a367 100644
--- a/share/html/Asset/Search/Bulk.html
+++ b/share/html/Asset/Search/Bulk.html
@@ -94,8 +94,8 @@
     <td><input name="UpdateDescription" value="<% $ARGS{'Description'}||'' %>" size="40"></td>
   </tr>
   <tr class="asset-status">
-    <td class="label"><label for="UpdateStatus"><&|/l&>Status</&></label></td>
-    <td><& /Asset/Elements/SelectStatus, Name => 'UpdateStatus', DefaultValue => 1, CatalogObj => $catalog_obj &></td>
+    <td class="label"><label for="UnreadMessages"><&|/l&>Status</&></label></td>
+    <td><& /Asset/Elements/SelectStatus, Name => 'UnreadMessages', DefaultValue => 1, CatalogObj => $catalog_obj &></td>
   </tr>
 </table>
 %   my $cfs = $catalog_obj->AssetCustomFields;
diff --git a/share/html/Elements/RT__Ticket/ColumnMap b/share/html/Elements/RT__Ticket/ColumnMap
index 089ccea11..3ca48a962 100644
--- a/share/html/Elements/RT__Ticket/ColumnMap
+++ b/share/html/Elements/RT__Ticket/ColumnMap
@@ -263,7 +263,7 @@ $COLUMN_MAP = {
         title     => 'SLA', # loc
         value     => sub { return $_[0]->SLA }
     },
-    UpdateStatus => {
+    UnreadMessages => {
         title => 'New messages', # loc
         value => sub {
             my $txn = $_[0]->SeenUpTo or return $_[0]->loc('No');
diff --git a/share/html/Search/Elements/BuildFormatString b/share/html/Search/Elements/BuildFormatString
index 711de89c0..538857901 100644
--- a/share/html/Search/Elements/BuildFormatString
+++ b/share/html/Search/Elements/BuildFormatString
@@ -71,7 +71,7 @@ $CurrentDisplayColumns => undef
 # All the things we can display in the format string by default
 my @fields = qw(
     id QueueName Subject
-    Status ExtendedStatus UpdateStatus
+    Status ExtendedStatus UnreadMessages
     Type
 
     OwnerName Requestors Cc AdminCc CreatedBy LastUpdatedBy
diff --git a/share/html/Ticket/Elements/ShowUpdateStatus b/share/html/Ticket/Elements/ShowUpdateStatus
index 55f391d7d..a6d7cd7f3 100644
--- a/share/html/Ticket/Elements/ShowUpdateStatus
+++ b/share/html/Ticket/Elements/ShowUpdateStatus
@@ -47,11 +47,16 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="unread-messages">
 <&| /Widgets/TitleBox, title => loc('New messages'), title_href => "#txn-". $txn->id &>
-<&|/l&>There are unread messages on this ticket.</&>
 <&|/l, 
- RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id. "#txn-".$txn->id,
+ RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id. "&MarkAsSeen=1",
  RT->Config->Get('WebPath') ."/$DisplayPath/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>
+<a class="button" href="[_1]">Mark as Seen</a>
+<a class="button" href="[_2]">Jump to Unread</a>
+</div>
+<&|/l&>There are unread messages on this ticket.</&>
+</&>
 </&>
 </div>
 <%ARGS>
@@ -61,5 +66,4 @@ $DisplayPath => $session{'CurrentUser'}->Privileged ? 'Ticket' : 'SelfService'
 <%INIT>
 return unless (RT->Config->Get( 'ShowUnreadMessageNotifications', $session{'CurrentUser'}));
 my $txn = $Ticket->SeenUpTo or return;
-
 </%INIT>
diff --git a/share/html/Tools/MyDay.html b/share/html/Tools/MyDay.html
index 6b591a695..026d77dcb 100644
--- a/share/html/Tools/MyDay.html
+++ b/share/html/Tools/MyDay.html
@@ -64,7 +64,7 @@ href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$
 <td rowspan="2"><span class="label"><&|/l&>Comments</&>:<br /></span><textarea name="UpdateContent-<%$Ticket->Id%>" rows="5"
 cols="60"></textarea></td></tr>
 <tr <%$class|n%>>
-<td><span class="label"><&|/l&>Status</&>:</span> <& /Ticket/Elements/SelectStatus, Name=> 'UpdateStatus-'.$Ticket->Id, TicketObj => $Ticket &></td>
+<td><span class="label"><&|/l&>Status</&>:</span> <& /Ticket/Elements/SelectStatus, Name=> 'UnreadMessages-'.$Ticket->Id, TicketObj => $Ticket &></td>
                   </tr>
 
 % }
@@ -78,7 +78,7 @@ my $title = loc("What I did today");
 my $i = 0;
 my @results;
 foreach my $arg ( keys %ARGS ) {
-    next unless ( $arg =~ /^UpdateStatus-(\d*)$/ );
+    next unless ( $arg =~ /^UnreadMessages-(\d*)$/ );
     my $id     = $1;
     my $ticket = LoadTicket($id);
     next unless ( $ticket->id );
@@ -93,7 +93,7 @@ foreach my $arg ( keys %ARGS ) {
             push @results, loc( "Ticket [_1]: [_2]", $id, $msg );
     }
 
-    if ( my $status = $ARGS{ 'UpdateStatus-' . $id } ) {
+    if ( my $status = $ARGS{ 'UnreadMessages-' . $id } ) {
         if ( $status ne $ticket->Status ) {
             my ( $val, $msg ) = $ticket->SetStatus($status);
             push @results, loc( "Ticket [_1]: [_2]", $id, $msg );
diff --git a/t/web/self_service.t b/t/web/self_service.t
index 7afc008c6..a7af374cb 100644
--- a/t/web/self_service.t
+++ b/t/web/self_service.t
@@ -44,7 +44,7 @@ $m->content_contains( "There are unread messages on this ticket." );
 
 # mark the message as read
 $m->follow_link_ok(
-    { text => 'jump to the first unread message and mark all messages as seen' },
+    { text => 'Mark as Seen' },
     'followed mark as seen link'
 );
 
diff --git a/t/web/ticket_seen.t b/t/web/ticket_seen.t
index e40782f6a..fa3967fde 100644
--- a/t/web/ticket_seen.t
+++ b/t/web/ticket_seen.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 23, config => 'Set($ShowUnreadMessageNotifications, 1);';
+use RT::Test nodata => 1, tests => undef, config => 'Set($ShowUnreadMessageNotifications, 1);';
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
 ok $queue && $queue->id, 'loaded or created queue';
@@ -69,18 +69,16 @@ diag "user B adds a message, we check that user A see notification and can clear
     );
 
     $agent_a->follow_link_ok(
-        { text => 'jump to the first unread message' },
+        { text => 'Jump to Unread' },
         '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_contains(
         'Marked all messages as seen',
         'see success message'
     );
     like( $agent_a->base, qr/#txn-$reply_id$/, 'contains anchor' );
-
     $agent_a->content_contains(
         'Marked all messages as seen',
         'see success message'
@@ -93,3 +91,4 @@ diag "user B adds a message, we check that user A see notification and can clear
     );
 }
 
+done_testing();

-----------------------------------------------------------------------


More information about the rt-commit mailing list