Bug 27421: (QA follow-up) Add redirection to job details

Low budget implementation. After 5 seconds we jump to jobs.
Small jobs should already be finished.

Test plan:
Try staging a file. Wait and see if you got redirected.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-09-06 12:44:39 +00:00 committed by Tomas Cohen Arazi
parent d939368ce9
commit 5a5536c436
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 14 additions and 2 deletions

View file

@ -77,7 +77,7 @@
[% IF job_enqueued %]
<div class="dialog message">
<p>The job has been enqueued! It will be processed as soon as possible.</p>
<p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
<p><a class="job_details" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
</div>
[% ELSIF ( label_batch_msg ) %]
@ -608,6 +608,12 @@
return confirm(_("Clear all reservoir records staged in this batch? This cannot be undone."));
}
});
[% IF job_enqueued %]
setTimeout(
function() { window.location.href=$('a.job_details').attr('href'); },
5000, // 5 secs to read
);
[% END %]
});
</script>

View file

@ -74,7 +74,7 @@
<h1>MARC staging</h1>
<div class="dialog message">
<p>The job has been enqueued! It will be processed as soon as possible.</p>
<p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
<p><a class="job_details" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
</div>
[% ELSE %]
<h1>Stage MARC records for import</h1>
@ -421,6 +421,12 @@
alert(_("An error occurred")+"\n\n"+((error.responseJSON && error.responseJSON.error) || error.responseText || error.statusText));
})
});
[% IF job_enqueued %]
setTimeout(
function() { window.location.href=$('a.job_details').attr('href'); },
5000, // 5 secs to read
);
[% END %]
});
function StartUpload() {