[Rt-commit] rt branch 5.0/search-chart-table-wrap created. rt-5.0.4-66-g2501a23b7b

BPS Git Server git at git.bestpractical.com
Wed Jul 19 18:30:05 UTC 2023


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/search-chart-table-wrap has been created
        at  2501a23b7b2c3949d35afe2cc3616c2b1ea59a58 (commit)

- Log -----------------------------------------------------------------
commit 2501a23b7b2c3949d35afe2cc3616c2b1ea59a58
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 19 13:24:42 2023 -0400

    Make search chart tables responsive
    
    This is to make sure users can scroll horizontally on chart tables that
    are added to narrow dashboard sidebars.

diff --git a/share/html/Search/Elements/ChartTable b/share/html/Search/Elements/ChartTable
index 42ff31df4f..0a745d7ceb 100644
--- a/share/html/Search/Elements/ChartTable
+++ b/share/html/Search/Elements/ChartTable
@@ -58,7 +58,7 @@ my $interp = $m->interp;
 my $eh  = sub { $interp->apply_escapes( @_, 'h' ) };
 my $eu  = sub { $interp->apply_escapes( @_, 'u' ) };
 
-$m->out('<table class="table table-bordered collection-as-table chart">'. "\n");
+$m->out('<table class="table table-bordered table-responsive collection-as-table chart">'. "\n");
 foreach my $section (qw(thead tbody tfoot)) {
     next unless $Table{ $section } && @{ $Table{ $section } };
 

commit 516b12517d0eb9aef5272d4b44e0e448457f2c26
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Jul 19 12:59:19 2023 -0400

    Allow to wrap for normal collection list headers
    
    Previously in d76e1bffed, to show order indicators on the same line with
    header texts, we disallowed related "th" to wrap, which unexpectedly
    affected other collection lists like search charts, which don't put
    header texts to "span.title" that can be wrapped.
    
    This commit amended related css, so plain collection list headers could
    be wrapped just like before.

diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
index 33fe27a1b8..9b4ac06fff 100644
--- a/share/html/Elements/CollectionAsTable/Header
+++ b/share/html/Elements/CollectionAsTable/Header
@@ -128,7 +128,11 @@ foreach my $col ( @Format ) {
     my $span = $col->{'span'};
     $item += ($span || 1);
 
-    $m->out('<th class="collection-as-table"');
+    my $class = 'collection-as-table';
+    $class .= ' allow-sorting' if $AllowSorting;
+    $class .= ' allow-filtering' if $AllowFiltering;
+
+    $m->out(qq{<th class="$class"});
     $m->out(' colspan="' . $m->interp->apply_escapes($span  => 'h') . '"')
         if $span;
 
diff --git a/share/static/css/elevator-light/collection.css b/share/static/css/elevator-light/collection.css
index 5a103989be..aec03dc1c2 100644
--- a/share/static/css/elevator-light/collection.css
+++ b/share/static/css/elevator-light/collection.css
@@ -58,11 +58,11 @@ th.collection-as-table svg.fa-sort {
 }
 
 /* To not wrap icons in header */
-th.collection-as-table {
+th.collection-as-table.allow-sorting {
     white-space: nowrap;
 }
 
-th.collection-as-table span.title {
+th.collection-as-table.allow-sorting span.title {
     white-space: normal;
 }
 

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list