Mailing List Archive

rt branch 6.0/htmx updated. rt-5.0.5-233-g9c77d53fdc
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, 6.0/htmx has been updated
via 9c77d53fdcf39c03d9f3750e4bed0a0cbd03b63b (commit)
via 65d351ee42928c6ac36ccf40c8da3c697cafc037 (commit)
from c51bd7d18991ccabfd37c1f1cc4d98a28f4f86ca (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9c77d53fdcf39c03d9f3750e4bed0a0cbd03b63b
Author: sunnavy <sunnavy@bestpractical.com>
Date: Wed Mar 20 17:56:40 2024 -0400

Disable htmx boost requests for menu list pages

diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index c76e4760e9..e1d06091ef 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -124,6 +124,9 @@ sub BuildMainNav {
title => loc('Reports'),
description => loc('Reports and Dashboards'),
path => loc('/Reports'),
+ attributes => {
+ 'hx-boost' => 'false',
+ },
);

unless ($HTML::Mason::Commands::session{'dashboards_in_menu'}) {
@@ -232,7 +235,13 @@ sub BuildMainNav {
$assets->child( "search", title => loc("New Search"), path => "/Search/Build.html?Class=RT::Assets;NewQuery=1" );
}

- my $tools = $top->child( tools => title => loc('Tools'), path => '/Tools/index.html' );
+ my $tools = $top->child(
+ tools => title => loc('Tools'),
+ path => '/Tools/index.html',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
+ );

$tools->child( my_day =>
title => loc('My Day'),
@@ -1132,7 +1141,14 @@ sub _BuildAdminTopMenu {

my $current_user = $HTML::Mason::Commands::session{CurrentUser};

- my $admin = $top->child( admin => title => loc('Admin'), path => '/Admin/' );
+ my $admin = $top->child(
+ admin => title => loc('Admin'),
+ path => '/Admin/',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
+ );
+
if ( $current_user->HasRight( Object => RT->System, Right => 'AdminUsers' ) ) {
my $users = $admin->child( users =>
title => loc('Users'),
@@ -1204,6 +1220,9 @@ sub _BuildAdminTopMenu {
title => loc('Global'),
description => loc('Manage properties and configuration which apply to all queues'),
path => '/Admin/Global/',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
);

my $scrips = $admin_global->child( scrips =>
@@ -1279,7 +1298,14 @@ sub _BuildAdminTopMenu {
path => '/Admin/Global/CustomFields/Catalog-Assets.html',
);

- my $article_admin = $admin->child( articles => title => loc('Articles'), path => "/Admin/Articles/index.html" );
+ my $article_admin = $admin->child(
+ articles => title => loc('Articles'),
+ path => "/Admin/Articles/index.html",
+ attributes => {
+ 'hx-boost' => 'false',
+ },
+ );
+
my $class_admin = $article_admin->child(classes => title => loc('Classes'), path => '/Admin/Articles/Classes/' );
$class_admin->child( select =>
title => loc('Select'),
@@ -1306,7 +1332,14 @@ sub _BuildAdminTopMenu {
path => '/Admin/CustomFields/Modify.html?'.$HTML::Mason::Commands::m->comp("/Elements/QueryString", Create=>1, LookupType=> "RT::Class-RT::Article" ),
);

- my $assets_admin = $admin->child( assets => title => loc("Assets"), path => '/Admin/Assets/' );
+ my $assets_admin = $admin->child(
+ assets => title => loc("Assets"),
+ path => '/Admin/Assets/',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
+ );
+
my $catalog_admin = $assets_admin->child( catalogs =>
title => loc("Catalogs"),
description => loc("Modify asset catalogs"),
@@ -1363,6 +1396,9 @@ sub _BuildAdminTopMenu {
title => loc('Tools'),
description => loc('Use other RT administrative tools'),
path => '/Admin/Tools/',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
);
$admin_tools->child( configuration =>
title => loc('System Configuration'),

commit 65d351ee42928c6ac36ccf40c8da3c697cafc037
Author: sunnavy <sunnavy@bestpractical.com>
Date: Wed Mar 20 17:30:43 2024 -0400

Disable htmx boost requests for pages with additional js files

Unlike normal html parsing order, it seems that htmx doesn't pause parsing
html when encountering an external script tag(<script src=...). The
following js relying on previous scripts would throw error in this case.

diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index 1f6031ee44..c76e4760e9 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -1373,6 +1373,9 @@ sub _BuildAdminTopMenu {
title => loc('Theme'),
description => loc('Customize the look of your RT'),
path => '/Admin/Tools/Theme.html',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
);
if (RT->Config->Get('StatementLog')
&& $current_user->HasRight( Right => 'SuperUser', Object => RT->System )) {
@@ -1380,6 +1383,9 @@ sub _BuildAdminTopMenu {
title => loc('SQL Queries'),
description => loc('Browse the SQL queries made in this process'),
path => '/Admin/Tools/Queries.html',
+ attributes => {
+ 'hx-boost' => 'false',
+ },
);
}
$admin_tools->child( rights_inspector =>
@@ -1662,7 +1668,13 @@ sub _BuildAdminPageMenu {
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 );
+ $page->child(
+ basics => title => loc('Modify'),
+ path => "/Admin/Lifecycles/Modify.html?Type=" . $Type_uri . ";Name=" . $Name_uri,
+ attributes => {
+ 'hx-boost' => 'false',
+ },
+ );
}
$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 );
diff --git a/share/html/Admin/Lifecycles/Create.html b/share/html/Admin/Lifecycles/Create.html
index e3f8d9c3e1..609dbf4ada 100644
--- a/share/html/Admin/Lifecycles/Create.html
+++ b/share/html/Admin/Lifecycles/Create.html
@@ -49,7 +49,7 @@
<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@results &>

-<form action="<%RT->Config->Get('WebPath')%>/Admin/Lifecycles/Create.html" name="CreateLifecycle" method="post" enctype="multipart/form-data" class="mx-auto max-width-lg">
+<form hx-boost="false" action="<%RT->Config->Get('WebPath')%>/Admin/Lifecycles/Create.html" name="CreateLifecycle" method="post" enctype="multipart/form-data" class="mx-auto max-width-lg">

<&| /Widgets/TitleBox, class => 'lifecycle-info-basics', content_class => 'mx-auto width-sm' &>
<&| /Elements/LabeledValue, Label => loc('Lifecycle Name') &>
diff --git a/share/html/Admin/Lifecycles/index.html b/share/html/Admin/Lifecycles/index.html
index bb47d560f4..bbe1c757be 100644
--- a/share/html/Admin/Lifecycles/index.html
+++ b/share/html/Admin/Lifecycles/index.html
@@ -76,7 +76,7 @@
% next if $lifecycles{$key}{'disabled'} and !$FindDisabledLifecycles;

<tr class="<% $i % 2 ? 'oddline' : 'evenline' %>">
- <td class="collection-as-table"><a href="<% RT->Config->Get('WebURL') %>Admin/Lifecycles/Modify.html?Type=<% $lifecycles{$key}{'type'} ? loc($lifecycles{$key}{'type'}) : loc('ticket') |u %>&Name=<% $key %>"><% $key %></a></td>
+ <td class="collection-as-table"><a hx-boost="false" href="<% RT->Config->Get('WebURL') %>Admin/Lifecycles/Modify.html?Type=<% $lifecycles{$key}{'type'} ? loc($lifecycles{$key}{'type'}) : loc('ticket') |u %>&Name=<% $key %>"><% $key %></a></td>
<td class="collection-as-table"><% $lifecycles{$key}{'type'} ? loc($lifecycles{$key}{'type'}) : loc('ticket') %></td>
<td class="collection-as-table">
<div class="form-check">

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

Summary of changes:
lib/RT/Interface/Web/MenuBuilder.pm | 58 ++++++++++++++++++++++++++++++---
share/html/Admin/Lifecycles/Create.html | 2 +-
share/html/Admin/Lifecycles/index.html | 2 +-
3 files changed, 55 insertions(+), 7 deletions(-)


hooks/post-receive
--
rt
_______________________________________________
rt-commit mailing list
rt-commit@lists.bestpractical.com
https://lists.bestpractical.com/mailman/listinfo/rt-commit