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

Maureen Mirville maureen at bestpractical.com
Fri Dec 21 08:01:48 EST 2018


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

- Log -----------------------------------------------------------------
commit 791813aa359ae8741e8e99fac86f1a99814b789a
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 55f391d7da..de8e4ecd2b 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/static/css/base/ticket.css b/share/static/css/base/ticket.css
index 0fec787787..5cd64500a4 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 7afc008c63..a7af374cbc 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 0fa4f7cd0d..bc592d9c73 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