Skip to content

Commit 896fe35

Browse files
Merge branch '6.0/htmx-admin-lifecycle' into 6.0-trunk
2 parents fd3bd06 + 1fe5353 commit 896fe35

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

lib/RT/Interface/Web.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,8 @@ sub Redirect {
12281228
$HTML::Mason::Commands::r->{query}->env->{REQUEST_METHOD} = 'GET';
12291229
$HTML::Mason::Commands::r->headers_out->{'HX-Push-Url'} = "$uri";
12301230
my $args = $uri->query_form_hash;
1231+
1232+
RT->System->MaybeRebuildLifecycleCache();
12311233
ExpandShortenerCode($args);
12321234
local $HTML::Mason::Commands::DECODED_ARGS = $args;
12331235
$HTML::Mason::Commands::m->comp( $path, %$args );

share/static/js/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ htmx.onLoad(function(elt) {
16121612

16131613
if (elt.querySelectorAll('.lifecycle-ui').length) {
16141614
const checkLifecycleEditor = setInterval(function () {
1615-
if (d3 && RT.NewLifecycleEditor) {
1615+
if (window.d3 && RT.NewLifecycleEditor) {
16161616
clearInterval(checkLifecycleEditor);
16171617
elt.querySelectorAll('.lifecycle-ui').forEach(elt => {
16181618
new RT.NewLifecycleEditor(elt, JSON.parse(elt.getAttribute('data-config')), JSON.parse(elt.getAttribute('data-maps')), elt.getAttribute('data-layout') ? JSON.parse(elt.getAttribute('data-layout')) : null);

t/selenium/global_admin_pages.t

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ $s->login();
161161
is( $final_name_field, $copied_action_name, 'Found new action name in Name field' );
162162
}
163163

164+
# Test lifecycle admin functionality
165+
{
166+
$s->get_ok( $url . '/Admin/Lifecycles/Rights.html?Type=ticket;Name=default', 'Go to lifecycle rights page' );
167+
$s->submit_form_ok(
168+
{ form_name => 'ModifyLifecycleRights',
169+
fields => {
170+
'Right-From-3' => 'new',
171+
'Right-To-3' => 'open',
172+
'Right-Name-3' => 'OpenTicket',
173+
},
174+
button => 'Update',
175+
},
176+
'Update lifecycle rights'
177+
);
178+
$s->text_contains( 'Lifecycle updated', 'Lifecycle updated message' );
179+
is( $s->find_element( selector_to_xpath(q{input[name='Right-Name-3']}) )->get_value(),
180+
'OpenTicket', 'Form is updated' );
181+
}
182+
164183
$s->logout;
165184

166185
done_testing;

0 commit comments

Comments
 (0)