Skip to content

Commit

Permalink
Avoid accidental re-triggering of products
Browse files Browse the repository at this point in the history
* Ask for confirmation before invoking the re-trigger
* Related ticket: https://progress.opensuse.org/issues/124469
  • Loading branch information
Martchus committed Jul 5, 2023
1 parent 32cd24e commit 9cba29c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions assets/javascripts/test_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,4 +1123,11 @@ function renderDependencyGraph(container, nodes, edges, cluster, currentNode) {
// note: centering is achieved by centering the svg element itself like any other html block element
}

function rescheduleProductForJob(link) {
if (window.confirm('Do you really want to partially reschedule the product of this job?')) {
rescheduleProduct(link.dataset.url);
}
return false; // avoid usual link handling
}

module = {};
1 change: 1 addition & 0 deletions t/ui/18-tests-details.t
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ subtest 'scheduled product shown' => sub {
my $expected_params = qr/scheduled_product_clone_id=$expected_scheduled_product_id&TEST=kde/;
like $reschedule_link->get_attribute('data-url'), $expected_params, 'reschedule link shown';
$reschedule_link->click;
$driver->accept_alert;
wait_for_ajax msg => 'message for rescheduling';
element_visible '#flash-messages .alert > span', qr/Scheduled product to clone settings from misses DISTRI/, undef,
'error shown';
Expand Down
2 changes: 1 addition & 1 deletion templates/webapi/test/infopanel.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
% if (is_operator) {
<div class="btn-group btn-group-sm">
<a href="#"
onclick="rescheduleProduct(this.dataset.url); return true;" \
onclick="return rescheduleProductForJob(this);" \
class="btn btn-link"\
data-url="<%= url_for('apiv1_create_iso')->query(scheduled_product_clone_id => $sp_id, TEST => $job->TEST, _SKIP_CHAINED_DEPS => 1, _INCLUDE_CHILDREN => 1) %>">\
<i class="fa fa-2 fa-undo" title="Reschedule product from here"></i>
Expand Down

0 comments on commit 9cba29c

Please sign in to comment.