Skip to content

Commit

Permalink
Merge branch '5.0/fix-ticket-graph-saved-search' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Nov 17, 2023
2 parents 19d55bf + 5fe30cf commit 6809d3f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/RT/Interface/Web.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2051,6 +2051,10 @@ sub ExpandShortenerCode {
if ( $type eq 'Chart' ) {
$content->{SavedChartSearchId} = $id;
}
elsif ( $type eq 'Graph' ) {
$content->{SavedSearchId} = $id;
$content->{SearchType} = 'Graph';
}
else {
$content->{SavedSearchId} = $id;
$content->{Class} = "RT::${type}s";
Expand Down
1 change: 1 addition & 0 deletions lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ sub BuildMainNav {
(
$request_path =~ m{^/(?:Ticket|Transaction|Search)/}
&& $request_path !~ m{^/Search/Simple\.html}
&& ($HTML::Mason::Commands::DECODED_ARGS->{SearchType} // '') ne 'Graph'
)
|| ( $request_path =~ m{^/Search/Simple\.html}
&& $HTML::Mason::Commands::DECODED_ARGS->{'q'} )
Expand Down
2 changes: 1 addition & 1 deletion share/html/Search/Elements/EditSearches
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<div class="label col-4"><&|/l&>Permalink</&>:</div>
<div class="col-8">
<span class="form-control current-value">
<a href="<% $m->request_path %>?sc=<% $saved_search->ShortenerObj->Code %>" class="permalink" data-toggle="tooltip" data-original-title="<% loc('Permalink to this saved search') %>" data-code="<% $saved_search->ShortenerObj->Code %>" data-url="<% $m->request_path %>?sc=<% $saved_search->ShortenerObj->Code %>"><% loc('View') %></a>
<a href="<% $m->request_path %>?sc=<% $saved_search->ShortenerObj->Code %>" class="permalink" data-toggle="tooltip" data-original-title="<% loc('Permalink to this saved search') %>" data-code="<% $saved_search->ShortenerObj->Code %>" data-url="<% $m->request_path %>?sc=<% $saved_search->ShortenerObj->Code %><% ($saved_search->Type // '') eq 'Graph' ? "&id=$DECODED_ARGS->{id}" : '' %>"><% loc('View') %></a>
</span>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion share/html/Ticket/Graphs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

my @results;

my @save_arguments = qw(id Direction LeadingLink ShowLinks MaxDepth FillUsing ShowLinkDescriptions);
my @save_arguments = qw(Direction LeadingLink ShowLinks MaxDepth FillUsing ShowLinkDescriptions);
foreach my $level ( 0 .. 6 ) {
push @save_arguments, "Level-". $level ."-Properties";
}
Expand All @@ -96,6 +96,7 @@
Query => \%ARGS,
SavedSearch => $saved_search,
SearchFields => \@save_arguments,
Type => 'Graph',
);

$ARGS{'LeadingLink'} ||= 'Members';
Expand Down

0 comments on commit 6809d3f

Please sign in to comment.