Skip to content

Commit f8d149c

Browse files
committed
Disable lazy load for click/delay history widget
The history widget is lightweight in both modes, as the actual history data is already fetched asynchronously. This makes lazy loading unnecessary. This ensures the "Show ticket history" link is always present, which will support the upcoming "Jump to Unread" tweak in click mode.
1 parent 6803a7c commit f8d149c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

share/html/Elements/ShowWidgets

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@
114114
% );
115115
% $show_widget = $comp->call_method( 'PreCheck', %precheck_args );
116116
% }
117+
% my $lazy_load;
118+
% if ( $comp->method_exists('LazyLoad') ) {
119+
% my %args = (
120+
% Object => $Object,
121+
% Page => $Page,
122+
% ARGSRef => $ARGSRef,
123+
% defined $argument ? ( Argument => $argument ) : (),
124+
% ref $widget ? map( { $_ eq 'Name' ? () : ( $_ => $widget->{$_} ) } keys %$widget ) : (),
125+
% );
126+
% $lazy_load = $comp->call_method( 'LazyLoad', %args );
127+
% }
117128
%
118129
% if ( $show_widget ) {
119130
% my $view_path = $path =~ m{^/SelfService/(.+)} ? "/SelfService/Views/$1" : "/Views$path";
@@ -124,7 +135,7 @@
124135
ref $widget ? map( { $_ eq 'Name' ? () : ( $_ => $widget->{$_} ) } keys %$widget ) : (),
125136
map { $_ => $passed_args->{$_} } grep { !blessed $passed_args->{$_} } keys %$passed_args,
126137
},
127-
lazy_load => $Page =~ /Create|Update/ ? 0 : 1,
138+
lazy_load => $lazy_load // ( $Page =~ /Create|Update/ ? 0 : 1 ),
128139
class => 'htmx-load-widget',
129140
&>
130141
<& /Widgets/HTMXLoadEnd &>

share/html/Ticket/Widgets/Display/History

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080

8181
% $m->callback( %ARGS, CallbackName => 'AfterWidget' );
8282

83+
<%METHOD LazyLoad>
84+
<%INIT>
85+
my $ShowHistory = $ARGS{ShowHistory} || RT->Config->Get( "ShowHistory", $session{'CurrentUser'} );
86+
return $ShowHistory =~ /^(?:click|delay)$/ ? 0 : 1;
87+
</%INIT>
88+
</%METHOD>
89+
8390
<%ARGS>
8491
$TicketObj
8592
</%ARGS>

0 commit comments

Comments
 (0)