[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.1-332-g881f360149

Jim Brandt jbrandt at bestpractical.com
Wed May 5 12:59:38 EDT 2021


The branch, 5.0-trunk has been updated
       via  881f360149e85bd06cd159af54ad0ade7a36e185 (commit)
       via  894e490d96143b42c74c42b4f6fd20b6f633153e (commit)
       via  8ef6b457cb65492f7996f193600df81b165e3fe7 (commit)
      from  bd0103e85d0adf7c11591e7b7ddd9656864949e2 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                                  | 2 +-
 share/html/Elements/QueueList                                        | 5 ++++-
 .../{Admin/Users/Memberships.html => Elements/QueueListAllStatuses}  | 2 +-
 share/html/Elements/QueueSummaryByLifecycle                          | 5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)
 copy share/html/{Admin/Users/Memberships.html => Elements/QueueListAllStatuses} (95%)

- Log -----------------------------------------------------------------
commit 8ef6b457cb65492f7996f193600df81b165e3fe7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 5 01:32:26 2021 +0800

    Add QueueListAllStatuses to show tickets info of all statuses

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 9abf52a08d..b1b8b2b78a 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2073,7 +2073,7 @@ user's customized homepage ("RT at a glance").
 Set(
     $HomepageComponents,
     [
-        qw(QuickCreate QueueList MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser MyAssets FindAsset FindGroup) # loc_qw
+        qw(QuickCreate QueueList QueueListAllStatuses MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser MyAssets FindAsset FindGroup) # loc_qw
     ]
 );
 
diff --git a/share/html/Elements/QueueList b/share/html/Elements/QueueList
index 6fa9f2c88b..351adb26ae 100644
--- a/share/html/Elements/QueueList
+++ b/share/html/Elements/QueueList
@@ -49,7 +49,7 @@
 
 <div class="ticket-overview">
 <&|/Widgets/TitleBox,
-    title => loc("Queue list"),
+    title => $Title,
     class => "fullwidth",
     bodyclass => "",
     titleright_raw => qq[<span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span>],
@@ -57,6 +57,7 @@
 &>
 <& $comp,
    queues => $session{$cache_key}{objects},
+   Statuses => \@Statuses
 &>
 </&>
 </div>
@@ -74,4 +75,6 @@ my $cache_key = SetObjectSessionCache(
 </%INIT>
 <%ARGS>
 $SplitByLifecycle => 1
+ at Statuses => qw/initial active/
+$Title => loc('Queue list')
 </%ARGS>
diff --git a/share/html/Elements/QueueList b/share/html/Elements/QueueListAllStatuses
similarity index 69%
copy from share/html/Elements/QueueList
copy to share/html/Elements/QueueListAllStatuses
index 6fa9f2c88b..588b15604d 100644
--- a/share/html/Elements/QueueList
+++ b/share/html/Elements/QueueListAllStatuses
@@ -45,33 +45,4 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% my $alt = loc('Edit');
-
-<div class="ticket-overview">
-<&|/Widgets/TitleBox,
-    title => loc("Queue list"),
-    class => "fullwidth",
-    bodyclass => "",
-    titleright_raw => qq[<span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span>],
-    titleright_href => RT->Config->Get('WebPath').'/Prefs/QueueList.html',
-&>
-<& $comp,
-   queues => $session{$cache_key}{objects},
-&>
-</&>
-</div>
-<%INIT>
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QueueList', {});
-my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
-my $cache_key = SetObjectSessionCache(
-    ObjectType => 'RT::Queue',
-    CheckRight => 'ShowTicket',
-    ShowAll => 0,
-    CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate,
-    Exclude => $unwanted,
-);
-
-</%INIT>
-<%ARGS>
-$SplitByLifecycle => 1
-</%ARGS>
+<& QueueList, Title => 'Queue list (all statuses)', Statuses => [qw/initial active inactive/] &>
diff --git a/share/html/Elements/QueueSummaryByLifecycle b/share/html/Elements/QueueSummaryByLifecycle
index d6df74023f..d31309c281 100644
--- a/share/html/Elements/QueueSummaryByLifecycle
+++ b/share/html/Elements/QueueSummaryByLifecycle
@@ -123,7 +123,7 @@ for my $queue (@$queues) {
 
 my @statuses;
 my %seen;
-foreach my $set ( 'initial', 'active' ) {
+foreach my $set ( @Statuses ) {
     foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
         push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set);
     }
@@ -149,4 +149,5 @@ while ( my $entry = $report->Next ) {
 </%INIT>
 <%ARGS>
 $queues => undef  # Arrayref of hashes with cached queue info
+ at Statuses => qw/initial active/
 </%ARGS>

commit 894e490d96143b42c74c42b4f6fd20b6f633153e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed May 5 03:36:17 2021 +0800

    Explicitly exclude "deleted" status from queue list
    
    Status "deleted" is quite speical that we skip deleted tickets on most
    pages on purpose, e.g. deleted tickets are not shown in search results.
    
    If we added "deleted" status here, the values would always be "-", which
    is also misleading.

diff --git a/share/html/Elements/QueueSummaryByLifecycle b/share/html/Elements/QueueSummaryByLifecycle
index d31309c281..129e2c1f52 100644
--- a/share/html/Elements/QueueSummaryByLifecycle
+++ b/share/html/Elements/QueueSummaryByLifecycle
@@ -122,7 +122,7 @@ for my $queue (@$queues) {
 }
 
 my @statuses;
-my %seen;
+my %seen = ( deleted => 1 ); # Always exclude "deleted"
 foreach my $set ( @Statuses ) {
     foreach my $lifecycle ( map $lifecycle{$_}, sort keys %lifecycle ) {
         push @statuses, grep !$seen{ lc $_ }++, $lifecycle->Valid($set);

commit 881f360149e85bd06cd159af54ad0ade7a36e185
Merge: bd0103e85d 894e490d96
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed May 5 11:53:58 2021 -0400

    Merge branch '5.0/queue-list-all-statuses' into 5.0-trunk


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


More information about the rt-commit mailing list