Skip to content

Commit

Permalink
Merge branch '6.0/lifecycle-editor-in-htmx'
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Dec 31, 2024
2 parents 4dc46a5 + 91a4537 commit c461b3e
Show file tree
Hide file tree
Showing 8 changed files with 848 additions and 864 deletions.
5 changes: 0 additions & 5 deletions lib/RT/Interface/Web.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2223,11 +2223,6 @@ sub RequestENV {
return $value;
}

sub ClientIsIE {
# IE 11.0 dropped "MSIE", so we can't use that alone
return RequestENV('HTTP_USER_AGENT') =~ m{MSIE|Trident/} ? 1 : 0;
}

=head2 ExpandShortenerCode $ARGS
Expand shortener code and put expanded ones into C<$ARGS>.
Expand Down
13 changes: 4 additions & 9 deletions lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1815,15 +1815,10 @@ sub _BuildAdminPageMenu {
RT::Interface::Web::EscapeURI(\$Name_uri);
RT::Interface::Web::EscapeURI(\$Type_uri);

unless ( RT::Interface::Web->ClientIsIE ) {
$page->child(
basics => title => loc('Modify'),
path => "/Admin/Lifecycles/Modify.html?Type=" . $Type_uri . ";Name=" . $Name_uri,
attributes => {
'hx-boost' => 'false',
},
);
}
$page->child(
basics => title => loc('Modify'),
path => "/Admin/Lifecycles/Modify.html?Type=" . $Type_uri . ";Name=" . $Name_uri,
);
$page->child( actions => title => loc('Actions'), path => "/Admin/Lifecycles/Actions.html?Type=" . $Type_uri . ";Name=" . $Name_uri );
$page->child( rights => title => loc('Rights'), path => "/Admin/Lifecycles/Rights.html?Type=" . $Type_uri . ";Name=" . $Name_uri );
$page->child( mappings => title => loc('Mappings'), path => "/Admin/Lifecycles/Mappings.html?Type=" . $Type_uri . ";Name=" . $Name_uri );
Expand Down
4 changes: 0 additions & 4 deletions share/html/Admin/Lifecycles/Advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@

$Config ||= JSON::to_json(RT->Config->Get('Lifecycles')->{$LifecycleObj->Name}, { canonical => 1, pretty => 1 });

if ( $ARGS{RedirectedFromModify} && RT::Interface::Web->ClientIsIE() ) {
push @results, loc("The graphical lifecycle builder is not currently supported on IE 11. You can update the lifecycle configuration using the Advanced tab or access the lifecycle editor in a supported browser.");
}

if ( !defined $Maps && ( my $all_maps = RT->Config->Get('Lifecycles')->{__maps__} ) ) {
for my $item ( grep {/^\Q$Name\E -> | -> \Q$Name\E$/} keys %$all_maps ) {
$Maps->{$item} = $all_maps->{$item};
Expand Down
7 changes: 0 additions & 7 deletions share/html/Admin/Lifecycles/Modify.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
</div>

<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/d3.min.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/lifecycleui-model.js"></script>
<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/lifecycleui-editor.js"></script>

<form action="<%RT->Config->Get('WebPath')%>/Admin/Lifecycles/Modify.html" name="ModifyLifecycle" method="post" enctype="multipart/form-data" class="mx-auto max-width-xl">
Expand All @@ -71,12 +70,6 @@
</form>
<%INIT>

if ( RT::Interface::Web->ClientIsIE() ) {
RT::Interface::Web::Redirect( RT->Config->Get('WebURL')
. "Admin/Lifecycles/Advanced.html?"
. $m->comp( '/Elements/QueryString', %ARGS, RedirectedFromModify => 1 ) );
}

my ($title, @results);
my $LifecycleObj = RT::Lifecycle->new();
$LifecycleObj->Load(Name => $Name, Type => $Type);
Expand Down
7 changes: 1 addition & 6 deletions share/html/Elements/Lifecycle/Graph
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<div class="lifecycle-ui" id="lifecycle-<% $id %>">
<div class="lifecycle-ui" id="lifecycle-<% $id %>" data-config="<% $Config %>" data-maps="<% $Maps %>" data-layout="<% $Layout || '' %>" >
<div id="lifeycycle-ui-edit-node" class="lifeycycle-ui-edit-node collapse card card-body">
<input type="hidden" name="id" />
<div class="alert alert-warning invalid-name hidden"><&|/l&>Invalid name</&></div>
Expand Down Expand Up @@ -74,11 +74,6 @@
</div>
</div>

<script type="text/javascript">
jQuery(function () {
new RT.NewLifecycleEditor( document.getElementById('lifecycle-<% $id %>'), <% $Config |n %>, <% $Maps |n %> <% $Layout ? ", $Layout" : () |n %> );
});
</script>
<div class="row">
<div class="col-auto">
<span class="current-value form-control">
Expand Down
Loading

0 comments on commit c461b3e

Please sign in to comment.