Skip to content

Commit

Permalink
Fixes #37679 - Add rerun succeeded button
Browse files Browse the repository at this point in the history
to job invocation details
  • Loading branch information
adamruzicka authored and ofedoren committed Jul 25, 2024
1 parent 80549c3 commit 6ad7678
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/helpers/remote_execution_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ def job_invocation_task_buttons(task)
buttons << link_to(_('Rerun'), rerun_job_invocation_path(:id => job_invocation.id),
:class => 'btn btn-default',
:title => _('Rerun the job'))
end
if authorized_for(controller: :job_invocations, action: :create)
buttons << link_to(_('Rerun failed'), rerun_job_invocation_path(:id => job_invocation.id, :failed_only => 1),
:class => 'btn btn-default',
:disabled => job_invocation.failed_hosts.none?,
:title => _('Rerun on failed hosts'))
buttons << link_to(_('Rerun succeeded'), rerun_job_invocation_path(:id => job_invocation.id, :succeeded_only => 1),
:class => 'btn btn-default',
:disabled => job_invocation.succeeded_hosts.none?,
:title => _('Rerun on succeeded hosts'))
end
if authorized_for(:permission => :view_foreman_tasks, :auth_object => task, :authorizer => task_authorizer)
buttons << link_to(_('Job Task'), foreman_tasks_task_path(task),
Expand Down

0 comments on commit 6ad7678

Please sign in to comment.