Skip to content

Commit

Permalink
Show a hint message in dashboard emails if charts are not available
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Dec 5, 2024
1 parent 03d8b9d commit 8fee24e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions share/html/Search/Elements/Chart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ RT::Interface::Web::Session::Set(
<div class="col-auto">
% if ( ($ChartStyle || '') =~ /\b(pie|bar|line)\b/ ) {
<div class="chart image <% $1 %> w-auto">
% if ( !$r->isa('RT::Dashboard::FakeRequest') || RT->Config->Get('EmailDashboardIncludeCharts') ) {
<& /Search/JSChart, Cache => $key, %ARGS, GroupBy => \@GroupBy &>
% } else {
<span><&|/l&>Chart is not available in emails, click title to get the live version.</&></span>
% }
</div>
% }
</div>
Expand Down
2 changes: 2 additions & 0 deletions t/mail/dashboard-chart-with-utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,6 @@ like(
'mail subject'
);

like( $mail->bodyhandle->as_string, qr/Chart is not available in emails, click title to get the live version/, 'chart hint' );

done_testing;

0 comments on commit 8fee24e

Please sign in to comment.