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

Maureen Mirville maureen at bestpractical.com
Tue Sep 5 17:20:44 EDT 2017


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

- Log -----------------------------------------------------------------
commit 73bca409c389d3003d8ba993d4e9294550c6c377
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.
    
    Fixes: I#30082
    Fixes: I#32584

diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index 0add81d..47a80a3 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 089ccea..3ca48a9 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 711de89..5388579 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 55f391d..a6d7cd7 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 6b591a6..026d77d 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 );

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


More information about the rt-commit mailing list