diff --git a/app/helpers/remote_execution_helper.rb b/app/helpers/remote_execution_helper.rb index 72700e9b3..1af5b47f3 100644 --- a/app/helpers/remote_execution_helper.rb +++ b/app/helpers/remote_execution_helper.rb @@ -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),