[Rt-commit] rt branch 5.0/user-links-in-scroll-history created. rt-5.0.5-201-g218ba4ae05

BPS Git Server git at git.bestpractical.com
Wed Apr 3 19:35:05 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/user-links-in-scroll-history has been created
        at  218ba4ae055addcd59af2f4aab7886699c89108d (commit)

- Log -----------------------------------------------------------------
commit 218ba4ae055addcd59af2f4aab7886699c89108d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 3 15:05:15 2024 -0400

    Call ReplaceUserReferences for scroll mode of $ShowHistory
    
    It's to convert user text to links, other modes already have it.

diff --git a/share/html/Ticket/Elements/ScrollShowHistory b/share/html/Ticket/Elements/ScrollShowHistory
index 68e3c3cfed..924d4cf71c 100644
--- a/share/html/Ticket/Elements/ScrollShowHistory
+++ b/share/html/Ticket/Elements/ScrollShowHistory
@@ -148,6 +148,7 @@ jQuery(function(){
                 if(html && transactions.length) {
                     lastTransactionId = transactions.last().data('transactionId');
                     jQuery(".history-container").append(html);
+                    ReplaceUserReferences();
                     if ( transactions.filter(':not(.hidden.end-of-history-list)').length == 0 ) {
                         // if none is visible, automatically load more
                         isLoading = false;

commit 43d165b130c854ddca0918048df9da33a46abb4d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 3 14:57:48 2024 -0400

    Remove duplicates of ids when fetching user info
    
    Otherwise you might see requests like:
    
        https://rt.example.com/Helpers/UserInfo?id=14;id=14;id=14;id=14;id=14;id=14;id=14;id=14;id=14;id=14

diff --git a/share/static/js/event-registration.js b/share/static/js/event-registration.js
index 03ba528926..5cccf973a0 100644
--- a/share/static/js/event-registration.js
+++ b/share/static/js/event-registration.js
@@ -18,9 +18,9 @@ jQuery(function() {
 // Replace user references in history with the HTML versions
 function ReplaceUserReferences() {
     var users = jQuery(".user[data-replace=user]");
-    var ids   = users.map(function(){
+    var ids   = jQuery.unique(users.map(function(){
         return "id=" + encodeURIComponent(jQuery(this).attr("data-user-id"))
-    }).toArray().join(";");
+    }).toArray().sort()).join(";"); // Sort to put same items together so jQuery.unique can remove them.
 
     if (!ids.length)
         return

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list