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

Maureen Mirville maureen at bestpractical.com
Fri Dec 14 14:33:35 EST 2018


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

- Log -----------------------------------------------------------------
commit c1f12f696edd8ea308f82ea2c34e69e342053d4a
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..de8e4ecd2 100644
--- a/share/html/Ticket/Elements/ShowUpdateStatus
+++ b/share/html/Ticket/Elements/ShowUpdateStatus
@@ -47,11 +47,22 @@
 %# 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,
+<&|/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>
+<span class="new-messages-on-ticket">
+<&|/l&>There are unread messages on this ticket.</&>
+</span>
+<span class="new-messages-buttons">
+<a class="button small-button" href="[_1]">Jump to Unread</a>
+<a class="button small-button" href="[_2]">Mark as Seen</a>
+<a class="button small-button" href="[_3]">Jump & Mark as Seen</a>
+</span>
+</div>
+</&>
 </&>
 </div>
 <%ARGS>
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/share/static/css/base/ticket.css b/share/static/css/base/ticket.css
index 0fec78778..5cd64500a 100644
--- a/share/static/css/base/ticket.css
+++ b/share/static/css/base/ticket.css
@@ -76,7 +76,19 @@
 .ticket-summary .titlebox .titlebox-title .left a, .ticket-summary .titlebox .titlebox-title .left a:visited { color: #fff;}
 
 .unread-messages .titlebox-content :link {
-    text-decoration: underline;
+    text-decoration: none;
+}
+
+.small-button {
+    padding: 0.2em 0.5em !important;
+}
+
+.new-messages-buttons {
+    display: inline-block;
+}
+
+.new-messages-on-ticket {
+    font-style: italic;
 }
 
 .ticket-inactive {
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 0fa4f7cd0..bc592d9c7 100644
--- a/t/web/ticket_seen.t
+++ b/t/web/ticket_seen.t
@@ -69,12 +69,17 @@ 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 & Mark as Seen' },
         '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'

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


More information about the rt-commit mailing list