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

? sunnavy sunnavy at bestpractical.com
Wed Apr 3 17:20:35 EDT 2019


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

- Log -----------------------------------------------------------------
commit 77348044ce560978efbd7f8c4642dbd569edb82b
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. Corresponding
    tests also updated accordingly.
    
    Fixes: I#30082
    Fixes: I#32584

diff --git a/share/html/Ticket/Elements/ShowUpdateStatus b/share/html/Ticket/Elements/ShowUpdateStatus
index 55f391d7d..ec86fe771 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 &>
+<div>
+<span class="new-messages-on-ticket">
 <&|/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&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>.</&>
+</span>
+<span class="new-messages-buttons">
+<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."#txn-" . $txn->id |n %>"><&|/l&>Jump to Unread</&></a>
+<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id. "&MarkAsSeen=1" |n %>"><&|/l&>Mark as Seen</&></a>
+<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id |n %>"><&|/l&>Jump & Mark as Seen</&></a>
+</span>
+</div>
 </&>
 </div>
 <%ARGS>
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